From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.linux.dev, kvm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Steffen Eiden <seiden@linux.ibm.com>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oupton@kernel.org>,
Zenghui Yu <yuzenghui@huawei.com>,
Hyunwoo Kim <imv4bel@gmail.com>
Subject: [PATCH 0/6] KVM: arm64: VNCR TLB invalidation fixes
Date: Sat, 1 Aug 2026 13:48:12 +0100 [thread overview]
Message-ID: <20260801124818.366274-1-maz@kernel.org> (raw)
Prompted by a patch [0] from Hyunwoo Kim which was addressing a pretty
annoying corner case, I spent some time looking at what was wrong in
our VNCR TLBI code. And there was a few things to say about it...
- The TLB tracking to get into the slow path is wrong. It tracks what
is mapped, but not the established TLBs. Kind of annoying.
- Handling IPA invalidation when the TLB was established with the S1
MMU disabled is failing for a number of reasons. This is the bug
that Hyunwoo Kim found, but I decided to address it at its root
rather than just fixing the symptoms.
- Deciding to run with a VNCR TLB doesn't take the state of
SCTLR_EL2.M into account. Yes, this is a special sort of sport to
run a hypervisor with its MMU disabled...
- TLB invalidation by VA targeting the last page/block of TTBR1_EL2 is
dropped on the floor, because I cannot count. This was amusing. Not.
I have fixes for each of these issues, all stable candidates. On top
of that, I have a couple of patches reintroducing the tracking that
the first patch removes, this time in a way that is actually
functional. Or at least I think it is...
I'd like to thank Hyunwoo Kim for their initial patch and for
providing a reproducer that helped me finding these issues by running
it at multiple levels of nesting. It is most probably too late for
7.2, so let's try to make this 7.3 material.
[0] https://lore.kernel.org/r/ameGoxbn2wzBq2kL@v4bel
Marc Zyngier (6):
KVM: arm64: Remove VM-wide VNCR mapping counter
KVM: arm64: Handle negative S1 walk levels in VNCR TLB size evaluation
KVM: arm64: Consider SCTLR_EL2.M when mapping the L1 VNCR page
KVM: arm64: Correctly handle end of VA space TLBI invalidation
KVM: arm64: Couple VNCR fixmap clearing and CPU number invalidation
KVM: arm64: Add VNCR TLB tracking again
arch/arm64/include/asm/kvm_host.h | 4 +-
arch/arm64/include/asm/kvm_nested.h | 7 ++
arch/arm64/kvm/at.c | 2 -
arch/arm64/kvm/hyp/vhe/switch.c | 4 +-
arch/arm64/kvm/nested.c | 109 +++++++++++++++++-----------
5 files changed, 78 insertions(+), 48 deletions(-)
--
2.47.3
next reply other threads:[~2026-08-01 12:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 12:48 Marc Zyngier [this message]
2026-08-01 12:48 ` [PATCH 1/6] KVM: arm64: Remove VM-wide VNCR mapping counter Marc Zyngier
2026-08-01 13:08 ` sashiko-bot
2026-08-01 13:19 ` Marc Zyngier
2026-08-01 12:48 ` [PATCH 2/6] KVM: arm64: Handle negative S1 walk levels in VNCR TLB size evaluation Marc Zyngier
2026-08-01 13:02 ` sashiko-bot
2026-08-01 13:20 ` Marc Zyngier
2026-08-01 12:48 ` [PATCH 3/6] KVM: arm64: Consider SCTLR_EL2.M when mapping the L1 VNCR page Marc Zyngier
2026-08-01 13:10 ` sashiko-bot
2026-08-01 12:48 ` [PATCH 4/6] KVM: arm64: Correctly handle end of VA space TLBI invalidation Marc Zyngier
2026-08-01 13:03 ` sashiko-bot
2026-08-01 13:40 ` Marc Zyngier
2026-08-01 12:48 ` [PATCH 5/6] KVM: arm64: Couple VNCR fixmap clearing and CPU number invalidation Marc Zyngier
2026-08-01 13:02 ` sashiko-bot
2026-08-01 14:51 ` Marc Zyngier
2026-08-01 12:48 ` [PATCH 6/6] KVM: arm64: Add VNCR TLB tracking again Marc Zyngier
2026-08-01 13:04 ` sashiko-bot
2026-08-01 17:01 ` 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=20260801124818.366274-1-maz@kernel.org \
--to=maz@kernel.org \
--cc=imv4bel@gmail.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.