]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: test behavior of unmapped L2 APIC-access address
authorJim Mattson <jmattson@google.com>
Mon, 26 Oct 2020 18:09:22 +0000 (11:09 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 31 Oct 2020 14:04:38 +0000 (10:04 -0400)
commit2ba3962871abc686d17759391bbe10500efd703d
treee0457dba18b679dfb5fa2c5fee815104cfc46495
parent0f0f4da8a0d8f14eafe9e326ec6e59def439ba17
KVM: selftests: test behavior of unmapped L2 APIC-access address

Add a regression test for commit 3b264144fb37 ("KVM: nVMX: Don't leak
L1 MMIO regions to L2").

First, check to see that an L2 guest can be launched with a valid
APIC-access address that is backed by a page of L1 physical memory.

Next, set the APIC-access address to a (valid) L1 physical address
that is not backed by memory. KVM can't handle this situation, so
resuming L2 should result in a KVM exit for internal error
(emulation).

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Message-Id: <20201026180922.3120555-1-jmattson@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/vmx.h
tools/testing/selftests/kvm/lib/x86_64/vmx.c
tools/testing/selftests/kvm/x86_64/vmx_apic_access_test.c [new file with mode: 0644]