summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorReiji Watanabe <reijiw@google.com>2022-09-16 18:05:58 -0700
committerMarc Zyngier <maz@kernel.org>2022-09-19 10:48:53 +0100
commit370531d1e95be57c62fdf065fb04fd8db7ade8f9 (patch)
tree8e8cd69ad11b601d9e1ea52678ff6c523ac3df12 /tools/testing
parent34fbdee086cfcc20fe889d2b83afddfbe2ac3096 (diff)
downloadlinux-stable-370531d1e95be57c62fdf065fb04fd8db7ade8f9.tar.gz
linux-stable-370531d1e95be57c62fdf065fb04fd8db7ade8f9.tar.bz2
linux-stable-370531d1e95be57c62fdf065fb04fd8db7ade8f9.zip
KVM: arm64: Clear PSTATE.SS when the Software Step state was Active-pending
While userspace enables single-step, if the Software Step state at the last guest exit was "Active-pending", clear PSTATE.SS on guest entry to restore the state. Currently, KVM sets PSTATE.SS to 1 on every guest entry while userspace enables single-step for the vCPU (with KVM_GUESTDBG_SINGLESTEP). It means KVM always makes the vCPU's Software Step state "Active-not-pending" on the guest entry, which lets the VCPU perform single-step (then Software Step exception is taken). This could cause extra single-step (without returning to userspace) if the Software Step state at the last guest exit was "Active-pending" (i.e. the last exit was triggered by an asynchronous exception after the single-step is performed, but before the Software Step exception is taken. See "Figure D2-3 Software step state machine" and "D2.12.7 Behavior in the active-pending state" in ARM DDI 0487I.a for more info about this behavior). Fix this by clearing PSTATE.SS on guest entry if the Software Step state at the last exit was "Active-pending" so that KVM restore the state (and the exception is taken before further single-step is performed). Fixes: 337b99bf7edf ("KVM: arm64: guest debug, add support for single-step") Signed-off-by: Reiji Watanabe <reijiw@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220917010600.532642-3-reijiw@google.com
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions