MAINTAINERS | 1 +
configs/targets/mips-linux-user.mak | 1 +
configs/targets/mips-softmmu.mak | 1 +
configs/targets/mips64-linux-user.mak | 1 +
configs/targets/mips64-softmmu.mak | 1 +
configs/targets/mips64el-linux-user.mak | 1 +
configs/targets/mips64el-softmmu.mak | 1 +
configs/targets/mipsel-linux-user.mak | 1 +
configs/targets/mipsel-softmmu.mak | 1 +
configs/targets/mipsn32-linux-user.mak | 1 +
configs/targets/mipsn32el-linux-user.mak | 1 +
target/mips/internal.h | 2 +
tests/tcg/mips64el/system/include/assert.h | 15 +
tests/tcg/mips64el/system/include/inttypes.h | 7 +
tests/tcg/mips64el/system/include/stdio.h | 17 +
tests/tcg/mips64el/system/include/string.h | 16 +
target/mips/cpu.c | 4 +
target/mips/gdbstub.c | 152 +++++-
target/mips/tcg/tx79_translate.c | 10 +-
tests/tcg/mips64el/system/harness.c | 66 +++
.../system}/test_r5900_div1.c | 0
.../system}/test_r5900_divu1.c | 0
.../system}/test_r5900_madd.c | 0
.../system}/test_r5900_maddu.c | 0
.../system}/test_r5900_mflohi1.c | 0
.../system}/test_r5900_mtlohi1.c | 0
.../system}/test_r5900_mult.c | 0
.../system}/test_r5900_multu.c | 0
tests/tcg/mips64el/system/test_r5900_tx79.c | 477 ++++++++++++++++++
target/mips/cpu-defs.c.inc | 45 ++
gdbstub/gdb-xml/mips32-cp0.xml | 9 +
gdbstub/gdb-xml/mips32-cpu.xml | 42 ++
gdbstub/gdb-xml/mips32-fpu.xml | 41 ++
gdbstub/gdb-xml/mips64-cp0.xml | 9 +
gdbstub/gdb-xml/mips64-cpu.xml | 42 ++
gdbstub/gdb-xml/mips64-fpu.xml | 41 ++
gdbstub/gdb-xml/mips64-r5900.xml | 47 ++
tests/guest-debug/run-test.py | 9 +-
tests/tcg/mips/user/isa/r5900/Makefile | 32 --
tests/tcg/mips/user/isa/r5900/README | 6 -
tests/tcg/mips64el/meson.build | 2 +
tests/tcg/mips64el/system/boot.S | 23 +
tests/tcg/mips64el/system/kernel.ld | 43 ++
tests/tcg/mips64el/system/meson.build | 62 +++
tests/tcg/mips64el/system/test-r5900.py | 30 ++
45 files changed, 1211 insertions(+), 49 deletions(-)
create mode 100644 tests/tcg/mips64el/system/include/assert.h
create mode 100644 tests/tcg/mips64el/system/include/inttypes.h
create mode 100644 tests/tcg/mips64el/system/include/stdio.h
create mode 100644 tests/tcg/mips64el/system/include/string.h
create mode 100644 tests/tcg/mips64el/system/harness.c
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_div1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_divu1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_madd.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_maddu.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mflohi1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mtlohi1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mult.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_multu.c (100%)
create mode 100644 tests/tcg/mips64el/system/test_r5900_tx79.c
create mode 100644 gdbstub/gdb-xml/mips32-cp0.xml
create mode 100644 gdbstub/gdb-xml/mips32-cpu.xml
create mode 100644 gdbstub/gdb-xml/mips32-fpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-cp0.xml
create mode 100644 gdbstub/gdb-xml/mips64-cpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-fpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-r5900.xml
delete mode 100644 tests/tcg/mips/user/isa/r5900/Makefile
delete mode 100644 tests/tcg/mips/user/isa/r5900/README
create mode 100644 tests/tcg/mips64el/system/boot.S
create mode 100644 tests/tcg/mips64el/system/kernel.ld
create mode 100644 tests/tcg/mips64el/system/meson.build
create mode 100644 tests/tcg/mips64el/system/test-r5900.py
Add R5900 system tests, code is covered, CPU can come back,
allowing to fix a bug on PCGT opcode.
Since [v1]:
- rebased
- added freestanding libc stubs
- o32/n32 tests
[v1]: https://lore.kernel.org/qemu-devel/20210214175912.732946-1-f4bug@amsat.org/
Philippe Mathieu-Daudé (9):
target/mips: Re-introduce the R5900 CPU in system mode
target/mips/tx79: Fix PCGT* (Parallel Compare for Greater Than)
tests/guest-debug: Allow placing the binary within system QEMU args
tests/tcg/mips64el: Add bare-metal harness for R5900 system tests
tests/tcg/mips64el: Move R5900 tests to system mode and build with
meson
target/mips: Factor mips_gdb_read_value() out
target/mips: Describe gdbstub registers with XML features
target/mips: Expose R5900 registers to gdb
tests/tcg/mips64el: Add a TX79 instruction test in system mode
MAINTAINERS | 1 +
configs/targets/mips-linux-user.mak | 1 +
configs/targets/mips-softmmu.mak | 1 +
configs/targets/mips64-linux-user.mak | 1 +
configs/targets/mips64-softmmu.mak | 1 +
configs/targets/mips64el-linux-user.mak | 1 +
configs/targets/mips64el-softmmu.mak | 1 +
configs/targets/mipsel-linux-user.mak | 1 +
configs/targets/mipsel-softmmu.mak | 1 +
configs/targets/mipsn32-linux-user.mak | 1 +
configs/targets/mipsn32el-linux-user.mak | 1 +
target/mips/internal.h | 2 +
tests/tcg/mips64el/system/include/assert.h | 15 +
tests/tcg/mips64el/system/include/inttypes.h | 7 +
tests/tcg/mips64el/system/include/stdio.h | 17 +
tests/tcg/mips64el/system/include/string.h | 16 +
target/mips/cpu.c | 4 +
target/mips/gdbstub.c | 152 +++++-
target/mips/tcg/tx79_translate.c | 10 +-
tests/tcg/mips64el/system/harness.c | 66 +++
.../system}/test_r5900_div1.c | 0
.../system}/test_r5900_divu1.c | 0
.../system}/test_r5900_madd.c | 0
.../system}/test_r5900_maddu.c | 0
.../system}/test_r5900_mflohi1.c | 0
.../system}/test_r5900_mtlohi1.c | 0
.../system}/test_r5900_mult.c | 0
.../system}/test_r5900_multu.c | 0
tests/tcg/mips64el/system/test_r5900_tx79.c | 477 ++++++++++++++++++
target/mips/cpu-defs.c.inc | 45 ++
gdbstub/gdb-xml/mips32-cp0.xml | 9 +
gdbstub/gdb-xml/mips32-cpu.xml | 42 ++
gdbstub/gdb-xml/mips32-fpu.xml | 41 ++
gdbstub/gdb-xml/mips64-cp0.xml | 9 +
gdbstub/gdb-xml/mips64-cpu.xml | 42 ++
gdbstub/gdb-xml/mips64-fpu.xml | 41 ++
gdbstub/gdb-xml/mips64-r5900.xml | 47 ++
tests/guest-debug/run-test.py | 9 +-
tests/tcg/mips/user/isa/r5900/Makefile | 32 --
tests/tcg/mips/user/isa/r5900/README | 6 -
tests/tcg/mips64el/meson.build | 2 +
tests/tcg/mips64el/system/boot.S | 23 +
tests/tcg/mips64el/system/kernel.ld | 43 ++
tests/tcg/mips64el/system/meson.build | 62 +++
tests/tcg/mips64el/system/test-r5900.py | 30 ++
45 files changed, 1211 insertions(+), 49 deletions(-)
create mode 100644 tests/tcg/mips64el/system/include/assert.h
create mode 100644 tests/tcg/mips64el/system/include/inttypes.h
create mode 100644 tests/tcg/mips64el/system/include/stdio.h
create mode 100644 tests/tcg/mips64el/system/include/string.h
create mode 100644 tests/tcg/mips64el/system/harness.c
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_div1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_divu1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_madd.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_maddu.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mflohi1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mtlohi1.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mult.c (100%)
rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_multu.c (100%)
create mode 100644 tests/tcg/mips64el/system/test_r5900_tx79.c
create mode 100644 gdbstub/gdb-xml/mips32-cp0.xml
create mode 100644 gdbstub/gdb-xml/mips32-cpu.xml
create mode 100644 gdbstub/gdb-xml/mips32-fpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-cp0.xml
create mode 100644 gdbstub/gdb-xml/mips64-cpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-fpu.xml
create mode 100644 gdbstub/gdb-xml/mips64-r5900.xml
delete mode 100644 tests/tcg/mips/user/isa/r5900/Makefile
delete mode 100644 tests/tcg/mips/user/isa/r5900/README
create mode 100644 tests/tcg/mips64el/system/boot.S
create mode 100644 tests/tcg/mips64el/system/kernel.ld
create mode 100644 tests/tcg/mips64el/system/meson.build
create mode 100644 tests/tcg/mips64el/system/test-r5900.py
--
2.55.0
On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
> Add R5900 system tests, code is covered, CPU can come back,
> allowing to fix a bug on PCGT opcode.
>
> Since [v1]:
> - rebased
> - added freestanding libc stubs
> - o32/n32 tests
>
> [v1]: https://lore.kernel.org/qemu-devel/20210214175912.732946-1-f4bug@amsat.org/
>
> Philippe Mathieu-Daudé (9):
> target/mips: Re-introduce the R5900 CPU in system mode
> target/mips/tx79: Fix PCGT* (Parallel Compare for Greater Than)
> tests/guest-debug: Allow placing the binary within system QEMU args
> tests/tcg/mips64el: Add bare-metal harness for R5900 system tests
> tests/tcg/mips64el: Move R5900 tests to system mode and build with
> meson
> target/mips: Factor mips_gdb_read_value() out
> target/mips: Describe gdbstub registers with XML features
> target/mips: Expose R5900 registers to gdb
> tests/tcg/mips64el: Add a TX79 instruction test in system mode
>
> MAINTAINERS | 1 +
> configs/targets/mips-linux-user.mak | 1 +
> configs/targets/mips-softmmu.mak | 1 +
> configs/targets/mips64-linux-user.mak | 1 +
> configs/targets/mips64-softmmu.mak | 1 +
> configs/targets/mips64el-linux-user.mak | 1 +
> configs/targets/mips64el-softmmu.mak | 1 +
> configs/targets/mipsel-linux-user.mak | 1 +
> configs/targets/mipsel-softmmu.mak | 1 +
> configs/targets/mipsn32-linux-user.mak | 1 +
> configs/targets/mipsn32el-linux-user.mak | 1 +
> target/mips/internal.h | 2 +
> tests/tcg/mips64el/system/include/assert.h | 15 +
> tests/tcg/mips64el/system/include/inttypes.h | 7 +
> tests/tcg/mips64el/system/include/stdio.h | 17 +
> tests/tcg/mips64el/system/include/string.h | 16 +
> target/mips/cpu.c | 4 +
> target/mips/gdbstub.c | 152 +++++-
> target/mips/tcg/tx79_translate.c | 10 +-
> tests/tcg/mips64el/system/harness.c | 66 +++
> .../system}/test_r5900_div1.c | 0
> .../system}/test_r5900_divu1.c | 0
> .../system}/test_r5900_madd.c | 0
> .../system}/test_r5900_maddu.c | 0
> .../system}/test_r5900_mflohi1.c | 0
> .../system}/test_r5900_mtlohi1.c | 0
> .../system}/test_r5900_mult.c | 0
> .../system}/test_r5900_multu.c | 0
> tests/tcg/mips64el/system/test_r5900_tx79.c | 477 ++++++++++++++++++
> target/mips/cpu-defs.c.inc | 45 ++
> gdbstub/gdb-xml/mips32-cp0.xml | 9 +
> gdbstub/gdb-xml/mips32-cpu.xml | 42 ++
> gdbstub/gdb-xml/mips32-fpu.xml | 41 ++
> gdbstub/gdb-xml/mips64-cp0.xml | 9 +
> gdbstub/gdb-xml/mips64-cpu.xml | 42 ++
> gdbstub/gdb-xml/mips64-fpu.xml | 41 ++
> gdbstub/gdb-xml/mips64-r5900.xml | 47 ++
> tests/guest-debug/run-test.py | 9 +-
> tests/tcg/mips/user/isa/r5900/Makefile | 32 --
> tests/tcg/mips/user/isa/r5900/README | 6 -
> tests/tcg/mips64el/meson.build | 2 +
> tests/tcg/mips64el/system/boot.S | 23 +
> tests/tcg/mips64el/system/kernel.ld | 43 ++
> tests/tcg/mips64el/system/meson.build | 62 +++
> tests/tcg/mips64el/system/test-r5900.py | 30 ++
> 45 files changed, 1211 insertions(+), 49 deletions(-)
> create mode 100644 tests/tcg/mips64el/system/include/assert.h
> create mode 100644 tests/tcg/mips64el/system/include/inttypes.h
> create mode 100644 tests/tcg/mips64el/system/include/stdio.h
> create mode 100644 tests/tcg/mips64el/system/include/string.h
> create mode 100644 tests/tcg/mips64el/system/harness.c
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_div1.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_divu1.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_madd.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_maddu.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mflohi1.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mtlohi1.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_mult.c (100%)
> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/test_r5900_multu.c (100%)
> create mode 100644 tests/tcg/mips64el/system/test_r5900_tx79.c
> create mode 100644 gdbstub/gdb-xml/mips32-cp0.xml
> create mode 100644 gdbstub/gdb-xml/mips32-cpu.xml
> create mode 100644 gdbstub/gdb-xml/mips32-fpu.xml
> create mode 100644 gdbstub/gdb-xml/mips64-cp0.xml
> create mode 100644 gdbstub/gdb-xml/mips64-cpu.xml
> create mode 100644 gdbstub/gdb-xml/mips64-fpu.xml
> create mode 100644 gdbstub/gdb-xml/mips64-r5900.xml
> delete mode 100644 tests/tcg/mips/user/isa/r5900/Makefile
> delete mode 100644 tests/tcg/mips/user/isa/r5900/README
> create mode 100644 tests/tcg/mips64el/system/boot.S
> create mode 100644 tests/tcg/mips64el/system/kernel.ld
> create mode 100644 tests/tcg/mips64el/system/meson.build
> create mode 100644 tests/tcg/mips64el/system/test-r5900.py
>
See some test failures, related to gdb:
https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/job/123131480244
Regards,
Pierrick
On 29/10/26 06:33, Pierrick Bouvier wrote:
> On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
>> Add R5900 system tests, code is covered, CPU can come back,
>> allowing to fix a bug on PCGT opcode.
>>
>> Since [v1]:
>> - rebased
>> - added freestanding libc stubs
>> - o32/n32 tests
>>
>> [v1]: https://lore.kernel.org/qemu-devel/20210214175912.732946-1-
>> f4bug@amsat.org/
>>
>> Philippe Mathieu-Daudé (9):
>> target/mips: Re-introduce the R5900 CPU in system mode
>> target/mips/tx79: Fix PCGT* (Parallel Compare for Greater Than)
>> tests/guest-debug: Allow placing the binary within system QEMU args
>> tests/tcg/mips64el: Add bare-metal harness for R5900 system tests
>> tests/tcg/mips64el: Move R5900 tests to system mode and build with
>> meson
>> target/mips: Factor mips_gdb_read_value() out
>> target/mips: Describe gdbstub registers with XML features
>> target/mips: Expose R5900 registers to gdb
>> tests/tcg/mips64el: Add a TX79 instruction test in system mode
>>
>> MAINTAINERS | 1 +
>> configs/targets/mips-linux-user.mak | 1 +
>> configs/targets/mips-softmmu.mak | 1 +
>> configs/targets/mips64-linux-user.mak | 1 +
>> configs/targets/mips64-softmmu.mak | 1 +
>> configs/targets/mips64el-linux-user.mak | 1 +
>> configs/targets/mips64el-softmmu.mak | 1 +
>> configs/targets/mipsel-linux-user.mak | 1 +
>> configs/targets/mipsel-softmmu.mak | 1 +
>> configs/targets/mipsn32-linux-user.mak | 1 +
>> configs/targets/mipsn32el-linux-user.mak | 1 +
>> target/mips/internal.h | 2 +
>> tests/tcg/mips64el/system/include/assert.h | 15 +
>> tests/tcg/mips64el/system/include/inttypes.h | 7 +
>> tests/tcg/mips64el/system/include/stdio.h | 17 +
>> tests/tcg/mips64el/system/include/string.h | 16 +
>> target/mips/cpu.c | 4 +
>> target/mips/gdbstub.c | 152 +++++-
>> target/mips/tcg/tx79_translate.c | 10 +-
>> tests/tcg/mips64el/system/harness.c | 66 +++
>> .../system}/test_r5900_div1.c | 0
>> .../system}/test_r5900_divu1.c | 0
>> .../system}/test_r5900_madd.c | 0
>> .../system}/test_r5900_maddu.c | 0
>> .../system}/test_r5900_mflohi1.c | 0
>> .../system}/test_r5900_mtlohi1.c | 0
>> .../system}/test_r5900_mult.c | 0
>> .../system}/test_r5900_multu.c | 0
>> tests/tcg/mips64el/system/test_r5900_tx79.c | 477 ++++++++++++++++++
>> target/mips/cpu-defs.c.inc | 45 ++
>> gdbstub/gdb-xml/mips32-cp0.xml | 9 +
>> gdbstub/gdb-xml/mips32-cpu.xml | 42 ++
>> gdbstub/gdb-xml/mips32-fpu.xml | 41 ++
>> gdbstub/gdb-xml/mips64-cp0.xml | 9 +
>> gdbstub/gdb-xml/mips64-cpu.xml | 42 ++
>> gdbstub/gdb-xml/mips64-fpu.xml | 41 ++
>> gdbstub/gdb-xml/mips64-r5900.xml | 47 ++
>> tests/guest-debug/run-test.py | 9 +-
>> tests/tcg/mips/user/isa/r5900/Makefile | 32 --
>> tests/tcg/mips/user/isa/r5900/README | 6 -
>> tests/tcg/mips64el/meson.build | 2 +
>> tests/tcg/mips64el/system/boot.S | 23 +
>> tests/tcg/mips64el/system/kernel.ld | 43 ++
>> tests/tcg/mips64el/system/meson.build | 62 +++
>> tests/tcg/mips64el/system/test-r5900.py | 30 ++
>> 45 files changed, 1211 insertions(+), 49 deletions(-)
>> create mode 100644 tests/tcg/mips64el/system/include/assert.h
>> create mode 100644 tests/tcg/mips64el/system/include/inttypes.h
>> create mode 100644 tests/tcg/mips64el/system/include/stdio.h
>> create mode 100644 tests/tcg/mips64el/system/include/string.h
>> create mode 100644 tests/tcg/mips64el/system/harness.c
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_div1.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_divu1.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_madd.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_maddu.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_mflohi1.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_mtlohi1.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_mult.c (100%)
>> rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
>> test_r5900_multu.c (100%)
>> create mode 100644 tests/tcg/mips64el/system/test_r5900_tx79.c
>> create mode 100644 gdbstub/gdb-xml/mips32-cp0.xml
>> create mode 100644 gdbstub/gdb-xml/mips32-cpu.xml
>> create mode 100644 gdbstub/gdb-xml/mips32-fpu.xml
>> create mode 100644 gdbstub/gdb-xml/mips64-cp0.xml
>> create mode 100644 gdbstub/gdb-xml/mips64-cpu.xml
>> create mode 100644 gdbstub/gdb-xml/mips64-fpu.xml
>> create mode 100644 gdbstub/gdb-xml/mips64-r5900.xml
>> delete mode 100644 tests/tcg/mips/user/isa/r5900/Makefile
>> delete mode 100644 tests/tcg/mips/user/isa/r5900/README
>> create mode 100644 tests/tcg/mips64el/system/boot.S
>> create mode 100644 tests/tcg/mips64el/system/kernel.ld
>> create mode 100644 tests/tcg/mips64el/system/meson.build
>> create mode 100644 tests/tcg/mips64el/system/test-r5900.py
>>
>
> See some test failures, related to gdb:
> https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/job/123131480244
Ah hmm I had similar failures due to too old gdb, I might have
missed to check the version in that container image. IIRC
Gustavo had similar problem with ARM I'll see how he fixed
that (I suppose check gdb version and skip the tests).
Thanks!
Hi Phil,
On Thu, Oct 29, 2026 at 06:39:49AM +0100, Philippe Mathieu-Daudé wrote:
> On 29/10/26 06:33, Pierrick Bouvier wrote:
> > On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
> > > Add R5900 system tests, code is covered, CPU can come back,
> > > allowing to fix a bug on PCGT opcode.
> > >
> > > Since [v1]:
> > > - rebased
> > > - added freestanding libc stubs
> > > - o32/n32 tests
> > >
> > > [v1]: https://lore.kernel.org/qemu-devel/20210214175912.732946-1-
> > > f4bug@amsat.org/
> > >
> > > Philippe Mathieu-Daudé (9):
> > > target/mips: Re-introduce the R5900 CPU in system mode
> > > target/mips/tx79: Fix PCGT* (Parallel Compare for Greater Than)
> > > tests/guest-debug: Allow placing the binary within system QEMU args
> > > tests/tcg/mips64el: Add bare-metal harness for R5900 system tests
> > > tests/tcg/mips64el: Move R5900 tests to system mode and build with
> > > meson
> > > target/mips: Factor mips_gdb_read_value() out
> > > target/mips: Describe gdbstub registers with XML features
> > > target/mips: Expose R5900 registers to gdb
> > > tests/tcg/mips64el: Add a TX79 instruction test in system mode
> > >
> > > MAINTAINERS | 1 +
> > > configs/targets/mips-linux-user.mak | 1 +
> > > configs/targets/mips-softmmu.mak | 1 +
> > > configs/targets/mips64-linux-user.mak | 1 +
> > > configs/targets/mips64-softmmu.mak | 1 +
> > > configs/targets/mips64el-linux-user.mak | 1 +
> > > configs/targets/mips64el-softmmu.mak | 1 +
> > > configs/targets/mipsel-linux-user.mak | 1 +
> > > configs/targets/mipsel-softmmu.mak | 1 +
> > > configs/targets/mipsn32-linux-user.mak | 1 +
> > > configs/targets/mipsn32el-linux-user.mak | 1 +
> > > target/mips/internal.h | 2 +
> > > tests/tcg/mips64el/system/include/assert.h | 15 +
> > > tests/tcg/mips64el/system/include/inttypes.h | 7 +
> > > tests/tcg/mips64el/system/include/stdio.h | 17 +
> > > tests/tcg/mips64el/system/include/string.h | 16 +
> > > target/mips/cpu.c | 4 +
> > > target/mips/gdbstub.c | 152 +++++-
> > > target/mips/tcg/tx79_translate.c | 10 +-
> > > tests/tcg/mips64el/system/harness.c | 66 +++
> > > .../system}/test_r5900_div1.c | 0
> > > .../system}/test_r5900_divu1.c | 0
> > > .../system}/test_r5900_madd.c | 0
> > > .../system}/test_r5900_maddu.c | 0
> > > .../system}/test_r5900_mflohi1.c | 0
> > > .../system}/test_r5900_mtlohi1.c | 0
> > > .../system}/test_r5900_mult.c | 0
> > > .../system}/test_r5900_multu.c | 0
> > > tests/tcg/mips64el/system/test_r5900_tx79.c | 477 ++++++++++++++++++
> > > target/mips/cpu-defs.c.inc | 45 ++
> > > gdbstub/gdb-xml/mips32-cp0.xml | 9 +
> > > gdbstub/gdb-xml/mips32-cpu.xml | 42 ++
> > > gdbstub/gdb-xml/mips32-fpu.xml | 41 ++
> > > gdbstub/gdb-xml/mips64-cp0.xml | 9 +
> > > gdbstub/gdb-xml/mips64-cpu.xml | 42 ++
> > > gdbstub/gdb-xml/mips64-fpu.xml | 41 ++
> > > gdbstub/gdb-xml/mips64-r5900.xml | 47 ++
> > > tests/guest-debug/run-test.py | 9 +-
> > > tests/tcg/mips/user/isa/r5900/Makefile | 32 --
> > > tests/tcg/mips/user/isa/r5900/README | 6 -
> > > tests/tcg/mips64el/meson.build | 2 +
> > > tests/tcg/mips64el/system/boot.S | 23 +
> > > tests/tcg/mips64el/system/kernel.ld | 43 ++
> > > tests/tcg/mips64el/system/meson.build | 62 +++
> > > tests/tcg/mips64el/system/test-r5900.py | 30 ++
> > > 45 files changed, 1211 insertions(+), 49 deletions(-)
> > > create mode 100644 tests/tcg/mips64el/system/include/assert.h
> > > create mode 100644 tests/tcg/mips64el/system/include/inttypes.h
> > > create mode 100644 tests/tcg/mips64el/system/include/stdio.h
> > > create mode 100644 tests/tcg/mips64el/system/include/string.h
> > > create mode 100644 tests/tcg/mips64el/system/harness.c
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_div1.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_divu1.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_madd.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_maddu.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_mflohi1.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_mtlohi1.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_mult.c (100%)
> > > rename tests/tcg/{mips/user/isa/r5900 => mips64el/system}/
> > > test_r5900_multu.c (100%)
> > > create mode 100644 tests/tcg/mips64el/system/test_r5900_tx79.c
> > > create mode 100644 gdbstub/gdb-xml/mips32-cp0.xml
> > > create mode 100644 gdbstub/gdb-xml/mips32-cpu.xml
> > > create mode 100644 gdbstub/gdb-xml/mips32-fpu.xml
> > > create mode 100644 gdbstub/gdb-xml/mips64-cp0.xml
> > > create mode 100644 gdbstub/gdb-xml/mips64-cpu.xml
> > > create mode 100644 gdbstub/gdb-xml/mips64-fpu.xml
> > > create mode 100644 gdbstub/gdb-xml/mips64-r5900.xml
> > > delete mode 100644 tests/tcg/mips/user/isa/r5900/Makefile
> > > delete mode 100644 tests/tcg/mips/user/isa/r5900/README
> > > create mode 100644 tests/tcg/mips64el/system/boot.S
> > > create mode 100644 tests/tcg/mips64el/system/kernel.ld
> > > create mode 100644 tests/tcg/mips64el/system/meson.build
> > > create mode 100644 tests/tcg/mips64el/system/test-r5900.py
> > >
> >
> > See some test failures, related to gdb:
> > https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/job/123131480244
>
> Ah hmm I had similar failures due to too old gdb, I might have
> missed to check the version in that container image. IIRC
> Gustavo had similar problem with ARM I'll see how he fixed
> that (I suppose check gdb version and skip the tests).
Hmm, I took a quick look at the failure, and it doesn't ring a bell.
It's also the first time I've looked at the
tests/tcg/multiarch/gdbstub/registers.py test, so let me take a closer look at
the test. If I find something, I'll report back here.
otoh, I'm happy my email filters are better now and I can easily catch when
somebody cc's me :)
Cheers,
Gustavo
On 29/10/26 06:39, Philippe Mathieu-Daudé wrote:
> On 29/10/26 06:33, Pierrick Bouvier wrote:
>> On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
>>> Add R5900 system tests, code is covered, CPU can come back,
>>> allowing to fix a bug on PCGT opcode.
>> See some test failures, related to gdb:
>> https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/
>> job/123131480244
>
> Ah hmm I had similar failures due to too old gdb, I might have
> missed to check the version in that container image. IIRC
> Gustavo had similar problem with ARM I'll see how he fixed
> that (I suppose check gdb version and skip the tests).
Found it, this is 'gdb_feat_version' :)
tests/tcg/meson.build=18=tcg_tests = {}
tests/tcg/meson.build-19-# tcg_tests is a dictionary with following
structure:
tests/tcg/meson.build-20-#
tests/tcg/meson.build-21-# {
tests/tcg/meson.build-22-# 'name_of_target': {
tests/tcg/meson.build-23-# 'cc': 'cross_compiler',
tests/tcg/meson.build-24-# 'cc_alt': ['list of alternative cross
compilers', ...]
tests/tcg/meson.build-25-# 'cc_dockerfile': 'name_of_dockerfile',
tests/tcg/meson.build-26-# 'cc_feat_cflags': {
tests/tcg/meson.build-27-# 'name': ['feature cflags'],
tests/tcg/meson.build-28-# ...
tests/tcg/meson.build-29-# },
tests/tcg/meson.build-30-# 'folder': 'folder_for_test_src_files',
tests/tcg/meson.build-31-# 'gdb_arch': 'gdb architecture requirement',
tests/tcg/meson.build:32:# 'gdb_feat_version': {
tests/tcg/meson.build-33-# 'name': ['minimal gdb version
supporting feature'],
tests/tcg/meson.build-34-# ...
tests/tcg/meson.build-35-# },
tests/tcg/meson.build-36-# 'qemu': emulators['qemu-...'],
tests/tcg/meson.build-37-# 'tests': [
tests/tcg/meson.build-38-# {
tests/tcg/meson.build-39-# 'src_file': {
tests/tcg/meson.build-40-# 'exe_name': ['provide an
alternative binary name'],
tests/tcg/meson.build-41-# 'test_name': ['provide an
alternative test name'],
tests/tcg/meson.build-42-# 'cflags': ['additional cflags to
compile test', ...],
tests/tcg/meson.build-43-# 'depends': [meson_dependency, ...],
tests/tcg/meson.build-44-# 'cc_feat': 'feature name, must be
present in cc_feat_cflags',
tests/tcg/meson.build-45-# 'qemu_args': ['qemu command line
flags', ...],
tests/tcg/meson.build-46-# 'expected_output':
'file_to_compare_output',
tests/tcg/meson.build-47-# 'gdb_test': ['gdb test args'],
tests/tcg/meson.build:48:# 'gdb_feat': ['feature name, must be
present in gdb_feat_version'],
tests/tcg/meson.build-49-# 'env_var': ['VAR=value', ...],
tests/tcg/meson.build-50-# 'wrapper': [program_to_launch_test,
'args'...],
tests/tcg/meson.build-51-# 'plugin_test': {
tests/tcg/meson.build-52-# 'plugin': 'plugin_name',
tests/tcg/meson.build-53-# 'args': ['plugin_args', ...],
tests/tcg/meson.build-54-# },
tests/tcg/meson.build-55-# }
tests/tcg/meson.build-56-# },
tests/tcg/meson.build-57-# ...
tests/tcg/meson.build-58-# ]
tests/tcg/meson.build-59-# }
tests/tcg/meson.build-60-# }
tests/tcg/meson.build=200=foreach target, plan: tcg_tests
tests/tcg/meson.build:518: if not
gdb_version.version_compare('>=' + gdb_feat_version[gdb_feat])
tests/tcg/meson.build-519- skip_test = 'gdb feature ' +
gdb_feat + ' not supported'
tests/tcg/meson.build-520- endif
tests/tcg/aarch64/meson.build:18:gdb_feat_version = {
tests/tcg/aarch64/meson.build-19- 'sme-tiles': '14.1',
tests/tcg/aarch64/meson.build-20- 'mte': '15.1',
tests/tcg/aarch64/meson.build-21- 'mte-baremetal': '16.0',
tests/tcg/aarch64/meson.build-22-}
tests/tcg/aarch64/meson.build=196=if 'qemu-aarch64' in emulators
tests/tcg/aarch64/meson.build-197- tcg_tests += {
tests/tcg/aarch64/meson.build-198- 'aarch64-linux-user': {
tests/tcg/aarch64/meson.build-199- 'cc': cc,
tests/tcg/aarch64/meson.build-200- 'cc_alt': cc_alt,
tests/tcg/aarch64/meson.build-201- 'cc_dockerfile': cc_dockerfile,
tests/tcg/aarch64/meson.build-202- 'cc_feat_cflags': cc_feat_cflags,
tests/tcg/aarch64/meson.build-203- 'folder': 'aarch64',
tests/tcg/aarch64/meson.build-204- 'gdb_arch': 'aarch64',
tests/tcg/aarch64/meson.build:205: 'gdb_feat_version':
gdb_feat_version,
tests/tcg/aarch64/meson.build-206- 'qemu': emulators['qemu-aarch64'],
tests/tcg/aarch64/meson.build-207- 'tests': tests,
tests/tcg/aarch64/meson.build-208- }
tests/tcg/aarch64/meson.build-209- }
On 10/28/26 10:46 PM, Philippe Mathieu-Daudé wrote: > On 29/10/26 06:39, Philippe Mathieu-Daudé wrote: >> On 29/10/26 06:33, Pierrick Bouvier wrote: >>> On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote: >>>> Add R5900 system tests, code is covered, CPU can come back, >>>> allowing to fix a bug on PCGT opcode. > > >>> See some test failures, related to gdb: >>> https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/ >>> job/123131480244 >> >> Ah hmm I had similar failures due to too old gdb, I might have >> missed to check the version in that container image. IIRC >> Gustavo had similar problem with ARM I'll see how he fixed >> that (I suppose check gdb version and skip the tests). > > Found it, this is 'gdb_feat_version' :) > That's the right way to deal with it indeed. That said, the gdb used in this test (on GitHub) comes from debian stable, which is fairly recent (16.3). Is a more recent version needed for complete mips support? If yes, I can update to the latest gdb so we can get full coverage on GitHub. Meanwhile, you can find which minimum version is needed. Regards, Pierrick
On 29/10/26 06:51, Pierrick Bouvier wrote:
> On 10/28/26 10:46 PM, Philippe Mathieu-Daudé wrote:
>> On 29/10/26 06:39, Philippe Mathieu-Daudé wrote:
>>> On 29/10/26 06:33, Pierrick Bouvier wrote:
>>>> On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
>>>>> Add R5900 system tests, code is covered, CPU can come back,
>>>>> allowing to fix a bug on PCGT opcode.
>>
>>
>>>> See some test failures, related to gdb:
>>>> https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/
>>>> job/123131480244
>>>
>>> Ah hmm I had similar failures due to too old gdb, I might have
>>> missed to check the version in that container image. IIRC
>>> Gustavo had similar problem with ARM I'll see how he fixed
>>> that (I suppose check gdb version and skip the tests).
>>
>> Found it, this is 'gdb_feat_version' :)
>>
> That's the right way to deal with it indeed.
>
> That said, the gdb used in this test (on GitHub) comes from debian
> stable, which is fairly recent (16.3).
>
> Is a more recent version needed for complete mips support?
> If yes, I can update to the latest gdb so we can get full coverage on
> GitHub. Meanwhile, you can find which minimum version is needed.
Indeed, the problem is simpler, located in the
tests/tcg/multiarch/gdbstub/registers.py.
Before there were no register descriptions for MIPS and the test was
skipping (registers with no names). Now it runs for real. Apparently
this is what commit 6ef164188d00 ("tests/tcg: finesse the registers
check for "hidden" regs") aimed to resolve but was a bit too
restrictive, this fixes it:
-- >8 --
diff --git a/tests/tcg/multiarch/gdbstub/registers.py
b/tests/tcg/multiarch/gdbstub/registers.py
index b3d13cb077f1..8d886413eb28 100644
--- a/tests/tcg/multiarch/gdbstub/registers.py
+++ b/tests/tcg/multiarch/gdbstub/registers.py
@@ -180,10 +180,13 @@ def complete_and_diff(reg_map):
for e in reg_map.values():
- if "initial" in e and "hidden" not in e:
+ if "initial" in e:
name = e["name"]
old_val = e["initial"]
try:
- new_val = frame.read_register(name)
+ if "hidden" in e:
+ new_val = frame.read_register(e["regnum"])
+ else:
+ new_val = frame.read_register(name)
except ValueError:
report(False, f"failed to read {name} at end of run")
---
Hi Phil,
On Thu, Oct 29, 2026 at 07:10:18AM +0100, Philippe Mathieu-Daudé wrote:
> On 29/10/26 06:51, Pierrick Bouvier wrote:
> > On 10/28/26 10:46 PM, Philippe Mathieu-Daudé wrote:
> > > On 29/10/26 06:39, Philippe Mathieu-Daudé wrote:
> > > > On 29/10/26 06:33, Pierrick Bouvier wrote:
> > > > > On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
> > > > > > Add R5900 system tests, code is covered, CPU can come back,
> > > > > > allowing to fix a bug on PCGT opcode.
> > >
> > >
> > > > > See some test failures, related to gdb:
> > > > > https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/
> > > > > job/123131480244
> > > >
> > > > Ah hmm I had similar failures due to too old gdb, I might have
> > > > missed to check the version in that container image. IIRC
> > > > Gustavo had similar problem with ARM I'll see how he fixed
> > > > that (I suppose check gdb version and skip the tests).
> > >
> > > Found it, this is 'gdb_feat_version' :)
> > >
> > That's the right way to deal with it indeed.
> >
> > That said, the gdb used in this test (on GitHub) comes from debian
> > stable, which is fairly recent (16.3).
> >
> > Is a more recent version needed for complete mips support?
> > If yes, I can update to the latest gdb so we can get full coverage on
> > GitHub. Meanwhile, you can find which minimum version is needed.
>
> Indeed, the problem is simpler, located in the
> tests/tcg/multiarch/gdbstub/registers.py.
>
> Before there were no register descriptions for MIPS and the test was
> skipping (registers with no names). Now it runs for real. Apparently
> this is what commit 6ef164188d00 ("tests/tcg: finesse the registers
> check for "hidden" regs") aimed to resolve but was a bit too
> restrictive, this fixes it:
>
> -- >8 --
> diff --git a/tests/tcg/multiarch/gdbstub/registers.py
> b/tests/tcg/multiarch/gdbstub/registers.py
> index b3d13cb077f1..8d886413eb28 100644
> --- a/tests/tcg/multiarch/gdbstub/registers.py
> +++ b/tests/tcg/multiarch/gdbstub/registers.py
> @@ -180,10 +180,13 @@ def complete_and_diff(reg_map):
>
> for e in reg_map.values():
> - if "initial" in e and "hidden" not in e:
> + if "initial" in e:
> name = e["name"]
> old_val = e["initial"]
>
> try:
> - new_val = frame.read_register(name)
> + if "hidden" in e:
> + new_val = frame.read_register(e["regnum"])
> + else:
> + new_val = frame.read_register(name)
> except ValueError:
> report(False, f"failed to read {name} at end of run")
> ---
>
ah, I was late for the party, you already found it :)
Reviewed-by: Gustavo Romero <gromero@redhat.com>
Cheers,
Gustavo
On 10/28/26 11:10 PM, Philippe Mathieu-Daudé wrote:
> On 29/10/26 06:51, Pierrick Bouvier wrote:
>> On 10/28/26 10:46 PM, Philippe Mathieu-Daudé wrote:
>>> On 29/10/26 06:39, Philippe Mathieu-Daudé wrote:
>>>> On 29/10/26 06:33, Pierrick Bouvier wrote:
>>>>> On 10/28/26 12:25 PM, Philippe Mathieu-Daudé wrote:
>>>>>> Add R5900 system tests, code is covered, CPU can come back,
>>>>>> allowing to fix a bug on PCGT opcode.
>>>
>>>
>>>>> See some test failures, related to gdb:
>>>>> https://github.com/p-b-o/qemu-ci/actions/runs/40776744817/
>>>>> job/123131480244
>>>>
>>>> Ah hmm I had similar failures due to too old gdb, I might have
>>>> missed to check the version in that container image. IIRC
>>>> Gustavo had similar problem with ARM I'll see how he fixed
>>>> that (I suppose check gdb version and skip the tests).
>>>
>>> Found it, this is 'gdb_feat_version' :)
>>>
>> That's the right way to deal with it indeed.
>>
>> That said, the gdb used in this test (on GitHub) comes from debian
>> stable, which is fairly recent (16.3).
>>
>> Is a more recent version needed for complete mips support?
>> If yes, I can update to the latest gdb so we can get full coverage on
>> GitHub. Meanwhile, you can find which minimum version is needed.
>
> Indeed, the problem is simpler, located in the
> tests/tcg/multiarch/gdbstub/registers.py.
>
> Before there were no register descriptions for MIPS and the test was
> skipping (registers with no names). Now it runs for real. Apparently
> this is what commit 6ef164188d00 ("tests/tcg: finesse the registers
> check for "hidden" regs") aimed to resolve but was a bit too
> restrictive, this fixes it:
>
> -- >8 --
> diff --git a/tests/tcg/multiarch/gdbstub/registers.py
> b/tests/tcg/multiarch/gdbstub/registers.py
> index b3d13cb077f1..8d886413eb28 100644
> --- a/tests/tcg/multiarch/gdbstub/registers.py
> +++ b/tests/tcg/multiarch/gdbstub/registers.py
> @@ -180,10 +180,13 @@ def complete_and_diff(reg_map):
>
> for e in reg_map.values():
> - if "initial" in e and "hidden" not in e:
> + if "initial" in e:
> name = e["name"]
> old_val = e["initial"]
>
> try:
> - new_val = frame.read_register(name)
> + if "hidden" in e:
> + new_val = frame.read_register(e["regnum"])
> + else:
> + new_val = frame.read_register(name)
> except ValueError:
> report(False, f"failed to read {name} at end of run")
> ---
Great. Let's add this patch in next version and ship this before the freeze!
Regards,
Pierrick
© 2016 - 2026 Red Hat, Inc.