]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
xen: mask unwanted pte bits in __supported_pte_mask
authorJeremy Fitzhardinge <jeremy@goop.org>
Mon, 16 Jun 2008 22:01:53 +0000 (15:01 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 20 Jun 2008 12:55:11 +0000 (14:55 +0200)
[ Stable: this isn't a bugfix in itself, but it's a pre-requiste
  for "xen: don't drop NX bit" ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c

index 8e6152e6ed884cdf7bd6d90a326aaeb43940fd5c..73fb0c4c150aad00b25886a13bd8b6ed0ca79d8b 100644 (file)
@@ -1280,6 +1280,11 @@ asmlinkage void __init xen_start_kernel(void)
        if (xen_feature(XENFEAT_supervisor_mode_kernel))
                pv_info.kernel_rpl = 0;
 
+       /* Prevent unwanted bits from being set in PTEs. */
+       __supported_pte_mask &= ~_PAGE_GLOBAL;
+       if (!is_initial_xendomain())
+               __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
+
        /* set the limit of our address space */
        xen_reserve_top();
 
index 7c9935858f9277fb97e1623d0b6380fbb9e9f072..f0078d9a5b78615e0d51f19ca7cbd54041c23c22 100644 (file)
@@ -343,10 +343,8 @@ pgdval_t xen_pgd_val(pgd_t pgd)
 
 pte_t xen_make_pte(pteval_t pte)
 {
-       if (pte & _PAGE_PRESENT) {
+       if (pte & _PAGE_PRESENT)
                pte = phys_to_machine(XPADDR(pte)).maddr;
-               pte &= ~(_PAGE_PCD | _PAGE_PWT);
-       }
 
        return (pte_t){ .pte = pte };
 }