aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/fix-xen-ssp.patch
blob: ebe352ed19d79e21e175cfd79946046b1242acc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index de1c6d4..25cf7f8 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1566,6 +1566,15 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	 */
 	__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
 
+	/* Get mfn list */
+	xen_build_dynamic_phys_to_machine();
+
+	/*
+	 * Set up kernel GDT and segment registers, mainly so that
+	 * -fstack-protector code can be executed.
+	 */
+	xen_setup_gdt(0);
+
 	/* Work out if we support NX */
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
 	if ((cpuid_eax(0x80000000) & 0xffff0000) == 0x80000000 &&
@@ -1579,15 +1588,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	}
 #endif
 
-	/* Get mfn list */
-	xen_build_dynamic_phys_to_machine();
-
-	/*
-	 * Set up kernel GDT and segment registers, mainly so that
-	 * -fstack-protector code can be executed.
-	 */
-	xen_setup_gdt(0);
-
 	xen_init_irq_ops();
 	xen_init_cpuid_mask();