diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2024-12-19 14:41:07 -0800 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2024-12-20 09:01:25 +0000 |
| commit | 803602b0d94168bd25f5ff6eafdfd9388a6dd2ec (patch) | |
| tree | f6887e9bc483975d6e2b44a946d51ab168e08bdf /arch/arm64/kvm/debug.c | |
| parent | 3b7780945cc8494793040ab0a9805b77b7826abb (diff) | |
KVM: arm64: Remove vestiges of debug_ptr
Delete the remnants of debug_ptr now that debug registers are selected
based on the debug owner instead.
Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241219224116.3941496-11-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/debug.c')
| -rw-r--r-- | arch/arm64/kvm/debug.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c index 9979fc1a20bd..f39004c52d33 100644 --- a/arch/arm64/kvm/debug.c +++ b/arch/arm64/kvm/debug.c @@ -119,16 +119,6 @@ void kvm_arm_vcpu_init_debug(struct kvm_vcpu *vcpu) } /** - * kvm_arm_reset_debug_ptr - reset the debug ptr to point to the vcpu state - * @vcpu: the vcpu pointer - */ - -void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) -{ - vcpu->arch.debug_ptr = &vcpu->arch.vcpu_debug_state; -} - -/** * kvm_arm_setup_debug - set up debug related stuff * * @vcpu: the vcpu pointer @@ -198,20 +188,13 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) } /* - * HW Breakpoints and watchpoints - * - * We simply switch the debug_ptr to point to our new - * external_debug_state which has been populated by the - * debug ioctl. The existing DEBUG_DIRTY mechanism ensures - * the registers are updated on the world switch. + * Enable breakpoints and watchpoints if userspace wants them. */ if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW) { - /* Enable breakpoints/watchpoints */ mdscr = vcpu_read_sys_reg(vcpu, MDSCR_EL1); mdscr |= DBG_MDSCR_MDE; vcpu_write_sys_reg(vcpu, mdscr, MDSCR_EL1); - vcpu->arch.debug_ptr = &vcpu->arch.external_debug_state; vcpu_set_flag(vcpu, DEBUG_DIRTY); /* @@ -229,9 +212,6 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) } } - BUG_ON(!vcpu->guest_debug && - vcpu->arch.debug_ptr != &vcpu->arch.vcpu_debug_state); - /* If KDE or MDE are set, perform a full save/restore cycle. */ if (vcpu_read_sys_reg(vcpu, MDSCR_EL1) & (DBG_MDSCR_KDE | DBG_MDSCR_MDE)) vcpu_set_flag(vcpu, DEBUG_DIRTY); @@ -253,14 +233,6 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu) } restore_guest_debug_regs(vcpu); - - /* - * If we were using HW debug we need to restore the - * debug_ptr to the guest debug state. - */ - if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW) { - kvm_arm_reset_debug_ptr(vcpu); - } } } |
