From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Suraj Jitindar Singh <sjitindarsingh@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Cc: clg@kaod.org, kvm-ppc@vger.kernel.org, sjitindarsingh@gmail.com
Subject: Re: [PATCH 1/3] KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries
Date: Sun, 23 Jun 2019 20:34:24 +1000 (AEST) [thread overview]
Message-ID: <45Wph05wlrz9sBp@ozlabs.org> (raw)
In-Reply-To: <20190620014651.7645-1-sjitindarsingh@gmail.com>
On Thu, 2019-06-20 at 01:46:49 UTC, Suraj Jitindar Singh wrote:
> When a guest vcpu moves from one physical thread to another it is
> necessary for the host to perform a tlb flush on the previous core if
> another vcpu from the same guest is going to run there. This is because the
> guest may use the local form of the tlb invalidation instruction meaning
> stale tlb entries would persist where it previously ran. This is handled
> on guest entry in kvmppc_check_need_tlb_flush() which calls
> flush_guest_tlb() to perform the tlb flush.
>
> Previously the generic radix__local_flush_tlb_lpid_guest() function was
> used, however the functionality was reimplemented in flush_guest_tlb()
> to avoid the trace_tlbie() call as the flushing may be done in real
> mode. The reimplementation in flush_guest_tlb() was missing an erat
> invalidation after flushing the tlb.
>
> This lead to observable memory corruption in the guest due to the
> caching of stale translations. Fix this by adding the erat invalidation.
>
> Fixes: 70ea13f6e609 "KVM: PPC: Book3S HV: Flush TLB on secondary radix threads"
>
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/50087112592016a3fc10b394a55f1f1a1bde6908
cheers
prev parent reply other threads:[~2019-06-23 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 1:46 [PATCH 1/3] KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries Suraj Jitindar Singh
2019-06-20 1:46 ` [PATCH 2/3] KVM: PPC: Book3S HV: Signed extend decrementer value if not using large decr Suraj Jitindar Singh
2019-06-20 7:56 ` Laurent Vivier
2019-06-30 8:37 ` Michael Ellerman
2019-06-20 1:46 ` [PATCH 3/3] KVM: PPC: Book3S HV: Clear pending decr exceptions on nested guest entry Suraj Jitindar Singh
2019-06-20 7:57 ` Laurent Vivier
2019-06-20 8:19 ` Cédric Le Goater
2019-06-30 8:37 ` Michael Ellerman
2019-06-23 10:34 ` Michael Ellerman [this message]
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=45Wph05wlrz9sBp@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=clg@kaod.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sjitindarsingh@gmail.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;
as well as URLs for NNTP newsgroup(s).