ia64/xen-unstable

changeset 14091:8bcaedc68f5a

[XEN] [TOOLS] 32on64 compat save/restore: unadjust L3E flags at save time
Get rid of USER|RW|ACCESSED L3 PTE flags which may be present
in a PAE guest when running on a 64bit hypervisor at save time.
This prevents the restore operation from getting confused by
these flags.
Reset disallowed L3E flags to match PAE case.

Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
author Emmanuel Ackaouy <ack@xensource.com>
date Fri Feb 23 12:58:20 2007 +0000 (2007-02-23)
parents cdc765772f69
children eb3ebf11abfe
files tools/libxc/xc_linux_save.c xen/include/asm-x86/x86_64/page.h
line diff
     1.1 --- a/tools/libxc/xc_linux_save.c	Fri Feb 23 11:32:25 2007 +0000
     1.2 +++ b/tools/libxc/xc_linux_save.c	Fri Feb 23 12:58:20 2007 +0000
     1.3 @@ -543,6 +543,18 @@ static int canonicalize_pagetable(unsign
     1.4  
     1.5              pte &= ~MADDR_MASK_X86;
     1.6              pte |= (uint64_t)pfn << PAGE_SHIFT;
     1.7 +
     1.8 +            /*
     1.9 +             * PAE guest L3Es can contain these flags when running on
    1.10 +             * a 64bit hypervisor. We zap these here to avoid any
    1.11 +             * surprise at restore time...
    1.12 +             */
    1.13 +            if ( pt_levels == 3 &&
    1.14 +                 type == XEN_DOMCTL_PFINFO_L3TAB &&
    1.15 +                 pte & (_PAGE_USER|_PAGE_RW|_PAGE_ACCESSED) )
    1.16 +            {
    1.17 +                pte &= ~(_PAGE_USER|_PAGE_RW|_PAGE_ACCESSED);
    1.18 +            }
    1.19          }
    1.20  
    1.21          if (pt_levels == 2)
     2.1 --- a/xen/include/asm-x86/x86_64/page.h	Fri Feb 23 11:32:25 2007 +0000
     2.2 +++ b/xen/include/asm-x86/x86_64/page.h	Fri Feb 23 12:58:20 2007 +0000
     2.3 @@ -98,7 +98,7 @@ typedef l4_pgentry_t root_pgentry_t;
     2.4  #define L3_DISALLOW_MASK (BASE_DISALLOW_MASK)
     2.5  #define L4_DISALLOW_MASK (BASE_DISALLOW_MASK)
     2.6  
     2.7 -#define COMPAT_L3_DISALLOW_MASK L3_DISALLOW_MASK
     2.8 +#define COMPAT_L3_DISALLOW_MASK 0xFFFFF1E6U
     2.9  
    2.10  #define PAGE_HYPERVISOR         (__PAGE_HYPERVISOR         | _PAGE_GLOBAL)
    2.11  #define PAGE_HYPERVISOR_NOCACHE (__PAGE_HYPERVISOR_NOCACHE | _PAGE_GLOBAL)