[SeaBIOS] [PATCH 3/3] Take in account hot(un)plugged cpus on reboot

Gleb Natapov gleb at redhat.com
Thu Mar 15 15:13:58 CET 2012


On Thu, Mar 15, 2012 at 10:08:17AM -0400, Igor Mammedov wrote:
> > Good point. You mean we need a list of apic ids of available cpus
> > right?
> > Can SeaBIOS build this list by reading apic id in smp_ap_boot_code?
> 
> I've looked at how tables are build. It seems that it's not hard and sufficient
> to build an equivalent temporary byte array of (un)available apic ids that
> corresponds to 0xaf00 bitmap at boot time, under following restriction:
>   - apic id shall be in range [0..max_cpus)
Why this restriction? ap bootstrap code can grab array entry with atomic
operation and store its apic id there.

>      * this will allow to allocate array where apic id will serve as index,
>      thus making it equvivalent to 0xaf00 bitmap.
>      * and easily fill this array in smp_ap_boot_code without inventing
>      and using mutexes/spinlocks in smp_ap_boot_code.
> 
> 
> This will require cooperation from qemu side. apic id could be checked
> somewhere in device_add command handler call chain or at cpu object creation
> time.
> 
> Jan,
>   What do you think about setting such restriction on apic id of cpus in
>   qemu?
> 
We do have such restriction currently. A couple of years ago I removed
it from the kernel, but qemu and current bios code still has it.

--
			Gleb.



More information about the SeaBIOS mailing list