Re: [PATCH v2 1/2] KVM: selftests: Add a helper to read a vCPU's APIC ID

From: Hemanth Selam

Date: Thu Aug 27 2026 - 00:48:31 EST


Please skip this version, the report is right: the helper applied the xAPIC
shift and mask unconditionally, so it returned 0 for a vCPU in x2APIC mode
on a VM that enabled KVM_X2APIC_API_USE_32BIT_IDS, and truncated IDs above
255.

v3 handles both modes and I checked it against every way KVM reports an ID,
including a vCPU with ID 300 and a guest that renames its own xAPIC ID:

https://lore.kernel.org/all/20260827044534.2900285-1-hemanth.selam@xxxxxxxxx

Hemanth