qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: Leandro Lupori <leandro.lupori@eldorado.org.br>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: clg@kaod.org, david@gibson.dropbear.id.au, groug@kaod.org
Subject: Re: [PATCH] target/ppc: Fix tlbie
Date: Tue, 17 May 2022 16:02:18 -0300	[thread overview]
Message-ID: <6b19ef14-cc09-50ed-26fd-58e5b144cd0b@gmail.com> (raw)
In-Reply-To: <20220503163904.22575-1-leandro.lupori@eldorado.org.br>

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

On 5/3/22 13:39, Leandro Lupori wrote:
> Commit 74c4912f097bab98 changed check_tlb_flush() to use
> tlb_flush_all_cpus_synced() instead of calling tlb_flush() on each
> CPU. However, as side effect of this, a CPU executing a ptesync
> after a tlbie will have its TLB flushed only after exiting its
> current Translation Block (TB).
> 
> This causes memory accesses to invalid pages to succeed, if they
> happen to be on the same TB as the ptesync.
> 
> To fix this, use tlb_flush_all_cpus() instead, that immediately
> flushes the TLB of the CPU executing the ptesync instruction.
> 
> Fixes: 74c4912f097bab98 ("target/ppc: Fix synchronization of mttcg with broadcast TLB flushes")
> Signed-off-by: Leandro Lupori <leandro.lupori@eldorado.org.br>
> ---
>   target/ppc/helper_regs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c
> index 9a691d6833..1fa032e4d0 100644
> --- a/target/ppc/helper_regs.c
> +++ b/target/ppc/helper_regs.c
> @@ -293,7 +293,7 @@ void check_tlb_flush(CPUPPCState *env, bool global)
>       if (global && (env->tlb_need_flush & TLB_NEED_GLOBAL_FLUSH)) {
>           env->tlb_need_flush &= ~TLB_NEED_GLOBAL_FLUSH;
>           env->tlb_need_flush &= ~TLB_NEED_LOCAL_FLUSH;
> -        tlb_flush_all_cpus_synced(cs);
> +        tlb_flush_all_cpus(cs);
>           return;
>       }
>   


      parent reply	other threads:[~2022-05-17 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 16:39 [PATCH] target/ppc: Fix tlbie Leandro Lupori
2022-05-03 16:54 ` Cédric Le Goater
2022-05-03 18:09   ` Leandro Lupori
2022-05-13 17:12 ` Fabiano Rosas
2022-05-17 19:02 ` Daniel Henrique Barboza [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=6b19ef14-cc09-50ed-26fd-58e5b144cd0b@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=leandro.lupori@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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).