diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-11 08:50:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-11 08:50:05 +0100 |
commit | 73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee (patch) | |
tree | 02cd3308d328bce9cf97bf2c1c9d5e932103ebfe /arch/arm64/kvm/debug.c | |
parent | driver core: Remove redundant license text (diff) | |
parent | Linux 4.15-rc3 (diff) | |
download | linux-73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee.tar.xz linux-73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee.zip |
Merge 4.15-rc3 into driver-core-next
We want the fixes and changes in here for testing.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm64/kvm/debug.c')
-rw-r--r-- | arch/arm64/kvm/debug.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c index dbadfaf850a7..fa63b28c65e0 100644 --- a/arch/arm64/kvm/debug.c +++ b/arch/arm64/kvm/debug.c @@ -221,3 +221,24 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu) } } } + + +/* + * After successfully emulating an instruction, we might want to + * return to user space with a KVM_EXIT_DEBUG. We can only do this + * once the emulation is complete, though, so for userspace emulations + * we have to wait until we have re-entered KVM before calling this + * helper. + * + * Return true (and set exit_reason) to return to userspace or false + * if no further action is required. + */ +bool kvm_arm_handle_step_debug(struct kvm_vcpu *vcpu, struct kvm_run *run) +{ + if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) { + run->exit_reason = KVM_EXIT_DEBUG; + run->debug.arch.hsr = ESR_ELx_EC_SOFTSTP_LOW << ESR_ELx_EC_SHIFT; + return true; + } + return false; +} |