]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Add test to verify KVM handling of ICR
authorSean Christopherson <seanjc@google.com>
Fri, 4 Feb 2022 21:42:05 +0000 (21:42 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Mar 2022 13:50:48 +0000 (08:50 -0500)
commit27e1ba0e7df26e756dd04fba8f958ee52be7c3f4
tree14d433bdf00bec55edde4681724d89d8163a2fd4
parenta65a3f6f892e3542de0d708ce63024dc8741b04e
KVM: selftests: Add test to verify KVM handling of ICR

The main thing that the selftest verifies is that KVM copies x2APIC's
ICR[63:32] to/from ICR2 when userspace accesses the vAPIC page via
KVM_{G,S}ET_LAPIC.  KVM previously split x2APIC ICR to ICR+ICR2 at the
time of write (from the guest), and so KVM must preserve that behavior
for backwards compatibility between different versions of KVM.

It will also test other invariants, e.g. that KVM clears the BUSY
flag on ICR writes, that the reserved bits in ICR2 are dropped on writes
from the guest, etc...

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220204214205.3306634-12-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/x86_64/apic.h
tools/testing/selftests/kvm/x86_64/xapic_state_test.c [new file with mode: 0644]