qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] AArch64: ld/st exclusive pair bug
@ 2014-10-11 13:04 Laurent Desnogues
  2014-10-11 15:33 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Desnogues @ 2014-10-11 13:04 UTC (permalink / raw)
  To: qemu-devel@nongnu.org, Peter Maydell

Hello,

there's a bug in target-arm/translate-a64.c:disas_ldst_excl.  The line:

            TCGv_i64 tcg_rt2 = cpu_reg(s, rt);

is accessing the wrong register.

Thanks,

Laurent

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

* Re: [Qemu-devel] AArch64: ld/st exclusive pair bug
  2014-10-11 13:04 [Qemu-devel] AArch64: ld/st exclusive pair bug Laurent Desnogues
@ 2014-10-11 15:33 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2014-10-11 15:33 UTC (permalink / raw)
  To: Laurent Desnogues; +Cc: Alex Bennée, qemu-devel@nongnu.org

On 11 October 2014 14:04, Laurent Desnogues <laurent.desnogues@gmail.com> wrote:
> there's a bug in target-arm/translate-a64.c:disas_ldst_excl.  The line:
>
>             TCGv_i64 tcg_rt2 = cpu_reg(s, rt);
>
> is accessing the wrong register.

Yeah, obvious cut-n-paste error, but this doesn't actually
affect the exclusive code path, does it? In fact, looking
at the decode tables I can't find any instructions with
is_excl false and is_pair true (these would be load acquire/
store release pair insns, which would be LDARP/STLRP if they
existed.) I think the actual bug here is that we've missed
an unallocated-encoding case, isn't it?

The pseudocode check is
 if o2:o1:o0 == '100' || o2:o1:o0 == '11x'

which in our terms would be
 if ((!is_excl && !is_pair && !is_lasr)
     || (!is_excl && is_pair))

[plus the pair with wrong size check which we get right.]

Then the code that purports to handle non-exclusive pair
accesses is dead and can be deleted...

-- PMM

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

end of thread, other threads:[~2014-10-11 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 13:04 [Qemu-devel] AArch64: ld/st exclusive pair bug Laurent Desnogues
2014-10-11 15:33 ` 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).