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>

authored by Jeremy Fitzhardinge and committed by Ingo Molnar 05345b0f 46539383

+6 -3
+5
arch/x86/xen/enlighten.c
··· 1228 1228 if (xen_feature(XENFEAT_supervisor_mode_kernel)) 1229 1229 pv_info.kernel_rpl = 0; 1230 1230 1231 + /* Prevent unwanted bits from being set in PTEs. */ 1232 + __supported_pte_mask &= ~_PAGE_GLOBAL; 1233 + if (!is_initial_xendomain()) 1234 + __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 1235 + 1231 1236 /* set the limit of our address space */ 1232 1237 xen_reserve_top(); 1233 1238
+1 -3
arch/x86/xen/mmu.c
··· 199 199 200 200 pte_t xen_make_pte(pteval_t pte) 201 201 { 202 - if (pte & _PAGE_PRESENT) { 202 + if (pte & _PAGE_PRESENT) 203 203 pte = phys_to_machine(XPADDR(pte)).maddr; 204 - pte &= ~(_PAGE_PCD | _PAGE_PWT); 205 - } 206 204 207 205 return (pte_t){ .pte = pte }; 208 206 }