HomeFreeBSD

arm64/vmm: Don't set MDSCR_EL1.KDE when enabling single-stepping

Description

arm64/vmm: Don't set MDSCR_EL1.KDE when enabling single-stepping

When VHE mode is enabled, this results in a hang on the host. In
particular, when MDSCR_EL2.KDE is set to 1 and the CPU is executing at
EL_D, i.e., EL2, debug exceptions are enabled. In non-VHE mode, we call
into the guest by trapping to EL2, which implicitly masks debug
exceptions by setting PSTATE.D. However, in VHE mode, PSTATE.D remains
clear, so when the guest's MDSCR_EL1 value is loaded, we immediately
begin single-stepping.

In non-VHE mode there is no need to set KDE either, so just stop setting
it.

Reviewed by: andrew
MFC after: 3 days
Sponsored by: CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision: https://reviews.freebsd.org/D48965

(cherry picked from commit ac0032344ca256f758a5eeb0fd6089dd647b0496)

Details

Provenance
markjAuthored on Wed, Nov 5, 8:54 PM
Reviewer
andrew
Differential Revision
D48965: arm64/vmm: Don't set MDSCR_KDE in the guest when single stepping
Parents
rG190e6d67953c: setcred(): Fix 32-bit compatibility copy-in
Branches
Unknown
Tags
Unknown