提交 05345b0f 编写于 作者: J Jeremy Fitzhardinge 提交者: Ingo Molnar

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: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 46539383
...@@ -1228,6 +1228,11 @@ asmlinkage void __init xen_start_kernel(void) ...@@ -1228,6 +1228,11 @@ asmlinkage void __init xen_start_kernel(void)
if (xen_feature(XENFEAT_supervisor_mode_kernel)) if (xen_feature(XENFEAT_supervisor_mode_kernel))
pv_info.kernel_rpl = 0; 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 */ /* set the limit of our address space */
xen_reserve_top(); xen_reserve_top();
......
...@@ -199,10 +199,8 @@ pgdval_t xen_pgd_val(pgd_t pgd) ...@@ -199,10 +199,8 @@ pgdval_t xen_pgd_val(pgd_t pgd)
pte_t xen_make_pte(pteval_t pte) pte_t xen_make_pte(pteval_t pte)
{ {
if (pte & _PAGE_PRESENT) { if (pte & _PAGE_PRESENT)
pte = phys_to_machine(XPADDR(pte)).maddr; pte = phys_to_machine(XPADDR(pte)).maddr;
pte &= ~(_PAGE_PCD | _PAGE_PWT);
}
return (pte_t){ .pte = pte }; return (pte_t){ .pte = pte };
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册