On 30.10.2024 12:31, Andrew Cooper wrote:
> On 21/10/2024 4:45 pm, Alejandro Vallejo wrote:
>> --- a/tools/firmware/hvmloader/mp_tables.c
>> +++ b/tools/firmware/hvmloader/mp_tables.c
>> @@ -198,8 +198,10 @@ static void fill_mp_config_table(struct mp_config_table
>> *mpct, int length)
>> /* fills in an MP processor entry for VCPU 'vcpu_id' */
>> static void fill_mp_proc_entry(struct mp_proc_entry *mppe, int vcpu_id)
>> {
>> + ASSERT(cpu_to_x2apicid[vcpu_id] < 0xFF );
>
> This is just going to break when we hit 256 vCPUs in a VM.
>
> What do real systems do?
>
> They'll either wrap around 255 like the CPUID xAPIC_ID does, or they'll
> not write out MP tables at all.
"at all" may be going a little far. They may simply not advertise CPUs with
too wide APIC IDs there, while still allowing others to be discovered this
legacy way.
Jan