Changelog since: v3: * don't move CPU counting around, leave it as is and consolidate apic_id accounting only * add and use qemu_*_present_cpus_count() helpers to init/get boot cpus count at boot time and only qemu_get_present_cpus_count() at resume time * fix S3 wakeup stuck in resume vector * If cpu were hotplugged during smp_scan, report it to user instead of silently hanging if it came online while smp_scan() waits for APs v2: * rebase on top of current master /smp_scan() changes/ v1: * s/count_cpu/apic_id_init/ * merge handle_x2apic() into apic_id_init() RFC: * move out max-cpus check out of mptable_setup() * factor out CPU counting/apic ID detection in separate function * return back accidentially deleted debug message with APIC ID * drop unused code in smp_setup()
According to SDM, if CPUs have APIC ID more than 254 firmware should pass control to OS in x2APIC mode. This series adds x2APIC bootstrap initialization.
Works fine with not yet rebased on master QEMU side of x2APIC support: https://email@example.com/msg390671.html Rebased variant probably will be sent next week.
Note: S3 wakeup works as expected if linux guest is running with IRQ remapping enabled. However it seems that kernel is buggy with IRQ remapping disabled as kernel disables CPUs with APIC ID > 254 and on resume from S3 hangs somewere after getting control from Seabios.
Igor Mammedov (4): paravirt: disable legacy bios tables in case of more than 255 CPUs error out if present cpus count changed during SMP bringup add helpers to read etc/boot-cpus at resume time support booting with more than 255 CPUs
Kevin O'Connor (1): smp: consolidate CPU APIC ID detection and accounting
src/fw/paravirt.h | 3 +++ src/x86.h | 1 + src/fw/paravirt.c | 44 +++++++++++++++++++++++++++++++++++-- src/fw/smp.c | 65 ++++++++++++++++++++++++++++++++++++++----------------- 4 files changed, 91 insertions(+), 22 deletions(-)