qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 03/45] target/arm: Trap non-streaming usage when Streaming


From: Peter Maydell
Subject: Re: [PATCH v4 03/45] target/arm: Trap non-streaming usage when Streaming SVE is active
Date: Mon, 4 Jul 2022 09:33:08 +0100

On Mon, 4 Jul 2022 at 09:28, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 7/1/22 16:36, Peter Maydell wrote:
> >> +    /*
> >> +     * The SME exception we are testing for is raised via
> >> +     * AArch64.CheckFPAdvSIMDEnabled(), and for AArch32 this is called
> >> +     * when EL1 is using A64 or EL2 using A64 and !TGE.
> >> +     * See AArch32.CheckAdvSIMDOrFPEnabled().
> >> +     */
> >> +    if (el == 0
> >> +        && FIELD_EX64(env->svcr, SVCR, SM)
> >> +        && (!arm_is_el2_enabled(env)
> >> +            || (arm_el_is_aa64(env, 2) && !(env->cp15.hcr_el2 & HCR_TGE)))
> >> +        && arm_el_is_aa64(env, 1)
> >> +        && !sme_fa64(env, el)) {
> >
> > I can't get any of:
> >   * the logic in the comment
> >   * the logic in the C code
> >   * the logic in the the pseudocode AArch32.CheckAdvSIMDOrFPEnabled()
> >     which causes it to call AArch64.CheckFPEnabled()
> > to line up with each other.
> >
> > The comment has:
> >   * (EL1 A64) OR (EL2 A64 && !TGE)
> > The pseudocode has:
> >   * (!TGE && EL1 A64) OR (TGE && EL2 A64 && EL1 A64)
> >     [seems odd that it is checking the width of EL1 in the TGE case
> >      but I haven't followed the logic through to find out why]
> > The C code here has:
> >   * (!TGE && EL2 A64 && EL1 A64)
> >
> > What am I missing ?
>
> I'm looking at 0487H.a... are you looking at a different version?
> Because the pseudocode I see isn't what you list above:
>
> > if PSTATE.EL == EL0 && (!EL2Enabled() || (!ELUsingAArch32(EL2) && 
> > HCR_EL2.TGE == '0')) &&
>
> > !ELUsingAArch32(EL1) then
> So
>    (!EL2 || (EL2 A64 && !TGE)) && EL1 A64
>
> which is, as far as I can see, what the C code has.

Yeah, I misread the pseudocode (it only calls AArch64.CheckFPAdvSIMDEnabled
in the first branch of the if..elsif..., and it's there that the SME check
happens, not in AArch64.CheckFPEnabled(), which is called in both branches).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]