Hi,
On Sat, May 03, 2025 at 02:27:08PM -0700, Richard Henderson wrote:
> This should have been done before removing TARGET_ALIGNED_ONLY,
> as we did for hppa and alpha.
>
> Fixes: 8244189419f9 ("target/sh4: Remove TARGET_ALIGNED_ONLY")
> Signed-off-by: Richard Henderson <[email protected]>
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
When trying to run sh4 emulations with qemu 10.1.0, I get quite interesting
error messages. Bisect points to this patch, and reverting it fixes the
problem.
Guenter
---
Bisect log:
# bad: [f8b2f64e2336a28bf0d50b6ef8a7d8c013e9bcf3] Update version for the
v10.1.0 release
# good: [7c949c53e936aa3a658d84ab53bae5cadaa5d59c] Update version for the
v10.0.0 release
git bisect start 'v10.1.0' 'v10.0.0'
# bad: [14b5a799339d2d21826eac5ab1e98d00b1f1f89f] hpet: return errors from
realize if properties are incorrect
git bisect bad 14b5a799339d2d21826eac5ab1e98d00b1f1f89f
# good: [54e54e594bc8273d210f7ff4448c165a989cbbe8] hw/i2c/imx: Always set
interrupt status bit if interrupt condition occurs
git bisect good 54e54e594bc8273d210f7ff4448c165a989cbbe8
# good: [f0737158b483e7ec2b2512145aeab888b85cc1f7] Merge tag 'for-upstream' of
https://gitlab.com/bonzini/qemu into staging
git bisect good f0737158b483e7ec2b2512145aeab888b85cc1f7
# bad: [e86c1f967a323165d13bcadfad4b92d0d34cdb08] hw/block: Drop unused nand.c
git bisect bad e86c1f967a323165d13bcadfad4b92d0d34cdb08
# good: [89d2a9f3f7564c9421d61153bbf7e24af95d34ee] hw/misc/aspeed_hace: Move
register size to instance class and dynamically allocate regs
git bisect good 89d2a9f3f7564c9421d61153bbf7e24af95d34ee
# bad: [981f2beb161b9bcaeedc1f91ad22bff255856cb2] target: Use
cpu_pointer_wrap_uint32 for 32-bit targets
git bisect bad 981f2beb161b9bcaeedc1f91ad22bff255856cb2
# good: [221d22d830eb1a96f780eec28e6a45286b85fe85] hw/arm/aspeed_ast27x0: Fix
unimplemented region overlap with vbootrom
git bisect good 221d22d830eb1a96f780eec28e6a45286b85fe85
# good: [beea772666fb1bb86136042fd8ee7140a01bb36f] target/microblaze: Implement
extended address load/store out of line
git bisect good beea772666fb1bb86136042fd8ee7140a01bb36f
# good: [36a9529e60e09b0d0b6b5ebad614255c97bf9322] target/microblaze: Simplify
compute_ldst_addr_type{a,b}
git bisect good 36a9529e60e09b0d0b6b5ebad614255c97bf9322
# bad: [eb978e50e42f3439e7a7a104e76aafc81bc4a028] target/sh4: Use MO_ALIGN for
system UNALIGN()
git bisect bad eb978e50e42f3439e7a7a104e76aafc81bc4a028
# good: [11efde54f248c2da9e164910b8b1945e78a7168e] tcg: Drop
TCGContext.page_{mask,bits}
git bisect good 11efde54f248c2da9e164910b8b1945e78a7168e
# first bad commit: [eb978e50e42f3439e7a7a104e76aafc81bc4a028] target/sh4: Use
MO_ALIGN for system UNALIGN()
---
Sample error log from Linux:
delay-slot-insn faulting in handle_unaligned_delayslot: 0000 [#2]
Modules linked in:
CPU: 0 UID: 0 PID: 1928 Comm: kunit_try_catch Tainted: G D N
6.17.0-09936-gcbf33b8e0b36 #1 NONE
Tainted: [D]=DIE, [N]=TEST
PC is at gso_test_func+0x298/0x6b4
PR is at gso_test_func+0x23c/0x6b4
PC : 8c5073c4 SP : 8cfedebc SR : 40008001 TEA : 8ecf141d
R0 : 00000000 R1 : 8ecf13f1 R2 : 8cc77c50 R3 : 00000000
R4 : 8ffd8e40 R5 : 000003e8 R6 : 00000000 R7 : 00000000
R8 : 8cc29e48 R9 : 8c73fed8 R10 : 8cc77c60 R11 : 8c7bfb60
R12 : 8ffd8e40 R13 : 8cc77c7c R14 : 00000000
MACH: 00007696 MACL: daaa5ec5 GBR : 00000000 PR : 8c507368
Call trace:
[<8c057258>] __pick_eevdf+0x0/0x3bc
[<8c5c21b4>] __schedule+0x2ec/0x6ec
[<8c5c21ce>] __schedule+0x306/0x6ec
[<8c21f978>] kunit_try_run_case+0x58/0x174
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c089678>] ktime_get_ts64+0x0/0x184
[<8c5c25ce>] schedule+0x1a/0xf8
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c221d18>] kunit_generic_run_threadfn_adapter+0x10/0x24
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c04aca8>] kthread+0xb8/0x1b4
[<8c0241c4>] ret_from_kernel_thread+0xc/0x14
[<8c020698>] arch_local_save_flags+0x0/0x8
[<8c054198>] schedule_tail+0x0/0x58
[<8c04abf0>] kthread+0x0/0x1b4
Process: kunit_try_catch (pid: 1928, stack limit = (ptrval))
Stack: (0x8cfedebc to 0x8cfee000)
dea0: 8cc2c000
dec0: 8cc2c060 8c057258 00000000 8cc77c00 00000000 8cc29d0c 8cc77c40 8c5c21b4
dee0: 00000000 8cf03c00 8cc2c000 8cfedf10 8c5c21ce a16aaf05 8c21f978 8cc29d2c
df00: 8c221d08 8c04a8e4 8c089678 8cf7f000 8c78310c 8cc29d0c 8cc2c428 8cc2c000
df20: 00000021 00000000 07dc6b68 00000000 00000000 00000000 00000002 a16aaf05
df40: 8c5c25ce 8cfedf60 8c221d08 8c04a8e4 a16aaf05 8c221d18 8c221d08 8c04a8e4
df60: 8cc29ab0 8ecd43c0 8ecd43c0 8cc29d2c 8c04aca8 00000000 00000000 00000000
df80: a16aaf05 8c0241c4 8cc35f1c 8c78e25c 8cc2c77c 8c020698 00000000 8cf03c00
dfa0: 8c054198 00000000 00000000 00000000 00000000 8ecf0ae0 8c04abf0 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 40008000 00000000 00000000 00000000 00000000
---[ end trace 0000000000000000 ]---
# gso_test_func: try faulted: last line seen net/core/net_test.c:170
# gso_test_func: internal error occurred preventing test case from running:
-4
not ok 3 frags
delay-slot-insn faulting in handle_unaligned_delayslot: 0000 [#3]
Modules linked in:
CPU: 0 UID: 0 PID: 1930 Comm: kunit_try_catch Tainted: G D N
6.17.0-09936-gcbf33b8e0b36 #1 NONE
Tainted: [D]=DIE, [N]=TEST
PC is at gso_test_func+0x298/0x6b4
PR is at gso_test_func+0x23c/0x6b4
PC : 8c5073c4 SP : 8cfedebc SR : 40008001 TEA : 8ecf3035
R0 : 00000000 R1 : 8ecf3009 R2 : 8cc77e90 R3 : 00000000
R4 : 8ffd8e80 R5 : 000003e8 R6 : 00000000 R7 : 00000000
R8 : 8cc29e48 R9 : 8c73fed8 R10 : 8cc77ea0 R11 : 8c7bfb84
R12 : 8ffd8e80 R13 : 8cc77ebc R14 : 00000000
MACH: 00003b51 MACL: efffda09 GBR : 00000000 PR : 8c507368
Call trace:
[<8c057258>] __pick_eevdf+0x0/0x3bc
[<8c5c21b4>] __schedule+0x2ec/0x6ec
[<8c5c21ce>] __schedule+0x306/0x6ec
[<8c21f978>] kunit_try_run_case+0x58/0x174
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c089678>] ktime_get_ts64+0x0/0x184
[<8c5c25ce>] schedule+0x1a/0xf8
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c221d18>] kunit_generic_run_threadfn_adapter+0x10/0x24
[<8c221d08>] kunit_generic_run_threadfn_adapter+0x0/0x24
[<8c04a8e4>] to_kthread+0x0/0x1c
[<8c04aca8>] kthread+0xb8/0x1b4
[<8c0241c4>] ret_from_kernel_thread+0xc/0x14
[<8c020698>] arch_local_save_flags+0x0/0x8
[<8c054198>] schedule_tail+0x0/0x58
[<8c04abf0>] kthread+0x0/0x1b4