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: FGT traps of MDSCR_EL1
Date: Wed, 24 Sep 2025 16:51:48 -0700 [thread overview]
Message-ID: <20250924235150.617451-1-oliver.upton@linux.dev> (raw)
KVM now traps MDSCR_EL1 (and a hell of a lot of other things) because of
bad architecture redirecting the register to the VNCR. Marc reports that
this hurts (surprised?) meaning it is probably time to send in the FGTs.
As part of this the FGT configuration becomes contextual to the vCPU. FGT
computation is now hoisted up into vcpu_load() which avoids doing a
bunch of bit twiddling on every entry into the guest.
The last thing we can do to speed this up is add an early exit handleer,
but it's EOD for me over here and would rather push out what appears to
work right now.
Based directly on kvmarm/next given the fact that the dependency is
there also.
Oliver Upton (2):
KVM: arm64: Compute per-vCPU FGTs at vcpu_load()
KVM: arm64: nv: Use FGT write trap of MDSCR_EL1 when available
arch/arm64/include/asm/kvm_host.h | 50 ++++++++
arch/arm64/kvm/arm.c | 1 +
arch/arm64/kvm/config.c | 90 ++++++++++++++
arch/arm64/kvm/hyp/include/hyp/switch.h | 148 +++---------------------
arch/arm64/kvm/hyp/nvhe/pkvm.c | 1 +
arch/arm64/kvm/nested.c | 9 +-
6 files changed, 165 insertions(+), 134 deletions(-)
base-commit: 181ce6b01ad52aeb791545edbae0b92648c6428d
--
2.47.3
next reply other threads:[~2025-09-24 23:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 23:51 Oliver Upton [this message]
2025-09-24 23:51 ` [PATCH 1/2] KVM: arm64: Compute per-vCPU FGTs at vcpu_load() Oliver Upton
2025-09-25 11:09 ` Joey Gouly
2025-09-24 23:51 ` [PATCH 2/2] KVM: arm64: nv: Use FGT write trap of MDSCR_EL1 when available Oliver Upton
2025-09-25 11:12 ` Joey Gouly
2025-10-13 16:56 ` [PATCH 0/2] KVM: arm64: nv: FGT traps of MDSCR_EL1 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=20250924235150.617451-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