Linux KVM/arm64 development list
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: arm64: nv: Fixes for handling debug, MDCR_EL2
@ 2025-09-17 20:31 Oliver Upton
  2025-09-17 20:31 ` [PATCH 1/2] KVM: arm64: nv: Trap debug registers when in hyp context Oliver Upton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Oliver Upton @ 2025-09-17 20:31 UTC (permalink / raw)
  To: kvmarm; +Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
	Oliver Upton

As I was working on EL2 support for KVM selftests I realized that use of
self-hosted debug inside of the VM is completely broken. Further
inspection reveals yet another case where FEAT_NV2 does something
insane -- MDSCR_EL1 is redirected to the VNCR page in spite of affecting
the EL2 context.

The situation can be remedied with traps. And after implementing that it
became clear we make no effort of honoring the guest's MDCR traps.
Whoops.

Small series to tidy both of these issues up. While FEAT_FGT provides a
precise trap for MDSCR_EL1, I don't have access to such a system and
would rather send something out that works for now. We can worry about
making this fast later.

Applies to 6.17-rc4.

Oliver Upton (2):
  KVM: arm64: nv: Trap debug registers when in hyp context
  KVM: arm64: nv: Apply guest's MDCR traps in nested context

 arch/arm64/include/asm/kvm_nested.h |  2 ++
 arch/arm64/kvm/debug.c              |  3 +++
 arch/arm64/kvm/nested.c             | 30 +++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)


base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
-- 
2.47.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-18 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 20:31 [PATCH 0/2] KVM: arm64: nv: Fixes for handling debug, MDCR_EL2 Oliver Upton
2025-09-17 20:31 ` [PATCH 1/2] KVM: arm64: nv: Trap debug registers when in hyp context Oliver Upton
2025-09-17 20:31 ` [PATCH 2/2] KVM: arm64: nv: Apply guest's MDCR traps in nested context Oliver Upton
2025-09-18 15:49 ` [PATCH 0/2] KVM: arm64: nv: Fixes for handling debug, MDCR_EL2 Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox