qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Bug in tlbi_aa64_vae2is_write: tlbbits_for_regime called with swapped ARMMMUIdx_ values?
@ 2021-03-16  5:33 Rebecca Cran
  2021-03-16 15:07 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Rebecca Cran @ 2021-03-16  5:33 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, QEMU Developers

I noticed the following in tlbi_aa64_vae2is_write: it appears that when 
calling tlbbits_for_regime the ARMMMUIdx values are swapped?

static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri,
                                    uint64_t value)
{
     CPUState *cs = env_cpu(env);
     uint64_t pageaddr = sextract64(value << 12, 0, 56);
     bool secure = arm_is_secure_below_el3(env);
     int mask = secure ? ARMMMUIdxBit_SE2 : ARMMMUIdxBit_E2;
     int bits = tlbbits_for_regime(env, secure ? ARMMMUIdx_E2 : 
ARMMMUIdx_SE2,
                                   pageaddr);

     tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, 
bits);
}

-- 
Rebecca Cran


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in tlbi_aa64_vae2is_write: tlbbits_for_regime called with swapped ARMMMUIdx_ values?
  2021-03-16  5:33 Bug in tlbi_aa64_vae2is_write: tlbbits_for_regime called with swapped ARMMMUIdx_ values? Rebecca Cran
@ 2021-03-16 15:07 ` Richard Henderson
  2021-03-22 14:21   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2021-03-16 15:07 UTC (permalink / raw)
  To: Rebecca Cran; +Cc: qemu-arm, QEMU Developers

On 3/15/21 11:33 PM, Rebecca Cran wrote:
> I noticed the following in tlbi_aa64_vae2is_write: it appears that when calling 
> tlbbits_for_regime the ARMMMUIdx values are swapped?
> 
> static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri,
>                                     uint64_t value)
> {
>      CPUState *cs = env_cpu(env);
>      uint64_t pageaddr = sextract64(value << 12, 0, 56);
>      bool secure = arm_is_secure_below_el3(env);
>      int mask = secure ? ARMMMUIdxBit_SE2 : ARMMMUIdxBit_E2;
>      int bits = tlbbits_for_regime(env, secure ? ARMMMUIdx_E2 : ARMMMUIdx_SE2,

Yep, good catch.

r~

>                                    pageaddr);
> 
>      tlb_flush_page_bits_by_mmuidx_all_cpus_synced(cs, pageaddr, mask, bits);
> }
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in tlbi_aa64_vae2is_write: tlbbits_for_regime called with swapped ARMMMUIdx_ values?
  2021-03-16 15:07 ` Richard Henderson
@ 2021-03-22 14:21   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-03-22 14:21 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Rebecca Cran, QEMU Developers, qemu-arm

On Tue, 16 Mar 2021 at 15:07, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 3/15/21 11:33 PM, Rebecca Cran wrote:
> > I noticed the following in tlbi_aa64_vae2is_write: it appears that when calling
> > tlbbits_for_regime the ARMMMUIdx values are swapped?
> >
> > static void tlbi_aa64_vae2is_write(CPUARMState *env, const ARMCPRegInfo *ri,
> >                                     uint64_t value)
> > {
> >      CPUState *cs = env_cpu(env);
> >      uint64_t pageaddr = sextract64(value << 12, 0, 56);
> >      bool secure = arm_is_secure_below_el3(env);
> >      int mask = secure ? ARMMMUIdxBit_SE2 : ARMMMUIdxBit_E2;
> >      int bits = tlbbits_for_regime(env, secure ? ARMMMUIdx_E2 : ARMMMUIdx_SE2,
>
> Yep, good catch.

Would somebody like to write a patch with the fix ?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-22 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-16  5:33 Bug in tlbi_aa64_vae2is_write: tlbbits_for_regime called with swapped ARMMMUIdx_ values? Rebecca Cran
2021-03-16 15:07 ` Richard Henderson
2021-03-22 14:21   ` Peter Maydell

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).