ia64/xen-unstable

changeset 14928:867965efcbd2

libxc: Fix xc_translate_foreign_address() to parse non-pae pagetables
correctly.
From: Chris Morrow <cmorrow@yottayotta.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Apr 25 09:49:18 2007 +0100 (2007-04-25)
parents 23d1ef48e332
children 550a795a3dbd
files tools/libxc/xc_pagetab.c
line diff
     1.1 --- a/tools/libxc/xc_pagetab.c	Wed Apr 25 09:46:43 2007 +0100
     1.2 +++ b/tools/libxc/xc_pagetab.c	Wed Apr 25 09:49:18 2007 +0100
     1.3 @@ -132,7 +132,7 @@ unsigned long xc_translate_foreign_addre
     1.4      if (pt_levels >= 3)
     1.5          pde = *(unsigned long long *)(pd + 8 * ((virt >> L2_PAGETABLE_SHIFT_PAE) & L2_PAGETABLE_MASK_PAE));
     1.6      else
     1.7 -        pde = *(unsigned long long *)(pd + 4 * ((virt >> L2_PAGETABLE_SHIFT) & L2_PAGETABLE_MASK));
     1.8 +        pde = *(unsigned long *)(pd + 4 * ((virt >> L2_PAGETABLE_SHIFT) & L2_PAGETABLE_MASK));
     1.9  
    1.10      if ((pde & 1) == 0) {
    1.11          DPRINTF("page entry not present in PD\n");
    1.12 @@ -156,9 +156,9 @@ unsigned long xc_translate_foreign_addre
    1.13          if (pt_levels >= 3)
    1.14              pte = *(unsigned long long *)(pt + 8 * ((virt >> L1_PAGETABLE_SHIFT_PAE) & L1_PAGETABLE_MASK_PAE));
    1.15          else
    1.16 -            pte = *(unsigned long long *)(pt + 4 * ((virt >> L1_PAGETABLE_SHIFT) & L1_PAGETABLE_MASK));
    1.17 +            pte = *(unsigned long *)(pt + 4 * ((virt >> L1_PAGETABLE_SHIFT) & L1_PAGETABLE_MASK));
    1.18  
    1.19 -        if ((pte & 0x00000001) == 0) {
    1.20 +        if ((pte & 1) == 0) {
    1.21              DPRINTF("page entry not present in PT\n");
    1.22              goto out_unmap_pt;
    1.23          }