File tboot-apic.patch of Package tboot.5726
changeset: 496:e1bd4146a911
user: Ning Sun <ning.sun@intel.com>
date: Tue Jun 20 10:03:48 2017 -0700
summary: Using 32-bit local APIC ID to calculate AP stack startng address.
diff -r 8b4485ecb95b -r e1bd4146a911 tboot/common/boot.S
--- a/tboot/common/boot.S Sun Jun 11 09:48:34 2017 -0700
+++ b/tboot/common/boot.S Tue Jun 20 10:03:48 2017 -0700
@@ -240,22 +240,21 @@
or $CR4_MCE,%eax
mov %eax,%cr4
- # get initial APIC ID for this processor
- mov $0x01, %eax
- xor %ebx, %ebx
+ # get initial 32-bit local APIC ID for this processor
+ mov $0x0b, %eax
+ xor %edx, %edx
cpuid
- shr $24, %ebx
# set stack as id-based offset from AP stack base
# spin hlt if we exceed, since C code can't handle shared stack
- cmp $NR_CPUS, %ebx
+ cmp $NR_CPUS, %edx
jl 3f
# TBD: increment global counter so BSP can tell we exceeded NR_CPUS
2: cli
hlt
jmp 2b
3: mov $AP_STACK_SIZE, %eax
- mul %ebx
+ mul %edx
mov $ap_stacks, %ecx
sub %eax, %ecx
mov %ecx, %esp