[XEN][EMUL] x86 emulator should support 32-bit offsets in real mode.
authorkfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com>
Tue, 27 Jun 2006 09:36:51 +0000 (10:36 +0100)
committerkfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com>
Tue, 27 Jun 2006 09:36:51 +0000 (10:36 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_emulate.c

index 99e707d4f078f343be9f5d8711f2c490b37c6b6a..f8192a28198613528d74ac0742f05b5cb0f950ec 100644 (file)
@@ -374,9 +374,8 @@ do{ __asm__ __volatile__ (                                              \
 
 /* Access/update address held in a register, based on addressing mode. */
 #define register_address(sel, reg)                                      \
-    ((ad_bytes == sizeof(unsigned long)) ? (reg) :                      \
-     ((mode == X86EMUL_MODE_REAL) ? /* implies ad_bytes == 2 */         \
-      (((unsigned long)(sel) << 4) + ((reg) & 0xffff)) :                \
+    (((mode == X86EMUL_MODE_REAL) ? ((unsigned long)(sel) << 4) : 0) +  \
+     ((ad_bytes == sizeof(unsigned long)) ? (reg) :                     \
       ((reg) & ((1UL << (ad_bytes << 3)) - 1))))
 #define register_address_increment(reg, inc)                            \
 do {                                                                    \
@@ -510,10 +509,6 @@ x86_emulate_memop(
     }
  done_prefixes:
 
-    /* Note quite the same as 80386 real mode, but hopefully good enough. */
-    if ( (mode == X86EMUL_MODE_REAL) && (ad_bytes != 2) )
-        goto cannot_emulate;
-
     /* REX prefix. */
     if ( (mode == X86EMUL_MODE_PROT64) && ((b & 0xf0) == 0x40) )
     {