Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] KVM: arm64: nv: Fix stale and duplicate guest S2 tracking entries
@ 2026-12-02  0:13 Colton Lewis
  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
  0 siblings, 2 replies; 4+ messages in thread
From: Colton Lewis @ 2026-12-02  0:13 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Wei-Lin Chang, Fuad Tabba, Joey Gouly, Steffen Eiden,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	Mark Rutland, kvmarm, linux-arm-kernel, kvm, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-02  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  0:13 [PATCH v3 0/2] KVM: arm64: nv: Fix stale and duplicate guest S2 tracking entries Colton Lewis
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
2026-12-02  0:20   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox