From: Chris Morrow Subject: xc_translate_foreign_address Date: Tue, 24 Apr 2007 18:51:29 -0600 Message-ID: <462EA611.2000904@YottaYotta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Xc_translate_foreign_address has issues when try to translate addresses from the a non PAE domain. Lines 135 & 159 do a retrieve a 64 bit quantity using a *(unsigned long long *) cast, when what is required is an unsigned long. diff -r 489f28021f26 tools/libxc/xc_pagetab.c --- a/tools/libxc/xc_pagetab.c Wed Dec 20 09:47:24 2006 +0000 +++ b/tools/libxc/xc_pagetab.c Fri Apr 20 18:38:22 2007 -0600 @@ -132,7 +132,7 @@ unsigned long xc_translate_foreign_addre if (pt_levels >= 3) pde = *(unsigned long long *)(pd + 8 * ((virt >> L2_PAGETABLE_SHIFT_PAE) & L2_PAGETABLE_MASK_PAE)); else - pde = *(unsigned long long *)(pd + 4 * ((virt >> L2_PAGETABLE_SHIFT) & L2_PAGETABLE_MASK)); + pde = *(unsigned long *)(pd + 4 * ((virt >> L2_PAGETABLE_SHIFT) & L2_PAGETABLE_MASK)); if ((pde & 1) == 0) { DPRINTF("page entry not present in PD\n"); @@ -156,7 +156,7 @@ unsigned long xc_translate_foreign_addre if (pt_levels >= 3) pte = *(unsigned long long *)(pt + 8 * ((virt >> L1_PAGETABLE_SHIFT_PAE) & L1_PAGETABLE_MASK_PAE)); else - pte = *(unsigned long long *)(pt + 4 * ((virt >> L1_PAGETABLE_SHIFT) & L1_PAGETABLE_MASK)); + pte = *(unsigned long *)(pt + 4 * ((virt >> L1_PAGETABLE_SHIFT) & L1_PAGETABLE_MASK)); if ((pte & 0x00000001) == 0) { DPRINTF("page entry not present in PT\n"); -- Chris Morrow YottaYotta Inc. email: cmorrow@yottayotta.com phone: (780) 989 6814 web: http://www.yottayotta.com