linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Oliver Upton <oliver.upton@linux.dev>,
	Fuad Tabba <tabba@google.com>,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH 2/2] KVM: arm64: Ensure TLBI uses correct VMID after changing context
Date: Thu, 15 Aug 2024 13:31:54 +0100	[thread overview]
Message-ID: <86o75uynk5.wl-maz@kernel.org> (raw)
In-Reply-To: <20240815120803.GA21444@willie-the-truck>

On Thu, 15 Aug 2024 13:08:03 +0100,
Will Deacon <will@kernel.org> wrote:
> 
> > Is there an actual path within pKVM that causes a guest TLBI to be
> > followed by a host __kvm_tlb_flush_vmid() *without* a CSE? I can't
> > convinced myself that such a path exist in the current upstream code
> > base.
> 
> I think you're right that this can't happen upstream. We see the issue
> in Android when reclaiming pages from a guest during teardown. That
> amounts to unmapping pages from the guest, poisoning them and mapping
> them back into the host. Mapping them into the host can then trigger
> table -> block conversion and the associated TLB invalidation wasn't
> effective because it was still using the guest VMID.
> 
> We can carry this patch in Android if you prefer, but given that
> {enter,exit}_vmid_context() are upstream, it would be nice to land the
> fix so that we don't run into this bug again in future (it took some
> debugging!).

I think it is definitely worth addressing, and given that this is nVHE
only, an extra CSE isn't going to show on the radar.

The question is more whether this is 6.11 or 6.12 material. If that's
not an immediate fix for upstream, I'm tempted to queue it for 6.12.

Does this work for you?

	M.

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


  reply	other threads:[~2024-08-15 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 12:34 [PATCH 0/2] KVM: arm64: Fix a couple of pKVM/nVHE TLB invalidation bugs Will Deacon
2024-08-14 12:34 ` [PATCH 1/2] KVM: arm64: Invalidate EL1&0 TLB entries for all VMIDs in nvhe hyp init Will Deacon
2024-08-14 12:34 ` [PATCH 2/2] KVM: arm64: Ensure TLBI uses correct VMID after changing context Will Deacon
2024-08-14 13:30   ` Marc Zyngier
2024-08-15 12:08     ` Will Deacon
2024-08-15 12:31       ` Marc Zyngier [this message]
2024-08-15 12:38         ` Will Deacon
2024-08-15 13:08 ` [PATCH 0/2] KVM: arm64: Fix a couple of pKVM/nVHE TLB invalidation bugs 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=86o75uynk5.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oliver.upton@linux.dev \
    --cc=tabba@google.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).