Skip to content

Commit e2c26dd

Browse files
jbeulichgregkh
authored andcommitted
x86/Xen: swap NX determination and GDT setup on BSP
commit ae897fd upstream. xen_setup_gdt(), via xen_load_gdt_boot(), wants to adjust page tables. For this to work when NX is not available, x86_configure_nx() needs to be called first. [jgross] Note that this is a revert of 36104cb ("x86/xen: Delay get_cpu_cap until stack canary is established"), which is possible now that we no longer support running as PV guest in 32-bit mode. Cc: <stable.vger.kernel.org> # 5.9 Fixes: 36104cb ("x86/xen: Delay get_cpu_cap until stack canary is established") Reported-by: Olaf Hering <[email protected]> Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent d5c4605 commit e2c26dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/xen/enlighten_pv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,16 +1262,16 @@ asmlinkage __visible void __init xen_start_kernel(void)
12621262
/* Get mfn list */
12631263
xen_build_dynamic_phys_to_machine();
12641264

1265+
/* Work out if we support NX */
1266+
get_cpu_cap(&boot_cpu_data);
1267+
x86_configure_nx();
1268+
12651269
/*
12661270
* Set up kernel GDT and segment registers, mainly so that
12671271
* -fstack-protector code can be executed.
12681272
*/
12691273
xen_setup_gdt(0);
12701274

1271-
/* Work out if we support NX */
1272-
get_cpu_cap(&boot_cpu_data);
1273-
x86_configure_nx();
1274-
12751275
/* Determine virtual and physical address sizes */
12761276
get_cpu_address_sizes(&boot_cpu_data);
12771277

0 commit comments

Comments
 (0)