]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Enforce x2APIC's must-be-zero reserved ICR bits
authorSean Christopherson <seanjc@google.com>
Fri, 19 Jul 2024 23:50:58 +0000 (16:50 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 29 Aug 2024 23:21:50 +0000 (16:21 -0700)
commit71bf395a276f0578d19e0ae137a7d1d816d08e0e
tree76b19d9e4dc9199a3f06bee89dea289992b545a5
parent44dd0f5732b466a6e4d2a9b3aad1678f43f061af
KVM: x86: Enforce x2APIC's must-be-zero reserved ICR bits

Inject a #GP on a WRMSR(ICR) that attempts to set any reserved bits that
are must-be-zero on both Intel and AMD, i.e. any reserved bits other than
the BUSY bit, which Intel ignores and basically says is undefined.

KVM's xapic_state_test selftest has been fudging the bug since commit
4b88b1a518b3 ("KVM: selftests: Enhance handling WRMSR ICR register in
x2APIC mode"), which essentially removed the testcase instead of fixing
the bug.

WARN if the nodecode path triggers a #GP, as the CPU is supposed to check
reserved bits for ICR when it's partially virtualized.

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240719235107.3023592-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/lapic.c