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: Wei-Lin Chang <weilin.chang@arm.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	 Joey Gouly <joey.gouly@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	 Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	kvmarm@lists.linux.dev,  linux-arm-kernel@lists.infradead.org,
	kvm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] KVM: arm64: nv: Fix stale and duplicate guest S2 tracking entries
Date: Wed,  2 Dec 2026 00:13:33 +0000	[thread overview]
Message-ID: <20261202001335.2306714-1-coltonlewis@google.com> (raw)

When kvm_pgtable_stage2_unmap_tracked() is called with a size smaller
than a tracked block mapping (such as from a TLBI RIPAS2E1IS range or a
TLBI IPAS2E1IS with a 4kB TTL hint on a 2MB block),
kvm_pgtable_stage2_unmap() clears the entire block in the shadow stage-2
page table while kvm_remove_guest_s2_mappings() leaves its stale
tracking entry behind in guest_s2_mappings.

Patch 1 checks nested_start in the shadow page table with
kvm_pgtable_get_leaf() on partial overlaps in
kvm_remove_guest_s2_mappings() and removes the tracking entry once no
valid PTE or child table remains at its tracked granule size, leaving
compute_tlb_inval_range() untouched so this series is independent of
Marc's sub-page TTL fix [1].

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 v2:
- Drop the compute_tlb_inval_range() changes and return to the v1
  kvm_remove_guest_s2_mappings() approach (Marc Zyngier).
- Simplify the Patch 1 commit message and comments per v1 review
  (Wei-Lin Chang).

Link to v1: https://lore.kernel.org/r/20261119185105.626343-1-coltonlewis@google.com
Link to v2: https://lore.kernel.org/r/20261123232647.3733149-1-coltonlewis@google.com
[1] https://lore.kernel.org/r/20261123182312.4842-1-maz@kernel.org

Colton Lewis (2):
  KVM: arm64: nv: Remove unmapped guest stage-2 mapping entries
  KVM: arm64: nv: Avoid duplicate guest stage-2 mapping entries

 arch/arm64/kvm/nested.c | 66 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 61 insertions(+), 5 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.56.1.911.g883d8bcb20-goog



             reply	other threads:[~2026-12-02  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  0:13 Colton Lewis [this message]
2026-12-02  0:13 ` [PATCH v3 1/2] KVM: arm64: nv: Remove unmapped guest stage-2 mapping entries Colton Lewis
2026-12-02  0:13 ` [PATCH v3 2/2] KVM: arm64: nv: Avoid duplicate " 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=20261202001335.2306714-1-coltonlewis@google.com \
    --to=coltonlewis@google.com \
    --cc=catalin.marinas@arm.com \
    --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