On Fri, Jun 27, 2025 at 06:16:56AM -0700, Richard Henderson wrote:
> On 6/26/25 09:20, Andrea Bolognani wrote:
> > On Mon, Jun 09, 2025 at 06:52:21AM -0700, Andrea Bolognani wrote:
> > > On Tue, Apr 15, 2025 at 12:24:04PM -0700, Richard Henderson wrote:
> > > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
> > > > ---
> > > >   tcg/tcg.c                        | 20 +++++++++
> > > >   tcg/aarch64/tcg-target.c.inc     | 28 +++++++-----
> > > >   tcg/arm/tcg-target.c.inc         | 23 +++++-----
> > > >   tcg/i386/tcg-target.c.inc        | 77 +++++++++++++++++---------------
> > > >   tcg/loongarch64/tcg-target.c.inc | 33 +++++++-------
> > > >   tcg/mips/tcg-target.c.inc        | 35 +++++++--------
> > > >   tcg/ppc/tcg-target.c.inc         | 35 +++++++--------
> > > >   tcg/riscv/tcg-target.c.inc       | 54 +++++++++++-----------
> > > >   tcg/s390x/tcg-target.c.inc       | 14 +++---
> > > >   tcg/sparc64/tcg-target.c.inc     | 16 ++++---
> > > >   tcg/tci/tcg-target.c.inc         |  8 ++--
> > > >   11 files changed, 191 insertions(+), 152 deletions(-)
> > >
> > > Hi Richard,
> > >
> > > this seems to have introduced a regression when running on a riscv64
> > > host.
> > >
> > > Before the change:
> > >
> > >    $ timeout --foreground 1 \
> > >      ./build/qemu-system-riscv64 -machine virt,accel=tcg \
> > >      -display none -serial stdio 2>&1 | grep -i opensbi
> > >    OpenSBI v1.5.1
> > >
> > > After the change, no output is produced.
> > >
> > > This causes the
> > >
> > >    qemu:func-quick+func-riscv64 / func-riscv64-riscv_opensbi
> > >
> > > test to stall and eventually fail due to the built-in test suite
> > > timeout kicking in.
> > >
> > > Interestingly, I can't reproduce this by running the exact same
> > > commands and using the exact same git commits on an x86_64 host.
> > >
> > > Do you have any idea what could be going wrong? I'll happily
> > > investigate further if you give me pointers.
> >
> > Hi,
> >
> > this is still an issue as of f9a3def17b2a.
> >
> > Any idea where to look?
>
> tcg/riscv/tcg-target.c.inc, tgen_extract(), must be at fault.
>
> Oh, I see it:
>
> --- a/tcg/riscv/tcg-target.c.inc
> +++ b/tcg/riscv/tcg-target.c.inc
> @@ -2502,7 +2502,7 @@ static void tgen_extract
>          }
>      }
>      if (ofs + len == 32) {
> -        tgen_shli(s, TCG_TYPE_I32, a0, a1, ofs);
> +        tgen_shri(s, TCG_TYPE_I32, a0, a1, ofs);
>          return;
>      }
>      if (len == 1) {
>
>
> Please test.

This indeed seems to do the trick, I get output from OpenSBI now.

  Tested-by: Andrea Bolognani <abolo...@redhat.com>

Thank you!

-- 
Andrea Bolognani / Red Hat / Virtualization


Reply via email to