All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Colton Lewis <coltonlewis@google.com>
Cc: Oliver Upton <oupton@kernel.org>, 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: Re: [PATCH v2 1/2] KVM: arm64: nv: Discard undersized TTL hints in compute_tlb_inval_range()
Date: Tue, 24 Nov 2026 13:10:04 +0000	[thread overview]
Message-ID: <867bi2z87n.wl-maz@kernel.org> (raw)
In-Reply-To: <20261123232647.3733149-2-coltonlewis@google.com>

On Mon, 23 Nov 2026 23:26:46 +0000,
Colton Lewis <coltonlewis@google.com> wrote:
> 
> When an L1 guest issues TLBI IPAS2E1 with a non-zero TTL hint,
> compute_tlb_inval_range() takes it at face value. If the hinted size is
> smaller than the actual mapping (for example, a 4kB L3 hint on a 2MB
> block), kvm_pgtable_stage2_unmap() clears the entire block while
> kvm_remove_guest_s2_mappings() leaves its stale tracking entry behind in
> guest_s2_mappings. On 16kB or 64kB hosts, a 4kB hint also triggers
> WARN_ON(size & ~PAGE_MASK) in kvm_stage2_unmap_range().
> 
> A TTL hint smaller than PAGE_SIZE or the mapped entry is wrong. Check
> it against PAGE_SIZE, the shadow stage-2 leaf size, and the guest block
> size encoded in KVM_NV_GUEST_MAP_SZ. If it is too small, ignore the hint
> and fall through to the unhinted invalidation path.
> 
> When falling back to the maximum mapping extent with stage-2 disabled,
> size it from PAGE_SIZE rather than VTCR_EL2.TG0 so 1:1 shadow blocks are
> still covered.
> 
> Fixes: d1de1576dc21 ("KVM: arm64: nv: Handle FEAT_TTL hinted TLB operations")
> Signed-off-by: Colton Lewis <coltonlewis@google.com>

What's the advantage doing all this dance over the patch proposed at
[1]?

	M.

[1] https://lore.kernel.org/all/20261123182312.4842-1-maz@kernel.org/

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2026-11-24 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 23:26 [PATCH v2 0/2] KVM: arm64: nv: Fix stale and duplicate guest S2 tracking entries Colton Lewis
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-24 13:10   ` Marc Zyngier [this message]
2026-11-24 20:22     ` Colton Lewis
2026-11-24 20:42       ` Marc Zyngier
2026-11-24 22:16         ` Colton Lewis
2026-11-25  9:56           ` Wei-Lin Chang
2026-11-25 16:09             ` Marc Zyngier
2026-12-02  0:10             ` Colton Lewis
2026-11-23 23:26 ` [PATCH v2 2/2] KVM: arm64: nv: Avoid duplicate guest stage-2 mapping entries Colton Lewis
2026-11-23 23:32   ` sashiko-bot

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=867bi2z87n.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=coltonlewis@google.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=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 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.