]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Add and use helper to set vCPU's CPUID maxphyaddr
authorSean Christopherson <seanjc@google.com>
Tue, 14 Jun 2022 20:06:49 +0000 (20:06 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:17 +0000 (18:14 -0700)
commit243f08764b97a77ef2b4c46bc50d48a5464c7515
tree1211a08f96cd5575da297add75702b474cd1857b
parentab228e895c3a0765da27245320736d0c7ee8b3bc
KVM: selftests: Add and use helper to set vCPU's CPUID maxphyaddr

Add a helper to set a vCPU's guest.MAXPHYADDR, and use it in the test
that verifies the emulator returns an error on an unknown instruction
when KVM emulates in response to an EPT violation with a GPA that is
legal in hardware but illegal with respect to the guest's MAXPHYADDR.

Add a helper even though there's only a single user at this time.  Before
its removal, mmu_role_test also stuffed guest.MAXPHYADDR, and the helper
provides a small amount of clarity.

More importantly, this eliminates a set_cpuid() user and an instance of
modifying kvm_get_supported_cpuid()'s static "cpuid".

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-25-seanjc@google.com
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/emulator_error_test.c