History log of /openbmc/qemu/disas/ (Results 76 – 100 of 318)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
50fc094501-Nov-2022 Philippe Mathieu-Daudé <philmd@linaro.org>

disas/nanomips: Fix invalid PRIx64 format calling img_format()

Fix:

disas/nanomips.c:12231:62: warning: format specifies type 'char *' but the argument has type 'uint64' (aka 'unsigned long long'

disas/nanomips: Fix invalid PRIx64 format calling img_format()

Fix:

disas/nanomips.c:12231:62: warning: format specifies type 'char *' but the argument has type 'uint64' (aka 'unsigned long long') [-Wformat]
return img_format("RESTOREF 0x%" PRIx64 ", %s", u_value, count_value);
~~ ^~~~~~~~~~~
%llu

Fixes: 4066c152b3 ("disas/nanomips: Remove IMMEDIATE functions")
Reported-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221101114458.25756-3-philmd@linaro.org>

show more ...

04849c9401-Nov-2022 Philippe Mathieu-Daudé <philmd@linaro.org>

disas/nanomips: Fix invalid PRId64 format calling img_format()

Fix warnings such:

disas/nanomips.c:3251:64: warning: format specifies type 'char *' but the argument has type 'int64' (aka 'long lo

disas/nanomips: Fix invalid PRId64 format calling img_format()

Fix warnings such:

disas/nanomips.c:3251:64: warning: format specifies type 'char *' but the argument has type 'int64' (aka 'long long') [-Wformat]
return img_format("CACHE 0x%" PRIx64 ", %s(%s)", op_value, s_value, rs);
~~ ^~~~~~~
%lld

To avoid crashes such (kernel from commit f375ad6a0d):

$ qemu-system-mipsel -cpu I7200 -d in_asm -kernel generic_nano32r6el_page4k
...
----------------
IN: __bzero
0x805c6084: 20c4 6950 ADDU r13, a0, a2
0x805c6088: 9089 ADDIU a0, 1
Process 70261 stopped
* thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
frame #0: 0x00000001bfe38864 libsystem_platform.dylib`_platform_strlen + 4
libsystem_platform.dylib`:
-> 0x1bfe38864 <+4>: ldr q0, [x1]
0x1bfe38868 <+8>: adr x3, #-0xc8 ; ___lldb_unnamed_symbol314
0x1bfe3886c <+12>: ldr q2, [x3], #0x10
0x1bfe38870 <+16>: and x2, x0, #0xf
Target 0: (qemu-system-mipsel) stopped.
(lldb) bt
* thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
* frame #0: 0x00000001bfe38864 libsystem_platform.dylib`_platform_strlen + 4
frame #1: 0x00000001bfce76a0 libsystem_c.dylib`__vfprintf + 4544
frame #2: 0x00000001bfd158b4 libsystem_c.dylib`_vasprintf + 280
frame #3: 0x0000000101c22fb0 libglib-2.0.0.dylib`g_vasprintf + 28
frame #4: 0x0000000101bfb7d8 libglib-2.0.0.dylib`g_strdup_vprintf + 32
frame #5: 0x000000010000fb70 qemu-system-mipsel`img_format(format=<unavailable>) at nanomips.c:103:14 [opt]
frame #6: 0x0000000100018868 qemu-system-mipsel`SB_S9_(instruction=<unavailable>, info=<unavailable>) at nanomips.c:12616:12 [opt]
frame #7: 0x000000010000f90c qemu-system-mipsel`print_insn_nanomips at nanomips.c:589:28 [opt]

Fixes: 4066c152b3 ("disas/nanomips: Remove IMMEDIATE functions")
Reported-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221101114458.25756-2-philmd@linaro.org>

show more ...


/openbmc/qemu/.gitlab-ci.d/buildtest.yml
/openbmc/qemu/.gitlab-ci.d/cirrus/freebsd-12.vars
/openbmc/qemu/.gitlab-ci.d/cirrus/freebsd-13.vars
/openbmc/qemu/MAINTAINERS
/openbmc/qemu/accel/accel-softmmu.c
/openbmc/qemu/accel/dummy-cpus.c
/openbmc/qemu/accel/meson.build
/openbmc/qemu/accel/qtest/meson.build
/openbmc/qemu/accel/tcg/cpu-exec-common.c
/openbmc/qemu/accel/tcg/cpu-exec.c
/openbmc/qemu/accel/tcg/internal.h
/openbmc/qemu/accel/tcg/tb-maint.c
/openbmc/qemu/accel/tcg/translate-all.c
/openbmc/qemu/audio/audio.c
/openbmc/qemu/block.c
/openbmc/qemu/block/blkio.c
/openbmc/qemu/block/dmg.c
/openbmc/qemu/block/vvfat.c
/openbmc/qemu/bsd-user/host/i386/host-signal.h
/openbmc/qemu/bsd-user/host/x86_64/host-signal.h
/openbmc/qemu/configs/devices/mips-softmmu/common.mak
/openbmc/qemu/configure
/openbmc/qemu/contrib/plugins/Makefile
/openbmc/qemu/contrib/plugins/execlog.c
/openbmc/qemu/cpu.c
nanomips.c
/openbmc/qemu/docs/devel/testing.rst
/openbmc/qemu/docs/system/arm/cpu-features.rst
/openbmc/qemu/docs/system/loongarch/loongson3.rst
/openbmc/qemu/docs/system/ppc/ppce500.rst
/openbmc/qemu/docs/tools/virtiofsd.rst
/openbmc/qemu/gdb-xml/i386-32bit.xml
/openbmc/qemu/hw/arm/boot.c
/openbmc/qemu/hw/block/pflash_cfi01.c
/openbmc/qemu/hw/block/pflash_cfi02.c
/openbmc/qemu/hw/core/qdev.c
/openbmc/qemu/hw/i386/pc.c
/openbmc/qemu/hw/i386/pc_piix.c
/openbmc/qemu/hw/i386/x86.c
/openbmc/qemu/hw/ide/macio.c
/openbmc/qemu/hw/ide/piix.c
/openbmc/qemu/hw/intc/heathrow_pic.c
/openbmc/qemu/hw/intc/loongarch_extioi.c
/openbmc/qemu/hw/intc/openpic.c
/openbmc/qemu/hw/intc/trace-events
/openbmc/qemu/hw/isa/Kconfig
/openbmc/qemu/hw/isa/lpc_ich9.c
/openbmc/qemu/hw/isa/piix3.c
/openbmc/qemu/hw/isa/piix4.c
/openbmc/qemu/hw/loongarch/acpi-build.c
/openbmc/qemu/hw/loongarch/virt.c
/openbmc/qemu/hw/mips/bootloader.c
/openbmc/qemu/hw/mips/boston.c
/openbmc/qemu/hw/mips/fuloong2e.c
/openbmc/qemu/hw/mips/malta.c
/openbmc/qemu/hw/misc/macio/cuda.c
/openbmc/qemu/hw/misc/macio/gpio.c
/openbmc/qemu/hw/misc/macio/macio.c
/openbmc/qemu/hw/misc/macio/pmu.c
/openbmc/qemu/hw/net/e1000_regs.h
/openbmc/qemu/hw/nvme/ctrl.c
/openbmc/qemu/hw/nvme/nvme.h
/openbmc/qemu/hw/nvram/mac_nvram.c
/openbmc/qemu/hw/pci-host/grackle.c
/openbmc/qemu/hw/pci-host/uninorth.c
/openbmc/qemu/hw/ppc/Kconfig
/openbmc/qemu/hw/ppc/e500.c
/openbmc/qemu/hw/ppc/mac_newworld.c
/openbmc/qemu/hw/ppc/mac_oldworld.c
/openbmc/qemu/hw/ppc/meson.build
/openbmc/qemu/hw/ppc/pnv_core.c
/openbmc/qemu/hw/ppc/ppc.c
/openbmc/qemu/hw/ppc/ppc440_uc.c
/openbmc/qemu/hw/ppc/ppc4xx_devs.c
/openbmc/qemu/hw/ppc/ppc4xx_sdram.c
/openbmc/qemu/hw/ppc/spapr_hcall.c
/openbmc/qemu/hw/ppc/spapr_rtas.c
/openbmc/qemu/hw/ppc/trace-events
/openbmc/qemu/hw/s390x/css.c
/openbmc/qemu/hw/s390x/pv.c
/openbmc/qemu/hw/s390x/s390-pci-inst.c
/openbmc/qemu/hw/s390x/s390-virtio-ccw.c
/openbmc/qemu/hw/s390x/tod-kvm.c
/openbmc/qemu/hw/sd/sdhci-internal.h
/openbmc/qemu/hw/sd/sdhci.c
/openbmc/qemu/hw/usb/dev-mtp.c
/openbmc/qemu/hw/vfio/migration.c
/openbmc/qemu/hw/xen/meson.build
/openbmc/qemu/include/exec/exec-all.h
/openbmc/qemu/include/exec/memory.h
/openbmc/qemu/include/exec/translator.h
/openbmc/qemu/include/hw/core/cpu.h
/openbmc/qemu/include/hw/ide/piix.h
/openbmc/qemu/include/hw/loongarch/virt.h
/openbmc/qemu/include/hw/mips/bootloader.h
/openbmc/qemu/include/hw/misc/macio/macio.h
/openbmc/qemu/include/hw/nvram/mac_nvram.h
/openbmc/qemu/include/hw/pci-host/grackle.h
/openbmc/qemu/include/hw/pci-host/ls7a.h
/openbmc/qemu/include/hw/ppc/ppc4xx.h
/openbmc/qemu/include/hw/s390x/s390-virtio-ccw.h
/openbmc/qemu/include/qemu/async-teardown.h
/openbmc/qemu/include/qemu/main-loop.h
/openbmc/qemu/include/qemu/module.h
/openbmc/qemu/include/qemu/sockets.h
/openbmc/qemu/linux-user/hppa/cpu_loop.c
/openbmc/qemu/linux-user/strace.list
/openbmc/qemu/linux-user/syscall.c
/openbmc/qemu/meson.build
/openbmc/qemu/net/vhost-vdpa.c
/openbmc/qemu/os-posix.c
/openbmc/qemu/qapi/block-core.json
/openbmc/qemu/qapi/qom.json
/openbmc/qemu/qapi/virtio.json
/openbmc/qemu/qemu-options.hx
/openbmc/qemu/qga/qapi-schema.json
/openbmc/qemu/qom/object.c
/openbmc/qemu/scripts/feature_to_c.sh
/openbmc/qemu/scripts/nsis.py
/openbmc/qemu/semihosting/arm-compat-semi.c
/openbmc/qemu/softmmu/cpus.c
/openbmc/qemu/softmmu/qtest.c
/openbmc/qemu/target/alpha/helper.c
/openbmc/qemu/target/alpha/mem_helper.c
/openbmc/qemu/target/arm/helper.c
/openbmc/qemu/target/arm/op_helper.c
/openbmc/qemu/target/arm/ptw.c
/openbmc/qemu/target/arm/sve_helper.c
/openbmc/qemu/target/arm/tlb_helper.c
/openbmc/qemu/target/cris/helper.c
/openbmc/qemu/target/i386/helper.c
/openbmc/qemu/target/i386/helper.h
/openbmc/qemu/target/i386/kvm/kvm-stub.c
/openbmc/qemu/target/i386/kvm/kvm.c
/openbmc/qemu/target/i386/kvm/kvm_i386.h
/openbmc/qemu/target/i386/tcg/cc_helper.c
/openbmc/qemu/target/i386/tcg/sysemu/excp_helper.c
/openbmc/qemu/target/i386/tcg/sysemu/svm_helper.c
/openbmc/qemu/target/i386/tcg/translate.c
/openbmc/qemu/target/loongarch/cpu.c
/openbmc/qemu/target/loongarch/cpu.h
/openbmc/qemu/target/loongarch/insn_trans/trans_farith.c.inc
/openbmc/qemu/target/loongarch/insn_trans/trans_fcmp.c.inc
/openbmc/qemu/target/loongarch/insn_trans/trans_fmemory.c.inc
/openbmc/qemu/target/loongarch/insn_trans/trans_fmov.c.inc
/openbmc/qemu/target/loongarch/insn_trans/trans_privileged.c.inc
/openbmc/qemu/target/loongarch/iocsr_helper.c
/openbmc/qemu/target/loongarch/tlb_helper.c
/openbmc/qemu/target/loongarch/translate.c
/openbmc/qemu/target/m68k/op_helper.c
/openbmc/qemu/target/m68k/qregs.h.inc
/openbmc/qemu/target/m68k/translate.c
/openbmc/qemu/target/microblaze/helper.c
/openbmc/qemu/target/mips/cpu-defs.c.inc
/openbmc/qemu/target/mips/cpu.c
/openbmc/qemu/target/mips/tcg/octeon.decode
/openbmc/qemu/target/mips/tcg/translate.c
/openbmc/qemu/target/nios2/op_helper.c
/openbmc/qemu/target/openrisc/sys_helper.c
/openbmc/qemu/target/ppc/cpu.c
/openbmc/qemu/target/ppc/cpu.h
/openbmc/qemu/target/ppc/cpu_init.c
/openbmc/qemu/target/ppc/excp_helper.c
/openbmc/qemu/target/ppc/fpu_helper.c
/openbmc/qemu/target/ppc/helper.h
/openbmc/qemu/target/ppc/helper_regs.c
/openbmc/qemu/target/ppc/insn32.decode
/openbmc/qemu/target/ppc/int_helper.c
/openbmc/qemu/target/ppc/misc_helper.c
/openbmc/qemu/target/ppc/mmu-radix64.c
/openbmc/qemu/target/ppc/power8-pmu.c
/openbmc/qemu/target/ppc/power8-pmu.h
/openbmc/qemu/target/ppc/translate.c
/openbmc/qemu/target/ppc/translate/processor-ctrl-impl.c.inc
/openbmc/qemu/target/ppc/translate/vmx-impl.c.inc
/openbmc/qemu/target/ppc/translate/vmx-ops.c.inc
/openbmc/qemu/target/ppc/translate/vsx-impl.c.inc
/openbmc/qemu/target/ppc/translate/vsx-ops.c.inc
/openbmc/qemu/target/s390x/tcg/excp_helper.c
/openbmc/qemu/target/s390x/tcg/insn-data.h.inc
/openbmc/qemu/target/s390x/tcg/insn-format.h.inc
/openbmc/qemu/target/s390x/tcg/translate.c
/openbmc/qemu/target/s390x/tcg/translate_vx.c.inc
/openbmc/qemu/target/tricore/csfr.h.inc
/openbmc/qemu/target/tricore/op_helper.c
/openbmc/qemu/target/tricore/translate.c
/openbmc/qemu/target/xtensa/helper.c
/openbmc/qemu/tcg/sparc64/tcg-target-con-set.h
/openbmc/qemu/tcg/sparc64/tcg-target-con-str.h
/openbmc/qemu/tcg/sparc64/tcg-target.c.inc
/openbmc/qemu/tcg/sparc64/tcg-target.h
/openbmc/qemu/tcg/tcg.c
/openbmc/qemu/tests/avocado/boot_linux.py
/openbmc/qemu/tests/avocado/boot_linux_console.py
/openbmc/qemu/tests/avocado/info_usernet.py
/openbmc/qemu/tests/avocado/vnc.py
/openbmc/qemu/tests/docker/dockerfiles/alpine.docker
/openbmc/qemu/tests/docker/dockerfiles/centos8.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-all-test-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-amd64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-amd64.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-arm64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-armel-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-armhf-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-hexagon-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-mips64el-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-mipsel-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-ppc64el-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/debian-s390x-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/fedora-win32-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/fedora-win64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/fedora.docker
/openbmc/qemu/tests/docker/dockerfiles/opensuse-leap.docker
/openbmc/qemu/tests/docker/dockerfiles/ubuntu2004.docker
/openbmc/qemu/tests/docker/test-mingw
/openbmc/qemu/tests/lcitool/libvirt-ci
/openbmc/qemu/tests/lcitool/projects/qemu.yml
/openbmc/qemu/tests/lcitool/refresh
/openbmc/qemu/tests/qtest/cxl-test.c
/openbmc/qemu/tests/qtest/dbus-vmstate-test.c
/openbmc/qemu/tests/qtest/device-plug-test.c
/openbmc/qemu/tests/qtest/e1000e-test.c
/openbmc/qemu/tests/qtest/libqmp.c
/openbmc/qemu/tests/qtest/libqos/e1000e.c
/openbmc/qemu/tests/qtest/libqos/meson.build
/openbmc/qemu/tests/qtest/libqtest.c
/openbmc/qemu/tests/qtest/libqtest.h
/openbmc/qemu/tests/qtest/migration-test.c
/openbmc/qemu/tests/qtest/tpm-crb-swtpm-test.c
/openbmc/qemu/tests/qtest/tpm-tis-device-swtpm-test.c
/openbmc/qemu/tests/qtest/tpm-tis-swtpm-test.c
/openbmc/qemu/tests/qtest/tpm-util.c
/openbmc/qemu/tests/qtest/tpm-util.h
/openbmc/qemu/tests/tcg/multiarch/Makefile.target
/openbmc/qemu/tests/tcg/multiarch/munmap-pthread.c
/openbmc/qemu/tests/tcg/nios2/10m50-ghrd.ld
/openbmc/qemu/tests/tcg/nios2/Makefile.softmmu-target
/openbmc/qemu/tests/tcg/s390x/Makefile.target
/openbmc/qemu/tests/tcg/s390x/vistr.c
/openbmc/qemu/tests/tcg/sh4/Makefile.target
/openbmc/qemu/tests/unit/test-io-channel-command.c
/openbmc/qemu/tests/vm/basevm.py
/openbmc/qemu/tests/vm/freebsd
/openbmc/qemu/tests/vm/openbsd
/openbmc/qemu/ui/console.c
/openbmc/qemu/util/aio-win32.c
/openbmc/qemu/util/async-teardown.c
/openbmc/qemu/util/log.c
/openbmc/qemu/util/main-loop.c
/openbmc/qemu/util/meson.build
/openbmc/qemu/util/module.c
/openbmc/qemu/util/osdep.c
a6d89b4514-Oct-2022 David Daney <david.daney@fungible.com>

disas/mips: Fix branch displacement for BEQZC and BNEZC

disas/mips.c got added in commit 6643d27ea0 ("MIPS disas support")
apparently based on binutils tag 'gdb_6_1-branchpoint' [1].
Back then, MIPS

disas/mips: Fix branch displacement for BEQZC and BNEZC

disas/mips.c got added in commit 6643d27ea0 ("MIPS disas support")
apparently based on binutils tag 'gdb_6_1-branchpoint' [1].
Back then, MIPSr6 was not supported (added in binutils commit
7361da2c952 during 2014 [2]).

Binutils codebase diverged so much over the last 18 years, it is
not possible to simply cherry-pick their changes, so fix it BEQZC /
BNEZC 21-bit signed branch displacement locally.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=opcodes/mips-dis.c;hb=refs/tags/gdb_6_1-branchpoint
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7361da2c952

Fixes: 31837be3ee ("target-mips: add compact and CP1 branches")
Signed-off-by: David Daney <david.daney@fungible.com>
Reviewed-by: Marcin Nowakowski <marcin.nowakowski@fungible.com>
[PMD: Added commit description]
Signed-off-by: Philippe Mathieu-Daudé <philmd@fungible.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221014112322.61119-1-philmd@fungible.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

2413e00012-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Rename nanomips.cpp to nanomips.c

Now that everything has been converted to C code the nanomips.cpp file
has been renamed. Therefore, meson.build file is also changed.

Signed-off-by

disas/nanomips: Rename nanomips.cpp to nanomips.c

Now that everything has been converted to C code the nanomips.cpp file
has been renamed. Therefore, meson.build file is also changed.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-25-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

a0fee12912-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove argument passing by ref

Replaced argument passing by reference with passing by address.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth

disas/nanomips: Remove argument passing by ref

Replaced argument passing by reference with passing by address.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-24-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

e8ba8ef812-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Replace Cpp enums for C enums

Change enums to typedef enums to keep naming clear.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth@redha

disas/nanomips: Replace Cpp enums for C enums

Change enums to typedef enums to keep naming clear.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-23-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

39399c3812-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Replace exception handling

Since there's no support for exception handling in C, the try-catch
blocks have been deleted, and throw clauses are replaced. When a runtime
error happens,

disas/nanomips: Replace exception handling

Since there's no support for exception handling in C, the try-catch
blocks have been deleted, and throw clauses are replaced. When a runtime
error happens, we're printing out the error message. Disassembling of
the current instruction interrupts. This behavior is achieved by adding
sigsetjmp() to discard further disassembling after the error message
prints and by adding the siglongjmp() function to imitate throwing an
error. The goal was to maintain the same output as it was.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-22-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

3f2aec0712-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Expand Dis_info struct

This patch expands the Dis_info struct, which should hold the
necessary data for handling runtime errors. Fields fprintf_func and
stream are in charge of error

disas/nanomips: Expand Dis_info struct

This patch expands the Dis_info struct, which should hold the
necessary data for handling runtime errors. Fields fprintf_func and
stream are in charge of error printing. Field buf enables the use of
sigsetjmp() and siglongjmp() functions. Support for runtime error
handling will be added later.

We're filling Dis_info at the entrance of the nanoMIPS disassembler,
i.e. print_insn_nanomips. Next, we're adding that information as an
argument wherever we need to.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-21-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

49ec1c9812-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove function overloading

Disassemble function that calls the other variant of it is deleted.
Where it is called, now we're directly calling the other implementation.

Signed-off-b

disas/nanomips: Remove function overloading

Disassemble function that calls the other variant of it is deleted.
Where it is called, now we're directly calling the other implementation.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-20-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

22e7b52a12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Prevent memory leaking

g_autofree attribute is added for every dynamically allocated string to
prevent memory leaking.

The implementation of the several functions that work with dyn

disas/nanomips: Prevent memory leaking

g_autofree attribute is added for every dynamically allocated string to
prevent memory leaking.

The implementation of the several functions that work with dynamically
allocated strings is slightly changed so we can add those attributes.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-19-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

043dc73c12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove CPR function

CPR functions has been removed.

Before this patch, we'd been calling img_format twice, the first time
through the CPR function to get an appropriate string and t

disas/nanomips: Remove CPR function

CPR functions has been removed.

Before this patch, we'd been calling img_format twice, the first time
through the CPR function to get an appropriate string and the second
time to print that formatted string. There's no more need for that.
Therefore, calls to CPR are removed, and now we're directly printing
"CP" and integer value instead.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-18-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

4066c15212-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove IMMEDIATE functions

Both versions of IMMEDIATE functions have been removed.

Before this patch, we'd been calling img_format twice, the first time
through the IMMEDIATE to get

disas/nanomips: Remove IMMEDIATE functions

Both versions of IMMEDIATE functions have been removed.

Before this patch, we'd been calling img_format twice, the first time
through the IMMEDIATE to get an appropriate string and the second time
to print that string. There's no more need for that. Therefore, calls to
IMMEDIATE are removed, and now we're directly printing the integer
values instead.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-17-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

7def8a4b12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Replace std::string type

The return type of typedef disassembly_function is changed to char *
instead of std::string. Therefore, for every particular
disassembly_function function si

disas/nanomips: Replace std::string type

The return type of typedef disassembly_function is changed to char *
instead of std::string. Therefore, for every particular
disassembly_function function signature is changed.
For example:
- static std::string ABS_D(uint64 instruction, img_address m_pc) {...}
is replaced with
- static char *ABS_D(uint64 instruction, img_address m_pc) {...}

Every helper function used to return std::string is changed to return
const char * or char *. Where the return value points to a static string
that the caller must not free, the return type is const char *. If a
function allocates memory and the caller is required to free it, the
return type is a char *. This applies to the following functions:
img_format, to_string, GPR, save_restore_list, FPR, etc.

Now that we replaced every std::string for const char * or char *, it is
possible to delete multiple versions of the img_format function. The
general version:
- static char *img_format(const char *format, ...) {...}
can handle all string formatting, so others have been deleted.

Where necessary, strings are dynamically allocated with g_strjoinv,
g_strdup, g_strdup_vprintf, and g_strdup_printf. Memory leaking will be
prevented later.

String concatenation in the save_restore_list() function is handled
using g_strjoinv() function instead of += operator.

The type of the "dis" parameter in the Disassemble function is changed
- from std::string &
- to char **

Without applying all of these changes, the nanomips disassembler may be
buildable but can't produce the appropriate output, so all of them are
made together.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-16-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

afc47e0712-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Delete wrapper functions

Following functions just wrap the decode_gpr_gpr3() function:
- encode_rs3_and_check_rs3_ge_rt3()
- encode_rs3_and_check_rs3_lt_rt3()
Therefore those have be

disas/nanomips: Delete wrapper functions

Following functions just wrap the decode_gpr_gpr3() function:
- encode_rs3_and_check_rs3_ge_rt3()
- encode_rs3_and_check_rs3_lt_rt3()
Therefore those have been deleted. Calls to these two functions have
been replaced with calls to decode_gpr_gpr3.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-15-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

b5cc052812-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Delete copy functions

Functions that have just one parameter and simply return it have been
deleted. Calls to these functions have been replaced with the argument
itself.

We're dele

disas/nanomips: Delete copy functions

Functions that have just one parameter and simply return it have been
deleted. Calls to these functions have been replaced with the argument
itself.

We're deleting following functions:
- both versions of copy()
- encode_s_from_address()
- encode_u_from_address()
- encode_lsb_from_pos_and_size()

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-14-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

912c95b412-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove #include <sstream>

<sstream> is a C++ library and it's not used by disassembler.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth

disas/nanomips: Remove #include <sstream>

<sstream> is a C++ library and it's not used by disassembler.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-13-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

1a1cc52a12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Delete nanomips.h

Header file nanomips.h has been deleted for the nanomips disassembler to
stay consistent with the rest of the disassemblers which don't include
extra header files.

disas/nanomips: Delete nanomips.h

Header file nanomips.h has been deleted for the nanomips disassembler to
stay consistent with the rest of the disassemblers which don't include
extra header files.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-12-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...


f1cb3bdb12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Move typedefs etc to nanomips.cpp

The following is moved from the nanomips.h to nanomips.cpp file:
- #include line
- typedefs
- enums
- definition of the Pool struct.
Header file nan

disas/nanomips: Move typedefs etc to nanomips.cpp

The following is moved from the nanomips.h to nanomips.cpp file:
- #include line
- typedefs
- enums
- definition of the Pool struct.
Header file nanomips.h will be deleted to be consistent with the rest of
the disas/ code.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-11-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

beebf65b12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove NMD class

NMD class has been deleted. The following methods are now declared as
static functions:
- public NMD::Disassemble method
- private NMD::Disassemble method
- private

disas/nanomips: Remove NMD class

NMD class has been deleted. The following methods are now declared as
static functions:
- public NMD::Disassemble method
- private NMD::Disassemble method
- private NMD::extract_op_code_value helper method

Also, the implementation of the print_insn_nanomips function and
nanomips_dis function is moved to the end of the nanomips.cpp file,
right after the implementation of the Disassemble function.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-10-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

a146549012-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove Pool tables from the class

Pool tables are no longer declared as static fields of the NMD
class but as global static const variables. Pool struct is defined
outside of the cla

disas/nanomips: Remove Pool tables from the class

Pool tables are no longer declared as static fields of the NMD
class but as global static const variables. Pool struct is defined
outside of the class.

The NMD::Disassemble method is using the MAJOR Pool table variable, so
its implementation is moved to the end of the nanomips.cpp file,
right after the initialization of the MAJOR Pool table.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-9-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

8d416f6b12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove disasm methods from class

NMD class methods with the disassembly_function type like
NMD::ABS_D, NMD::ABS_S, etc. are removed from the class. They're now
declared global static

disas/nanomips: Remove disasm methods from class

NMD class methods with the disassembly_function type like
NMD::ABS_D, NMD::ABS_S, etc. are removed from the class. They're now
declared global static functions. Therefore, typedef of the function
pointer, disassembly_function is defined outside of the class.

Now that disassembly_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-8-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

655fc22f12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove __cond methods from class

NMD class methods with the conditional_function type like
NMD::ADDIU_32__cond, NMD::ADDIU_RS5__cond, etc. are removed from the NMD
class. They're now

disas/nanomips: Remove __cond methods from class

NMD class methods with the conditional_function type like
NMD::ADDIU_32__cond, NMD::ADDIU_RS5__cond, etc. are removed from the NMD
class. They're now declared global static functions. Therefore, typedef
of the function pointer, conditional_function is defined outside of the
class.

Now that conditional_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-7-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

2dc0c17512-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Remove helper methods from class

Helper methods from NMD class like NMD::renumber_registers,
NMD::decode_gpr_gpr4... etc. are removed from the class. They're now
declared global stat

disas/nanomips: Remove helper methods from class

Helper methods from NMD class like NMD::renumber_registers,
NMD::decode_gpr_gpr4... etc. are removed from the class. They're now
declared global static functions.

Following helper methods have been deleted because they're not used by
the nanomips disassembler:
- NMD::encode_msbd_from_pos_and_size,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy

Global functions used by those methods:
- nanomips_dis
- sign_extend
- extract_bits
have also been defined as static global functions.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-6-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

9972c8fa12-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Delete NMD class second field

We're deleting the m_pc field of the NMD class. It's now part of the
Dis_info struct that this patch introduces. Currently, the Dis_info
struct has just

disas/nanomips: Delete NMD class second field

We're deleting the m_pc field of the NMD class. It's now part of the
Dis_info struct that this patch introduces. Currently, the Dis_info
struct has just one field, m_pc, which we need for address calculation
in the ADDRESS function.

We're filling Dis_info at the entrance of the nanoMIPS disassembler.
I.e. print_insn_nanomips. Next, we're adding that information as an
argument wherever we need to.

Since NMD class now has no more fields, the NMD constructor is
also deleted.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-5-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

0c2a3b4312-Sep-2022 Milica Lazarevic <milica.lazarevic@syrmia.com>

disas/nanomips: Delete NMD class field

The m_requested_instruction_categories field always has the same value,
ALL_ATTRIBUTES. The only use of that field is within the if statement.
When replaced wi

disas/nanomips: Delete NMD class field

The m_requested_instruction_categories field always has the same value,
ALL_ATTRIBUTES. The only use of that field is within the if statement.
When replaced with a specific value, the if statement is always false,
so it has been removed.

Now, when the only use of the m_requested_instruction_categories field
is removed, we can delete the field declaration and initialization in
the NMD class. Also, we're changing the way of the construction of the
NMD object in the nanomips_dis function.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-4-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

show more ...

12345678910>>...13