diff mbox series

[kvm-unit-tests,2/2] x86: cstart64: Put APIC into xAPIC after loading TSS

Message ID 20220725201336.2158604-3-seanjc@google.com (mailing list archive)
State New, archived
Headers show
Series x86: Don't assume !x2APIC during boot | expand

Commit Message

Sean Christopherson July 25, 2022, 8:13 p.m. UTC
Now that pre_boot_apic_id() works with either xAPIC or x2APIC, "reset"
the APIC after configuring loading the TSS.  Previously, load_tss() =>
setup_tss() needed to run after forcing the vCPU into xAPIC mode due to
pre_boot_apic_id() assuming xAPIC.

The order doesn't truly matter at this point, but loading the TSS first
will allow sharing code with the EFI boot flow, which "needs" to load the
TSS (more specifically, needs to configure GS.base) prior to forcing the
vCPU into xAPIC (and thus setting the per-vCPU APIC ops).

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 x86/cstart64.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/x86/cstart64.S b/x86/cstart64.S
index 7272452..5269424 100644
--- a/x86/cstart64.S
+++ b/x86/cstart64.S
@@ -188,8 +188,8 @@  save_id:
 	retq
 
 ap_start64:
-	call reset_apic
 	load_tss
+	call reset_apic
 	call enable_apic
 	call save_id
 	call enable_x2apic
@@ -201,8 +201,8 @@  ap_start64:
 	jmp 1b
 
 start64:
-	call reset_apic
 	load_tss
+	call reset_apic
 	call mask_pic_interrupts
 	call enable_apic
 	call save_id