From: Thomas Huth <thuth@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>,
groug@kaod.org, peter.maydell@linaro.org, balaton@eik.bme.hu
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target/ppc: Initialize lazy_tlb_flush correctly
Date: Tue, 20 Mar 2018 11:12:41 +0100 [thread overview]
Message-ID: <1c93e2e2-5c17-9bc3-7574-991ec7f7fbc9@redhat.com> (raw)
In-Reply-To: <20180320020345.24930-1-david@gibson.dropbear.id.au>
On 20.03.2018 03:03, David Gibson wrote:
> ppc_tr_init_disas_context() correctly sets lazy_tlb_flush to true on
> certain CPU models. However, it leaves it uninitialized, instead of
> setting it to false on all others.
>
> It wasn't caught before now because we didn't have examples in the tests
> that exercised this path. However it can now be caught using clang's
> undefined behaviour sanitizer and the sam460ex board.
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/translate.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 218665b408..3457d29f8e 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -7237,10 +7237,9 @@ static int ppc_tr_init_disas_context(DisasContextBase *dcbase,
> ctx->sf_mode = msr_is_64bit(env, env->msr);
> ctx->has_cfar = !!(env->flags & POWERPC_FLAG_CFAR);
> #endif
> - if (env->mmu_model == POWERPC_MMU_32B ||
> - env->mmu_model == POWERPC_MMU_601 ||
> - (env->mmu_model & POWERPC_MMU_64B))
> - ctx->lazy_tlb_flush = true;
> + ctx->lazy_tlb_flush = env->mmu_model == POWERPC_MMU_32B
> + || env->mmu_model == POWERPC_MMU_601
> + || (env->mmu_model & POWERPC_MMU_64B);
>
> ctx->fpu_enabled = !!msr_fp;
> if ((env->flags & POWERPC_FLAG_SPE) && msr_spe)
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2018-03-20 10:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 2:03 [Qemu-devel] [PATCH] target/ppc: Initialize lazy_tlb_flush correctly David Gibson
2018-03-20 10:12 ` Thomas Huth [this message]
2018-03-20 10:22 ` Greg Kurz
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=1c93e2e2-5c17-9bc3-7574-991ec7f7fbc9@redhat.com \
--to=thuth@redhat.com \
--cc=balaton@eik.bme.hu \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--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).