Page MenuHomeFreeBSD

arm64/vmm: Don't set MDSCR_KDE in the guest when single stepping
AcceptedPublic

Authored by markj on Feb 12 2025, 3:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 8, 2:20 PM
Unknown Object (File)
Thu, Mar 6, 11:40 PM
Unknown Object (File)
Tue, Mar 4, 1:07 PM
Unknown Object (File)
Tue, Mar 4, 11:42 AM
Unknown Object (File)
Sat, Mar 1, 7:22 AM
Unknown Object (File)
Sat, Feb 22, 2:08 PM
Unknown Object (File)
Feb 16 2025, 2:40 PM
Unknown Object (File)
Feb 13 2025, 2:39 AM
Subscribers

Details

Reviewers
andrew
manu
Summary

This is unneeded, and causes the host to freeze when VHE is enabled.
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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62396
Build 59280: arc lint + arc unit

Event Timeline

Do we need it for non-VHE? If so we will need to selectively set it based on in_vhe().

Do we need it for non-VHE? If so we will need to selectively set it based on in_vhe().

It's not required - see the updated review description.

This revision is now accepted and ready to land.Wed, Mar 12, 2:28 PM