Skip to content

Commit

Permalink
x86/boot: read APIC base from register
Browse files Browse the repository at this point in the history
Some CPUs don't use default APIC base. Address in MSR is always valid,
and it is already read to test for x2APIC.

Signed-off-by: Krystian Hebel <[email protected]>
  • Loading branch information
krystian-hebel committed Apr 4, 2024
1 parent 0186fd8 commit 06f5d0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xen/arch/x86/boot/trampoline.S
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ trampoline_protmode_entry:
*/
mov $MSR_APIC_BASE, %ecx
rdmsr
and $APIC_BASE_EXTD, %eax
test $APIC_BASE_EXTD, %eax
jnz .Lx2apic

/* Not x2APIC, read from MMIO */
mov $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %esp
and $APIC_BASE_ADDR_MASK, %eax
mov APIC_ID(%eax), %esp
shr $24, %esp
jmp 1f

Expand Down

0 comments on commit 06f5d0c

Please sign in to comment.