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-devel

Re: [Xen-devel] [PATCH] Fix write parameter masking for 32-bit guests.

To: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix write parameter masking for 32-bit guests.
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Sun, 13 May 2007 10:05:23 +0100
Delivery-date: Sun, 13 May 2007 02:01:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <FE7BBCFBB500984A9A7922EBC95F516E27CED7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AceVMzhKOfboKd4hQNKFfDAIGnB8iAABUTkQAAFWXUg=
Thread-topic: [Xen-devel] [PATCH] Fix write parameter masking for 32-bit guests.
User-agent: Microsoft-Entourage/11.3.3.061214
Okay, see c/s 15053.

 Thanks,
 Keir

On 13/5/07 09:47, "Cui, Dexuan" <dexuan.cui@xxxxxxxxx> wrote:

> Well, the method in the previous mail may be a little complex -- I think the
> simplest way is:
> 
> -    if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) && (req->size !=
> sizeof(req->data)))
> +    if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) && (req->size !=
> sizeof(long)))
> 
> Since sizeof(long) = 4 in 32-bit platform, and  = 8 in 64-bit platform, the
> code here can work properly in 32/64-bit platforms.
> 
> -- Dexuan
> 
> 
> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Cui, Dexuan
> Sent: 2007年5月13日 15:49
> To: xen-devel@xxxxxxxxxxxxxxxxxxx
> Cc: Keir Fraser
> Subject: [Xen-devel] [PATCH] Fix write parameter masking for 32-bit guests.
> 
> Changeset 15046:e527b4ff1948 breaks 32-bit HVM guest: when req->size is
> 4, "1UL << 32" returns 1 in IA32 system, so the mask becomes 0 wrongly.
> The attached patch fixes this by using 64-bit left-shift.
> 
> Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>