Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: kvmarm@lists.linux.dev
Cc: Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Oliver Upton <oliver.upton@linux.dev>
Subject: [PATCH 0/2] KVM: arm64: nv: Fixes for handling debug, MDCR_EL2
Date: Wed, 17 Sep 2025 13:31:23 -0700	[thread overview]
Message-ID: <20250917203125.283116-1-oliver.upton@linux.dev> (raw)

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


             reply	other threads:[~2025-09-17 20:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 20:31 Oliver Upton [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250917203125.283116-1-oliver.upton@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox