From 30e6fb5b90a1bb56c7985b8d1600fb9d8da9d34d Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 6 Jan 2020 13:36:30 +0000 Subject: [PATCH] x86/boot: Map the trampoline as read-only c/s ec92fcd1d08, which caused the trampoline GDT Access bits to be set, removed the final writes which occurred between enabling paging and switching to the high mappings. There don't plausibly need to be any memory writes in few instructions is takes to perform this transition. As a consequence, we can remove the RWX mapping of the trampoline. It is RX via its identity mapping below 1M, and RW via the directmap. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/x86_64/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 8ea09ecc30..b7ce833ffc 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -699,7 +699,7 @@ void __init zap_low_mappings(void) /* Replace with mapping of the boot trampoline only. */ map_pages_to_xen(trampoline_phys, maddr_to_mfn(trampoline_phys), PFN_UP(trampoline_end - trampoline_start), - __PAGE_HYPERVISOR); + __PAGE_HYPERVISOR_RX); } int setup_compat_arg_xlat(struct vcpu *v) -- 2.30.2