[PATCH 0/3] KVM: arm64: Fix a bug of single-step execution enabled by userspace

Reiji Watanabe
2022-09-09T04:47:00Z

Fix a bug that KVM could erroneously perform an extra single step
execution (without returning to userspace) due to setting PSTATE.SS
to 1 on every guest entry, when single-step execution is enabled for
the vCPU by userspace.

Add a test for KVM_GUESTDBG_SINGLESTEP to the debug-exception test
to verify the single-step behavior.

The series is based on 6.0-rc4.

Reiji Watanabe (3):
KVM: arm64: Don't set PSTATE.SS when Software Step state is
Active-pending
KVM: arm64: selftests: Refactor debug-exceptions to make it amenable
to new test cases
KVM: arm64: selftests: Add a test case for KVM_GUESTDBG_SINGLESTEP

arch/arm64/include/asm/kvm_host.h | 3 +
arch/arm64/kvm/debug.c | 19 ++-
arch/arm64/kvm/guest.c | 1 +
arch/arm64/kvm/handle_exit.c | 2 +
.../selftests/kvm/aarch64/debug-exceptions.c | 149 +++++++++++++++++-
5 files changed, 169 insertions(+), 5 deletions(-)

base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
--
2.37.2.789.g6183377224-goog