Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Colton Lewis <coltonlewis@google.com>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	 Zenghui Yu <yuzenghui@huawei.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	 Steffen Eiden <seiden@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	 Wei-Lin Chang <weilin.chang@arm.com>,
	Dan Carpenter <dan@pereq.eu>,
	kvmarm@lists.linux.dev,  linux-arm-kernel@lists.infradead.org,
	kvm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] KVM: arm64: nv: Fix stale and duplicate guest S2 tracking entries
Date: Mon, 23 Nov 2026 23:26:45 +0000	[thread overview]
Message-ID: <20261123232647.3733149-1-coltonlewis@google.com> (raw)

When an L1 guest issues TLBI IPAS2E1 with a TTL hint smaller than the
actual mapping, KVM clears the entire block from the shadow stage-2
page table while leaving the stale tracking entry in guest_s2_mappings.
Patch 1 drops undersized TTL hints in compute_tlb_inval_range() and
falls through to the unhinted path so the unmap and tracking removal
cover the same range. This follows Marc's suggestion [2] on Dan
Carpenter's sub-page TTL patch [1] (which Patch 1 overlaps with and
subsumes), fixing WARN_ON(size & ~PAGE_MASK) on 16kB/64kB hosts as well.

Patch 2 avoids inserting identical duplicate entries in
kvm_record_guest_s2_mapping().

Tool-generated content:
- Initial bug discovery: automated LLM-assisted audit of the arm64
  nested stage-2 tracking code.
- Patch and text drafting: interactive Gemini session (patches, commit
  messages, and cover letter).

Changes since v1:
- Drop the kvm_remove_guest_s2_mappings() change; discard undersized TTL
  hints in compute_tlb_inval_range() and fall through to the unhinted
  path (Marc Zyngier).
- Split duplicate suppression in kvm_record_guest_s2_mapping() into a
  separate patch, call kfree() under guard(spinlock), and drop the Fixes
  tag (Wei-Lin Chang).
- Rewrite the commit messages and cover letter.

Link to v1: https://lore.kernel.org/r/20261119185105.626343-1-coltonlewis@google.com
[1] https://lore.kernel.org/r/20261123-inval_range-v1-1-815e15797089@pereq.eu
[2] https://lore.kernel.org/r/86h5h7zn5a.wl-maz@kernel.org

Colton Lewis (2):
  KVM: arm64: nv: Discard undersized TTL hints in
    compute_tlb_inval_range()
  KVM: arm64: nv: Avoid duplicate guest stage-2 mapping entries

 arch/arm64/kvm/nested.c | 105 ++++++++++++++++++++++++++++++++--------
 1 file changed, 84 insertions(+), 21 deletions(-)


base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
-- 
2.56.1.839.g22a8290db9-goog



             reply	other threads:[~2026-11-23 23:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 23:26 Colton Lewis [this message]
2026-11-23 23:26 ` [PATCH v2 1/2] KVM: arm64: nv: Discard undersized TTL hints in compute_tlb_inval_range() Colton Lewis
2026-11-23 23:26 ` [PATCH v2 2/2] KVM: arm64: nv: Avoid duplicate guest stage-2 mapping entries Colton Lewis

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=20261123232647.3733149-1-coltonlewis@google.com \
    --to=coltonlewis@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=dan@pereq.eu \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=weilin.chang@arm.com \
    --cc=will@kernel.org \
    --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