Re: [PATCH v8 6/9] KVM: x86: lapic: don't allow to change APIC ID unconditionally

From: Sean Christopherson
Date: Fri Apr 15 2022 - 10:40:38 EST


On Mon, Apr 11, 2022, Zeng Guang wrote:
> From: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
>
> No normal guest has any reason to change physical APIC IDs, and
> allowing this introduces bugs into APIC acceleration code.
>
> And Intel recent hardware just ignores writes to APIC_ID in
> xAPIC mode. More background can be found at:
> https://lore.kernel.org/lkml/Yfw5ddGNOnDqxMLs@xxxxxxxxxx/
>
> Looks there is no much value to support writable xAPIC ID in
> guest except supporting some old and crazy use cases which
> probably would fail on real hardware. So, make xAPIC ID
> read-only for KVM guests.

AFAIK, the plan is to add a capability to let userspace opt-in to a fully read-only
APIC ID[*], but I haven't seen patches...

Maxim?

[*] https://lore.kernel.org/all/c903e82ed2a1e98f66910c35b5aabdcf56e08e72.camel@xxxxxxxxxx