]> git.dujemihanovic.xyz Git - linux.git/commit
KVM: selftests: Add a testcase to verify x2APIC is fully readonly
authorMichal Luczaj <mhal@rbox.co>
Fri, 2 Aug 2024 20:29:41 +0000 (13:29 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 13 Aug 2024 16:01:46 +0000 (12:01 -0400)
commit238d3d63d1e27c8d9733b48f7b682fc6aba86672
treec55f97dbefa9ad9564d01abe278964ff89de13ea
parent4b7c3f6d04bd53f2e5b228b6821fb8f5d1ba3071
KVM: selftests: Add a testcase to verify x2APIC is fully readonly

Add a test to verify that userspace can't change a vCPU's x2APIC ID by
abusing KVM_SET_LAPIC.  KVM models the x2APIC ID (and x2APIC LDR) as
readonly, and silently ignores userspace attempts to change the x2APIC ID
for backwards compatibility.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
[sean: write changelog, add to existing test]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240802202941.344889-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/xapic_state_test.c