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 xenctx with 32-on-64 domains

To: Paolo Bonzini <pbonzini@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] fix xenctx with 32-on-64 domains
From: Keir Fraser <keir@xxxxxxx>
Date: Thu, 03 Mar 2011 17:47:57 +0000
Cc:
Delivery-date: Thu, 03 Mar 2011 09:48:39 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:user-agent:date:subject:from:to :message-id:thread-topic:thread-index:in-reply-to:mime-version :content-type:content-transfer-encoding; bh=NFuh7KQic3EfGK0XkCn3wHjmT2zJoXJX6JN7NFfBcsM=; b=nb/ymYbekW3DCZIHky8ODzlyFNtV7j2WYynQWYoZ9hys06WPhmg78AsHQXUebFQmJg LVUJvrGVGdTpW2NyhnMzH9YSWumRL7SV7DeslUT8Isy99mzrKHte7UqilKMmTAe1lJys YXOStTz6IExzPqPJjCvOr3JmnwRXwqhdHODUY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=hZNFiKuNyrQZrZpr/cj+o0TxdB/SVln/4Mao0++78815uGw/LxcWibHAbaDLDY0SC5 Yf3fEdLOhsSWCdFoVCXhNIKs5xf8gOFXIMA4d05x+fBdNZzLZwyyA0uXN/AmKJRhq5ze 3DOhmVjJeruKhoGM2j5mbZ6jk/lpz/bMdhxsY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <c639f0afaa74591d1053.1299171243@xxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvZyyFF59d8RNcG1ki6Ro5NmiZB6w==
Thread-topic: [Xen-devel] [PATCH] fix xenctx with 32-on-64 domains
User-agent: Microsoft-Entourage/12.28.0.101117
On 03/03/2011 17:08, "Paolo Bonzini" <pbonzini@xxxxxxxxxx> wrote:

> # HG changeset patch
> # User Paolo Bonzini <pbonzini@xxxxxxxxxx>
> # Date 1299171180 -3600
> # Node ID c639f0afaa74591d1053677b0a6348503a14fd78
> # Parent  c923816861a96328aaf3d5ba8939fd9b4c441cd0
> fix xenctx with 32-on-64 domains
> 
> When compiled on 64-bit, xenctx was using the 64-bit version
> of xen_cr3_to_pfn even for 32-bit PV domains.  This is wrong,
> and this patch fixes it.

I applied a better version (clearer, and also fixes 64-bit PV domU / 32-bit
PV dom0) as c/s 22966.

 -- Keir

> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> 
> diff --git a/tools/libxc/xc_pagetab.c b/tools/libxc/xc_pagetab.c
> --- a/tools/libxc/xc_pagetab.c
> +++ b/tools/libxc/xc_pagetab.c
> @@ -64,8 +64,8 @@ unsigned long xc_translate_foreign_addre
>              paddr = ctx.x64.ctrlreg[3] & ~0xfffull;
>          } else {
>              pt_levels = 3;
> -            paddr = (((uint64_t) xen_cr3_to_pfn(ctx.x32.ctrlreg[3]))
> -                     << PAGE_SHIFT);
> +            paddr = (((unsigned)ctx.x32.ctrlreg[3] >> 12) |
> +                     ((unsigned)ctx.x32.ctrlreg[3] << 20)) << PAGE_SHIFT;
>          }
>      }
>  
> 
> 
> 
> _______________________________________________
> 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>