All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64: properly update RSI/RDI after emulated ins/outs (again)
@ 2006-06-01 12:35 Jan Beulich
  2006-06-01 13:03 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2006-06-01 12:35 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

Unfortunately, the previous patch to address this wasn't taken unmodified, and the modification (c/s 10171, including
most of the additions over the original patch) made the changes useless - the conditional operator yields unsigned if
either of the operands is unsigned and the other is signed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

[-- Attachment #2: xen-x86_64-string-ops-backward.patch --]
[-- Type: text/plain, Size: 2490 bytes --]

--- /home/jbeulich/src/xen/2006-05-31/xen/arch/x86/traps.c	2006-06-01 13:23:27.000000000 +0200
+++ 2006-05-31/xen/arch/x86/traps.c	2006-06-01 14:05:40.000000000 +0200
@@ -876,7 +876,7 @@ static int emulate_privileged_op(struct 
                     PAGE_FAULT(regs->edi, USER_WRITE_FAULT);
                 break;
             }
-            regs->edi += (regs->eflags & EF_DF) ? -(int)op_bytes : op_bytes;
+            regs->edi += (regs->eflags & EF_DF) ? -(long)op_bytes : op_bytes;
             break;
 
         case 0x6e: /* OUTSB */
@@ -902,7 +902,7 @@ static int emulate_privileged_op(struct 
                 outl_user((u32)data, (u16)regs->edx, v, regs);
                 break;
             }
-            regs->esi += (regs->eflags & EF_DF) ? -(int)op_bytes : op_bytes;
+            regs->esi += (regs->eflags & EF_DF) ? -(long)op_bytes : op_bytes;
             break;
         }
 
--- /home/jbeulich/src/xen/2006-05-31/xen/arch/x86/x86_emulate.c	2006-06-01 13:23:26.000000000 +0200
+++ 2006-05-31/xen/arch/x86/x86_emulate.c	2006-06-01 14:29:53.000000000 +0200
@@ -942,9 +942,9 @@ x86_emulate_memop(
                 goto done;
         }
         register_address_increment(
-            _regs.esi, (_regs.eflags & EFLG_DF) ? -(int)dst.bytes : dst.bytes);
+            _regs.esi, (_regs.eflags & EFLG_DF) ? -(long)dst.bytes : dst.bytes);
         register_address_increment(
-            _regs.edi, (_regs.eflags & EFLG_DF) ? -(int)dst.bytes : dst.bytes);
+            _regs.edi, (_regs.eflags & EFLG_DF) ? -(long)dst.bytes : dst.bytes);
         break;
     case 0xa6 ... 0xa7: /* cmps */
         DPRINTF("Urk! I don't handle CMPS.\n");
@@ -955,7 +955,7 @@ x86_emulate_memop(
         dst.ptr   = (unsigned long *)cr2;
         dst.val   = _regs.eax;
         register_address_increment(
-            _regs.edi, (_regs.eflags & EFLG_DF) ? -(int)dst.bytes : dst.bytes);
+            _regs.edi, (_regs.eflags & EFLG_DF) ? -(long)dst.bytes : dst.bytes);
         break;
     case 0xac ... 0xad: /* lods */
         dst.type  = OP_REG;
@@ -964,7 +964,7 @@ x86_emulate_memop(
         if ( (rc = ops->read_emulated(cr2, &dst.val, dst.bytes, ctxt)) != 0 )
             goto done;
         register_address_increment(
-            _regs.esi, (_regs.eflags & EFLG_DF) ? -(int)dst.bytes : dst.bytes);
+            _regs.esi, (_regs.eflags & EFLG_DF) ? -(long)dst.bytes : dst.bytes);
         break;
     case 0xae ... 0xaf: /* scas */
         DPRINTF("Urk! I don't handle SCAS.\n");

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-01 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 12:35 [PATCH] x86_64: properly update RSI/RDI after emulated ins/outs (again) Jan Beulich
2006-06-01 13:03 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.