On Mon, Feb 09, 2026 at 11:37:27AM +0000, Julian Vetter wrote:
> HVM guests with more than 128 vCPUs require APIC IDs above 255 (since
> APIC ID = vcpu_id * 2), which exceeds the 8-bit xAPIC limit. Currently,
> CPUID leaf 0xB returns EBX=0, making firmware (OVMF/EDK2) fall back to
> CPUID leaf 1 for APIC ID discovery, which is limited to 8 bits and
> cannot distinguish vCPUs with APIC IDs greater than 256.
> To address this, implement proper CPUID leaf 0xB x2APIC topology
> enumeration. Present all vCPUs as cores in a single package with correct
> shift values based on the maximum APIC ID, and non-zero EBX so that
> firmware uses the 32-bit x2APIC ID from EDX. Moreover, set CPUID leaf 1
> EBX[23:16] (max addressable logical processor IDs) to the appropriate
> power-of-2 value, but capped at 255.

Additionally to what Andrew has mentioned, you also need to report any
vCPU with ACPI ID >= 255 to use the x2APIC MADT ACPI structure, as the
local APIC MADT structure can only hold 8bit ACPI IDs.

Thanks, Roger.

Reply via email to