From: Richard Henderson <richard.henderson@linaro.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Ivan Warren <ivan@vmfacility.fr>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/ppc: Fix truncation of env->hflags
Date: Sun, 24 Jan 2021 09:38:04 -1000 [thread overview]
Message-ID: <fed7279c-528c-c4d3-f305-c88ffcdf7bff@linaro.org> (raw)
In-Reply-To: <20210124044634.GA8202@yekko.fritz.box>
On 1/23/21 6:46 PM, David Gibson wrote:
> On Sat, Jan 23, 2021 at 05:24:22PM -1000, Richard Henderson wrote:
>> Use the cs_base field, because it happens to be the same
>> size as hflags (and MSR, from which hflags is derived).
>>
>> In translate, extract most bits from a local hflags variable.
>> Mark several cases where code generation is *not* derived from
>> data stored within the hashed elements of the TranslationBlock.
>
> My knowledge of TCG isn't great, so I'm pretty much prepared to accept
> this is correct on your say so.
>
> But that commit message feels like it's following on from a
> conversation that's not here, nor linked. It'd be great if it
> explained how said hflags truncation is happening, because it's
> certainly not obvious to someone with only a fair to middling
> understanding of TCG.
Mm, fair.
How about:
The assignment from env->hflags to tb->flags truncates
target_ulong to uint32_t. This loses important bits from
the top of hflags, which results in incorrect tb selection.
Use the cs_base field instead, because it happens to be the
same size as hflags (and MSR fom which hflags is derived).
In translate, extract most bits from a local hflags variable.
All of the checks vs env->flags are redundant with env->msr_mask
in that msr bits cannot be set when the feature is not available.
Mark several cases where code generation is *not* derived from
data stored within hashed elements of the tb.
r~
next prev parent reply other threads:[~2021-01-24 19:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-24 3:24 [PATCH] target/ppc: Fix truncation of env->hflags Richard Henderson
2021-01-24 4:46 ` David Gibson
2021-01-24 19:38 ` Richard Henderson [this message]
2021-01-25 10:03 ` Alex Bennée
2021-01-29 0:15 ` David Gibson
2021-01-24 12:18 ` Ivan Warren
2021-02-10 4:34 ` David Gibson
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=fed7279c-528c-c4d3-f305-c88ffcdf7bff@linaro.org \
--to=richard.henderson@linaro.org \
--cc=david@gibson.dropbear.id.au \
--cc=ivan@vmfacility.fr \
--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).