]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:27 +0000 (16:33 +0200)
commit5b0421ae5185132b437714936afb8acfe3a121ee
tree61b9d5984b51723334efe107468c572316bd9ea3
parent46a40b3639c4e42bc65596a53087a05a027ddc0e
KVM: x86: Enforce x2APIC's must-be-zero reserved ICR bits

commit 71bf395a276f0578d19e0ae137a7d1d816d08e0e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/lapic.c