Skip to content

Commit ae897fd

Browse files
jbeulichjgross1
authored andcommitted
x86/Xen: swap NX determination and GDT setup on BSP
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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent 97729b6 commit ae897fd

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
@@ -1273,16 +1273,16 @@ asmlinkage __visible void __init xen_start_kernel(void)
12731273
/* Get mfn list */
12741274
xen_build_dynamic_phys_to_machine();
12751275

1276+
/* Work out if we support NX */
1277+
get_cpu_cap(&boot_cpu_data);
1278+
x86_configure_nx();
1279+
12761280
/*
12771281
* Set up kernel GDT and segment registers, mainly so that
12781282
* -fstack-protector code can be executed.
12791283
*/
12801284
xen_setup_gdt(0);
12811285

1282-
/* Work out if we support NX */
1283-
get_cpu_cap(&boot_cpu_data);
1284-
x86_configure_nx();
1285-
12861286
/* Determine virtual and physical address sizes */
12871287
get_cpu_address_sizes(&boot_cpu_data);
12881288

0 commit comments

Comments
 (0)