KVM: selftests: Rework platform_info_test to actually verify #GP
authorSean Christopherson <seanjc@google.com>
Thu, 14 Mar 2024 23:26:25 +0000 (16:26 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 29 Apr 2024 19:55:11 +0000 (12:55 -0700)
commitdec79eab2b48e4ae71a3e688342dce19da4212c2
treeb77e70c92ae288743bc8e2d7ffdb6b5bbe3fdbaf
parent53635ec253c025aeb0e4401e586a8f7827cd7817
KVM: selftests: Rework platform_info_test to actually verify #GP

Rework platform_info_test to actually handle and verify the expected #GP
on RDMSR when the associated KVM capability is disabled.  Currently, the
test _deliberately_ doesn't handle the #GP, and instead lets it escalated
to a triple fault shutdown.

In addition to verifying that KVM generates the correct fault, handling
the #GP will be necessary (without even more shenanigans) when a future
change to the core KVM selftests library configures the IDT and exception
handlers by default (the test subtly relies on the IDT limit being '0').

Link: https://lore.kernel.org/r/20240314232637.2538648-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/platform_info_test.c