All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: arm64: Fix bugs of single-step execution enabled by userspace
@ 2022-09-17  1:05 ` Reiji Watanabe
  0 siblings, 0 replies; 24+ messages in thread
From: Reiji Watanabe @ 2022-09-17  1:05 UTC (permalink / raw)
  To: Marc Zyngier, kvmarm
  Cc: kvm, linux-arm-kernel, James Morse, Alexandru Elisei,
	Suzuki K Poulose, Paolo Bonzini, Ricardo Koller, Oliver Upton,
	Jing Zhang, Raghavendra Rao Anata, Reiji Watanabe

This series fixes two bugs of single-step execution enabled by
userspace, and add a test case for KVM_GUESTDBG_SINGLESTEP to
the debug-exception test to verify the single-step behavior.

Patch 1 fixes a bug that KVM might unintentionally change PSTATE.SS
for the guest when single-step execution is enabled for the vCPU by
userspace.

Patch 2 fixes a bug that KVM could erroneously perform an extra
single step (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.

Patch 3-4 adds a test for KVM_GUESTDBG_SINGLESTEP to the
debug-exception test to verify the single-step behavior.

The series is based on 6.0-rc5.

v2:
 - Change kvm_handle_guest_debug() to use switch/case statement [Marc]
 - Clear PSTATE.SS on guest entry if the Software step state at the
   last guest exit was "Active-pending" to make DBG_SS_ACTIVE_PENDING
   and PSTATE.SS consistent [Marc]
 - Add a fix to preserve PSTATE.SS for the guest.

v1: https://lore.kernel.org/all/20220909044636.1997755-1-reijiw@google.com/

Reiji Watanabe (4):
  KVM: arm64: Preserve PSTATE.SS for the guest while single-step is
    enabled
  KVM: arm64: Clear PSTATE.SS when the Software Step state was
    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             |   4 +
 arch/arm64/kvm/debug.c                        |  34 +++-
 arch/arm64/kvm/guest.c                        |   1 +
 arch/arm64/kvm/handle_exit.c                  |   8 +-
 .../selftests/kvm/aarch64/debug-exceptions.c  | 149 +++++++++++++++++-
 5 files changed, 190 insertions(+), 6 deletions(-)


base-commit: 80e78fcce86de0288793a0ef0f6acf37656ee4cf
-- 
2.37.3.968.ga6b4b080e4-goog


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-09-20  2:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  1:05 [PATCH v2 0/4] KVM: arm64: Fix bugs of single-step execution enabled by userspace Reiji Watanabe
2022-09-17  1:05 ` Reiji Watanabe
2022-09-17  1:05 ` Reiji Watanabe
2022-09-17  1:05 ` [PATCH v2 1/4] KVM: arm64: Preserve PSTATE.SS for the guest while single-step is enabled Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:05 ` [PATCH v2 2/4] KVM: arm64: Clear PSTATE.SS when the Software Step state was Active-pending Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:05 ` [PATCH v2 3/4] KVM: arm64: selftests: Refactor debug-exceptions to make it amenable to new test cases Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:05   ` Reiji Watanabe
2022-09-17  1:06 ` [PATCH v2 4/4] KVM: arm64: selftests: Add a test case for KVM_GUESTDBG_SINGLESTEP Reiji Watanabe
2022-09-17  1:06   ` Reiji Watanabe
2022-09-17  1:06   ` Reiji Watanabe
2022-09-19  9:36   ` Marc Zyngier
2022-09-19  9:36     ` Marc Zyngier
2022-09-19  9:36     ` Marc Zyngier
2022-09-20  2:13     ` Reiji Watanabe
2022-09-20  2:13       ` Reiji Watanabe
2022-09-20  2:13       ` Reiji Watanabe
2022-09-19 10:04 ` [PATCH v2 0/4] KVM: arm64: Fix bugs of single-step execution enabled by userspace Marc Zyngier
2022-09-19 10:04   ` Marc Zyngier
2022-09-19 10:04   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.