KVM: VMX: Intercept reads to invalid and write-only x2APIC registers
authorSean Christopherson <seanjc@google.com>
Sat, 7 Jan 2023 01:10:25 +0000 (01:10 +0000)
committerSean Christopherson <seanjc@google.com>
Tue, 24 Jan 2023 18:04:36 +0000 (10:04 -0800)
commit02efd818a6c095bcbf422f47fccc4ef27d53f344
tree880c190678ec55fb5aaaeaf590798b4d7b5e71d1
parentc39857ce8daaaa429ccae2a393301ffeed67e235
KVM: VMX: Intercept reads to invalid and write-only x2APIC registers

Intercept reads to invalid (non-existent) and write-only x2APIC registers
when configuring VMX's MSR bitmaps for x2APIC+APICv.  When APICv is fully
enabled, Intel hardware doesn't validate the registers on RDMSR and
instead blindly retrieves data from the vAPIC page, i.e. it's software's
responsibility to intercept reads to non-existent and write-only MSRs.

Fixes: 8d14695f9542 ("x86, apicv: add virtual x2apic support")
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20230107011025.565472-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c