[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/hvm: Add x2APIC topology
- To: Julian Vetter <julian.vetter@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 9 Feb 2026 14:24:38 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BoVbc0gaZd5O2MY9McQsMrm1n6Z6VVG6a57IlbJK9RQ=; b=bWj8AGSiQGw1qp5m4ulbI0dbMDLVtMm2jI4XJrPhhfNm1hyRT+KLpwKKHru5s1ctAlIVo7OhISauWvq70CP/o/jIFdRyMkg1oV3SKs932buMGO0FCKHdBCkOImtjMriBczAz0YDyHFCLFdQjGQxr9rC9W+62iKqHlx92nP4yJUMoQ9/s4NP9MfEmKvktBN3CWtQ/tGdmxPpky89dPFrMRpXS0X55oujL2C7ZbBtD4Hq3LTUu1UEHb4Fy6tHwxHE0mmFbfmmMQpprizVYOgJlFqvi/P6obGBcjylQuCD77uhAHfQQJ5ALz6mJrea4K1D5Je1I5G/Y4L163r3uN+fmHQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rb2nQYB+dKXb6bAPwFonecCVAAnowaYNyi0bLqlBQukdl5DkfTyifTodokbfq7uvliyicZnjMo4w62gZZJo1U4/T0AbwsOjINPBcsamwXf7piUwhxIAoE92wLf2Qq6prShkCnW3QrLSTob7XWKqWvwcQSNOlsHQ6Foj7dlgiH4PVwrm3sw20r9b1z7wlstz71oUCmoOntqW/x3ZR2qYQv8kENPfq+GsaBe+HNakoGMyTQBmAh/V4oXOXq/kOmPjniPQWX5xz8CQmMVDGW8rHHbojg/97EltBX+ubFHSakOS4/L306GXp9IOu2jAYsm+Gj5DPQMBRT9CarHvJHtvKcw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Mon, 09 Feb 2026 13:24:56 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
|