[PATCH v2] KVM: arm64: Initialize VCPU mdcr_el2 before loading it
Marc Zyngier
maz at kernel.org
Thu Apr 1 16:22:40 BST 2021
On Thu, 01 Apr 2021 14:55:54 +0100,
Alexandru Elisei <alexandru.elisei at arm.com> wrote:
[...]
> Had another go at this, and as I was looking at the code, I realized that
> conceptually, trapping debug registers access (MDCR_EL2.TDA) is tied to:
>
> - KVM_ARM64_DEBUG_DIRTY *not* being set (guest is debugging itself and KVM will
> world-switch the debug registers).
>
> - KVM_GUESTDBG_USE_HW being set, which also *sets* KVM_ARM64_DEBUG_DIRTY (host is
> debugging the guest using hardware breakpoints).
>
> So I cannot set the MDCR_EL2.TDA bit based on KVM_ARM64_DEBUG_DIRTY,
> because I would lose one of the two cases. It looks to me that
> keeping kvm_arm_setup_mdcr_el2() unchanged and calling it at the
> start of kvm_arm_setup_debug() is the way to go here.
Just post the revised patch, and we'll take it from there.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list