WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm qemu: Fix for masking 64-bit operands broke 32-bit operands with
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 May 2007 08:21:25 -0700
Delivery-date: Tue, 15 May 2007 08:23:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm qemu: Fix for masking 64-bit operands broke 32-bit operands with, Xen patchbot-unstable <=