From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/4] target/arm: Update MSR access to UAO
Date: Fri, 6 Dec 2019 11:00:32 -0800 [thread overview]
Message-ID: <d14445cf-f0f1-bf76-b8f4-2e5845df5a35@linaro.org> (raw)
In-Reply-To: <CAFEAcA914CO2vfMAkr4aeEA_FV0Vub6S9eF43qN=14e7nU1uHg@mail.gmail.com>
On 12/6/19 10:30 AM, Peter Maydell wrote:
>> + if (cpu_isar_feature(aa64_uao, cpu)) {
>> + static const ARMCPRegInfo uao_reginfo[] = {
>> + { .name = "UAO", .state = ARM_CP_STATE_AA64,
>> + .opc0 = 3, .opc1 = 0, .crn = 4, .crm = 2, .opc2 = 4,
>> + .type = ARM_CP_NO_RAW, .access = PL1_RW,
>> + .readfn = aa64_uao_read, .writefn = aa64_uao_write, },
>> + REGINFO_SENTINEL
>> + };
>
> This could just be a file-scope global, right?
> Also, you can just use define_one_arm_cp_reg() rather
> than having a list with one entry. (cf zcr_el1_reginfo).
Can do.
>> + case 0x03: /* UAO */
>> + if (!dc_isar_feature(aa64_uao, s) || s->current_el == 0) {
>> + goto do_unallocated;
>> + }
>> + if (crm & 1) {
>> + set_pstate_bits(PSTATE_UAO);
>> + } else {
>> + clear_pstate_bits(PSTATE_UAO);
>> + }
>> + t1 = tcg_const_i32(s->current_el);
>> + gen_helper_rebuild_hflags_a64(cpu_env, t1);
>> + tcg_temp_free_i32(t1);
>> + break;
>
> Do we also need to end the TB since we've messed with
> the hflags, or is some bit of code not in the patch
> context handling that?
Outside the patch context, at the start of the function, we default to ending
the TB.
> Does the "on exception entry PSTATE.UAO is zeroed" behaviour
> fall out automatically for us? How about "on exception entry
> from aarch32 to aarch64 SPSR_ELx.UAO is set to zero" ?
Yes to both -- new_mode (perhaps better renamed as new_pstate) is initialized
as 0 + stuff required to be non-zero. Thus PAN required special handling but
UAO does not.
> I think we may also want a minor code change so that an exception
> return from aarch64 to aarch32 doesn't copy a bogus SPSR UAO==1
> into the pstate/cpsr.
Ah, good catch.
r~
next prev parent reply other threads:[~2019-12-06 19:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 23:42 [PATCH 0/4] target/arm: Implement ARMv8.2-UAO Richard Henderson
2019-12-03 23:42 ` [PATCH 1/4] target/arm: Add ID_AA64MMFR2_EL1 Richard Henderson
2019-12-06 18:19 ` Peter Maydell
2020-02-02 0:54 ` Richard Henderson
2019-12-03 23:42 ` [PATCH 2/4] target/arm: Update MSR access to UAO Richard Henderson
2019-12-06 18:30 ` Peter Maydell
2019-12-06 19:00 ` Richard Henderson [this message]
2020-02-02 1:00 ` Richard Henderson
2020-02-02 13:29 ` Peter Maydell
2020-02-03 7:46 ` Richard Henderson
2019-12-03 23:42 ` [PATCH 3/4] target/arm: Implement UAO semantics Richard Henderson
2019-12-06 18:31 ` Peter Maydell
2019-12-03 23:42 ` [PATCH 4/4] target/arm: Enable ARMv8.2-UAO in -cpu max Richard Henderson
2019-12-06 18:31 ` Peter Maydell
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=d14445cf-f0f1-bf76-b8f4-2e5845df5a35@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).