diff options
author | Sean Christopherson <seanjc@google.com> | 2025-02-01 04:55:18 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2025-02-24 20:01:07 +0300 |
commit | 2428865bf0af18f7a0349aee804c21d9bac69bd1 (patch) | |
tree | 994d4f44b9c3d38f252105c6ee0272ba17aea122 /tools/perf/scripts/python/task-analyzer.py | |
parent | 79a14afc60904cdb2b4288fd00c65b8159e0049a (diff) | |
download | linux-2428865bf0af18f7a0349aee804c21d9bac69bd1.tar.xz |
KVM: selftests: Add a nested (forced) emulation intercept test for x86
Add a rudimentary test for validating KVM's handling of L1 hypervisor
intercepts during instruction emulation on behalf of L2. To minimize
complexity and avoid overlap with other tests, only validate KVM's
handling of instructions that L1 wants to intercept, i.e. that generate a
nested VM-Exit. Full testing of emulation on behalf of L2 is better
achieved by running existing (forced) emulation tests in a VM, (although
on VMX, getting L0 to emulate on #UD requires modifying either L1 KVM to
not intercept #UD, or modifying L0 KVM to prioritize L0's exception
intercepts over L1's intercepts, as is done by KVM for SVM).
Since emulation should never be successful, i.e. L2 always exits to L1,
dynamically generate the L2 code stream instead of adding a helper for
each instruction. Doing so requires hand coding instruction opcodes, but
makes it significantly easier for the test to compute the expected "next
RIP" and instruction length.
Link: https://lore.kernel.org/r/20250201015518.689704-12-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions