]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: Move base_disallow_mask into __ro_after_init
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 28 Apr 2022 17:00:41 +0000 (18:00 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 22 Jul 2024 17:18:00 +0000 (18:18 +0100)
base_disallow_mask is calculated once in arch_init_memory() and doesn't change
thereafter.  Write-protect it at runtime.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c

index 0ecea0f707b2a483180061eb2d77217ac4f6e5ac..95795567f2a53497891b02895a350f470bbe3def 100644 (file)
@@ -150,7 +150,8 @@ bool __read_mostly machine_to_phys_mapping_valid;
 
 struct rangeset *__read_mostly mmio_ro_ranges;
 
-static uint32_t base_disallow_mask;
+static uint32_t __ro_after_init base_disallow_mask;
+
 /* Global bit is allowed to be set on L1 PTEs. Intended for user mappings. */
 #define L1_DISALLOW_MASK ((base_disallow_mask | _PAGE_GNTTAB) & ~_PAGE_GLOBAL)