[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] hvm qemu: Fix for masking 64-bit operands broke 32-bit operands with



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1179047074 -3600
# Node ID 3ecf516896719b667833183a4aa87975824b931b
# Parent  65ce4866d20be1394f3c7f83f6451686d4be1fb0
hvm qemu: Fix for masking 64-bit operands broke 32-bit operands with
32-bit qemu. Issue spotted and initial fix provided by Dexuan Cui.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/ioemu/target-i386-dm/helper2.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -r 65ce4866d20b -r 3ecf51689671 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c      Sat May 12 19:22:24 2007 +0100
+++ b/tools/ioemu/target-i386-dm/helper2.c      Sun May 13 10:04:34 2007 +0100
@@ -495,8 +495,12 @@ void cpu_ioreq_xchg(CPUState *env, ioreq
 
 void __handle_ioreq(CPUState *env, ioreq_t *req)
 {
-    if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) && (req->size != 
sizeof(req->data)))
-       req->data &= (1UL << (8 * req->size)) - 1;
+    if (!req->data_is_ptr && (req->dir == IOREQ_WRITE)) {
+        /* Clamp data operand to size of a long. */
+        if (req->size < sizeof(long))
+            req->data &= (1UL << (8 * req->size)) - 1;
+        req->data = (unsigned long)req->data;
+    }
 
     switch (req->type) {
     case IOREQ_TYPE_PIO:

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.