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/
Home Products Support Community News


[Xen-devel] [PATCH] fix xenctx with 32-on-64 domains

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix xenctx with 32-on-64 domains
From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date: Thu, 3 Mar 2011 18:08:57 +0100
Delivery-date: Thu, 03 Mar 2011 09:09:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
User-agent: Mercurial-patchbomb/1.7.5
# 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.

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

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