[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] target/sh4: Fix TB_FLAG_UNALIGN
From: |
Guenter Roeck |
Subject: |
Re: [PATCH v2] target/sh4: Fix TB_FLAG_UNALIGN |
Date: |
Mon, 12 Dec 2022 20:55:01 -0800 |
On Mon, Dec 12, 2022 at 08:30:42AM -0600, Richard Henderson wrote:
> On 12/11/22 19:13, Guenter Roeck wrote:
> > On Sat, Dec 10, 2022 at 07:27:46AM -0800, Guenter Roeck wrote:
> > > Hi,
> > >
> > > On Thu, Sep 01, 2022 at 11:15:09AM +0100, Richard Henderson wrote:
> > > > The value previously chosen overlaps GUSA_MASK.
> > > >
> > > > Rename all DELAY_SLOT_* and GUSA_* defines to emphasize
> > > > that they are included in TB_FLAGs. Add aliases for the
> > > > FPSCR and SR bits that are included in TB_FLAGS, so that
> > > > we don't accidentally reassign those bits.
> > > >
> > > > Fixes: 4da06fb3062 ("target/sh4: Implement prctl_unalign_sigbus")
> > > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/856
> > > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> > >
> > > I noticed that my sh4 emulations crash randomly with qemu v7.2-rc4.
> > > This happens with all Linux kernel versions. Testing shows that this
> > > patch is responsible. Reverting it fixes the problem.
> > >
> >
> > The patch below fixes the problem for me.
>
> Thanks for the investigation.
>
>
> > +++ b/target/sh4/cpu.c
> > @@ -47,7 +47,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs,
> > SuperHCPU *cpu = SUPERH_CPU(cs);
> > cpu->env.pc = tb_pc(tb);
> > - cpu->env.flags = tb->flags;
> > + cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK;
>
> Only this hunk should be necessary.
>
Confirmed.
Do you plan to send a formal patch, or do you want me to do it ?
Thanks,
Guenter