diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-16 18:01:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-20 08:55:11 -0400 |
commit | eb179e443deb0a5c81a62b4c157124a4b7ff1813 (patch) | |
tree | 352f02e0c9802b1025a7bf165e97aee88979387d /arch | |
parent | 6673cf63e5d973db5145d1f48b354efcb9fe2a13 (diff) |
xen: mask unwanted pte bits in __supported_pte_mask
[ 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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/enlighten.c | 5 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 8e6152e6ed88..73fb0c4c150a 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1280,6 +1280,11 @@ asmlinkage void __init xen_start_kernel(void) | |||
1280 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) | 1280 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) |
1281 | pv_info.kernel_rpl = 0; | 1281 | pv_info.kernel_rpl = 0; |
1282 | 1282 | ||
1283 | /* Prevent unwanted bits from being set in PTEs. */ | ||
1284 | __supported_pte_mask &= ~_PAGE_GLOBAL; | ||
1285 | if (!is_initial_xendomain()) | ||
1286 | __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); | ||
1287 | |||
1283 | /* set the limit of our address space */ | 1288 | /* set the limit of our address space */ |
1284 | xen_reserve_top(); | 1289 | xen_reserve_top(); |
1285 | 1290 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 7c9935858f92..f0078d9a5b78 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -343,10 +343,8 @@ pgdval_t xen_pgd_val(pgd_t pgd) | |||
343 | 343 | ||
344 | pte_t xen_make_pte(pteval_t pte) | 344 | pte_t xen_make_pte(pteval_t pte) |
345 | { | 345 | { |
346 | if (pte & _PAGE_PRESENT) { | 346 | if (pte & _PAGE_PRESENT) |
347 | pte = phys_to_machine(XPADDR(pte)).maddr; | 347 | pte = phys_to_machine(XPADDR(pte)).maddr; |
348 | pte &= ~(_PAGE_PCD | _PAGE_PWT); | ||
349 | } | ||
350 | 348 | ||
351 | return (pte_t){ .pte = pte }; | 349 | return (pte_t){ .pte = pte }; |
352 | } | 350 | } |