Skip to content

Conversation

@tpressure
Copy link
Member

@tpressure tpressure commented Nov 21, 2025

When booting a Linux guest in SMP configuration, on sapphire rapids and granite rapids the following kernel warning can be observed:

[Firmware Bug]: CPUID leaf 0x1f subleaf 1 APIC ID mismatch 1 != 0
[Firmware Bug]: CPUID leaf 0x1f subleaf 2 APIC ID mismatch 1 != 0

The reason is that we announce the presence of the extended topology leaf, but fail to announce the x2apic ID in EDX for each sub-leaf.

We already fixed this for leaf 0xb, sub-leaf zero in #7087, but forgot to do the same for leaf 0x1f and its sub-leafs.

The documentation for this cpuid leaf states the following for EDX: It is always valid and does not vary with the sub-leaf index in ECX

@tpressure tpressure requested a review from a team as a code owner November 21, 2025 13:49
When booting a Linux guest in SMP configuration, on sapphire rapids
and granite rapids the following kernel warning can be observed:

[Firmware Bug]: CPUID leaf 0x1f subleaf 1 APIC ID mismatch 1 != 0
[Firmware Bug]: CPUID leaf 0x1f subleaf 2 APIC ID mismatch 1 != 0

The reason is that we announce the presence of the extended topology
leaf, but fail to announce the x2apic ID in EDX for each subleaf.

Signed-off-by: Thomas Prescher <[email protected]>
On-behalf-of: SAP [email protected]
@tpressure tpressure changed the title Fix extended topology enumeration APIC ID reporting Fix V2 extended topology enumeration APIC ID reporting Nov 21, 2025
u32::from(cores_per_die * threads_per_core),
);
CpuidPatch::set_cpuid_reg(cpuid, 0x1f, Some(1), CpuidReg::ECX, 2 << 8);
CpuidPatch::set_cpuid_reg(cpuid, 0x1f, Some(1), CpuidReg::EDX, x2apic_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: what's the index here (Some(1)) and why do we need the same code multiple times? What's the bigger picture?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpressure
Copy link
Member Author

I'm not sure where this risc-v pipeline error is coming from, but it is certainly unrelated to these changes.

@likebreath
Copy link
Member

I'm not sure where this risc-v pipeline error is coming from, but it is certainly unrelated to these changes.

Right. The Risc-v support is still experimental and their runners are flaky sometime. That's s why they are optional.

@likebreath likebreath added this pull request to the merge queue Nov 21, 2025
Merged via the queue into cloud-hypervisor:main with commit b6032bc Nov 21, 2025
42 of 43 checks passed
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Dec 11, 2025
@likebreath likebreath added the bug-fix Bug fix to include in release notes label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants