On integrating LoongArch EDK2 firmware into QEMU build process

2023-03-30 Thread WANG Xuerui
Hi, Recently there are reportedly increased general interest in trying out LoongArch on top of QEMU, among both end users and organizations; and the EDK2 firmware port is fully upstreamed since the stable202211 version, and a build suitable for QEMU is already possible with Platform/Loongson/

Re: [PATCH v2 03/10] target/loongarch: Disassemble pcadd* addresses

2023-01-22 Thread WANG Xuerui
(-) Reviewed-by: WANG Xuerui Thanks!

Re: [PATCH v2 09/10] tcg/loongarch64: Use tcg_pcrel_diff in tcg_out_ldst

2023-01-22 Thread WANG Xuerui
, 0, 12); if (offset != imm12) { -intptr_t diff = offset - (uintptr_t)s->code_ptr; +intptr_t diff = tcg_pcrel_diff(s, (void *)offset); if (addr == TCG_REG_ZERO && diff == (int32_t)diff) { imm12 = sextreg(diff, 0, 12); Reviewed-by:

Re: [PATCH v2 02/10] target/loongarch: Disassemble jirl properly

2023-01-22 Thread WANG Xuerui
.. @offs26 beq 0101 10 . . @rr_offs16 Reviewed-by: WANG Xuerui Thanks for the catch!

Re: [PATCH v2 04/10] tcg/loongarch64: Optimize immediate loading

2023-01-22 Thread WANG Xuerui
c | 35 +++- 1 file changed, 12 insertions(+), 23 deletions(-) Reviewed-by: WANG Xuerui Thanks!

Re: [PATCH v2 08/10] tcg/loongarch64: Implement movcond

2023-01-22 Thread WANG Xuerui
deletions(-) Reviewed-by: WANG Xuerui

Re: [PATCH v2 05/10] tcg/loongarch64: Update tcg-insn-defs.c.inc

2023-01-22 Thread WANG Xuerui
t sk16) +{ +tcg_out32(s, encode_djsk16_insn(OPC_ADDU16I_D, d, j, sk16)); +} + /* Emits the `lu12i.w d, sj20` instruction. */ static void __attribute__((unused)) tcg_out_opc_lu12i_w(TCGContext *s, TCGReg d, int32_t sj20) Reviewed-by: WANG Xuerui

Re: [PATCH v2 00/10] tcg/loongarch64: Reorg goto_tb and cleanups

2023-01-22 Thread WANG Xuerui
Hi, On 1/18/23 09:11, Richard Henderson wrote: Based-on: 20230117231051.35-1-richard.hender...@linaro.org ("[PULL 00/22] tcg patch queue") Includes: * Disassembler from target/loongarch/. * Improvements to movi by Rui Wang, with minor tweaks. * Improvements to setcond. * Impleme

Re: [PATCH v2 01/10] target/loongarch: Enable the disassembler for host tcg

2023-01-22 Thread WANG Xuerui
'iocsr_helper.c', )) +common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen]) + loongarch_ss.add_all(when: 'CONFIG_TCG', if_true: [loongarch_tcg_ss]) target_arch += {'loongarch': loongarch_ss} Apart from the minor suggestion above, Reviewed-by: WANG Xuerui Thanks!

Re: [PATCH v2 06/10] tcg/loongarch64: Introduce tcg_out_addi

2023-01-23 Thread WANG Xuerui
efits. Reviewed-by: WANG Xuerui

Re: [PATCH v2 07/10] tcg/loongarch64: Improve setcond expansion

2023-01-23 Thread WANG Xuerui
Henderson --- tcg/loongarch64/tcg-target.c.inc | 165 +-- 1 file changed, 115 insertions(+), 50 deletions(-) Reviewed-by: WANG Xuerui Thanks!

Re: [PATCH v2 10/10] tcg/loongarch64: Reorg goto_tb implementation

2023-01-23 Thread WANG Xuerui
| 72 ++-- 2 files changed, 33 insertions(+), 46 deletions(-) I've tested this on my 3A5000 box and things seem to work, thanks. Reviewed-by: WANG Xuerui

Re: [PATCH] linux-user: Add support for LoongArch64's old world ABI

2023-01-23 Thread WANG Xuerui
On 1/23/23 18:47, Peter Maydell wrote: On Mon, 23 Jan 2023 at 10:27, WANG Xuerui wrote: From: WANG Xuerui This patch adds a "loongarch64ow-linux-user" target and a corresponding "qemu-loongarch64ow" binary, for supporting user-mode emulation of old-world LoongArch appl

[PATCH] linux-user: Add support for LoongArch64's old world ABI

2023-01-23 Thread WANG Xuerui
From: WANG Xuerui This patch adds a "loongarch64ow-linux-user" target and a corresponding "qemu-loongarch64ow" binary, for supporting user-mode emulation of old-world LoongArch applications in the wild. Although the old-world LoongArch is already being (slowly) phased out,

Re: [PATCH v10 04/26] target/loongarch: Add fixed point arithmetic instruction translation

2021-11-12 Thread WANG Xuerui
On 11/12/21 22:05, Richard Henderson wrote: On 11/12/21 7:53 AM, Song Gao wrote: +# +# Fields +# +%rd  0:5 +%rj  5:5 +%rk  10:5 +%sa2 15:2 +%si12    10:s12 +%ui12    10:12 +%si16    10:s16 +%si20    5:s20 You should only create separate field definitions like this when they ar

[PATCH v7 04/31] tcg/loongarch64: Add generated instruction opcodes and encoding helpers

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Acked-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 979 1 file changed, 979 insertions(+) create mode 100644 tcg/loongarch64/tcg-insn-defs.c.inc diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc b/tcg/loongarch64/tcg

[PATCH v7 00/31] LoongArch64 port of QEMU TCG

2021-11-22 Thread WANG Xuerui
0n.name/ v5: https://patchew.org/QEMU/20210924172527.904294-1-...@xen0n.name/ v4: https://patchew.org/QEMU/20210923165939.729081-1-...@xen0n.name/ v3: https://patchew.org/QEMU/20210922180927.666273-1-...@xen0n.name/ v2: https://patchew.org/QEMU/20210921201915.601245-1-...@xen0n.name/ v1:

[PATCH v7 03/31] tcg/loongarch64: Add the tcg-target.h file

2021-11-22 Thread WANG Xuerui
Support for all optional TCG ops are initially marked disabled; the bits are to be set in individual commits later. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.h | 180 +++ 1 file

[PATCH v7 02/31] MAINTAINERS: Add tcg/loongarch64 entry with myself as maintainer

2021-11-22 Thread WANG Xuerui
I ported the initial code, so I should maintain it of course. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d3879aa3c1..a638fb6b31 100644

[PATCH v7 01/31] elf: Add machine type value for LoongArch

2021-11-22 Thread WANG Xuerui
-gdb.git;a=commit;h=01a8c731aacbdbed0eb5682d13cc074dc7e25fb3 Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/elf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/elf.h b/include/elf.h index 811bf4a1cb..3a4bcb646a 100644 --- a

[PATCH v7 07/31] tcg/loongarch64: Implement necessary relocation operations

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 66 1 file changed, 66 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 64e57bd055..fbacaef862 100644 --- a/tcg

[PATCH v7 09/31] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 137 +++ 1 file changed, 137 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index

[PATCH v7 05/31] tcg/loongarch64: Add register names, allocation order and input/output sets

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 118 +++ 1 file changed, 118 insertions(+) create mode 100644 tcg/loongarch64/tcg-target.c.inc diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg

[PATCH v7 06/31] tcg/loongarch64: Define the operand constraints

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-str.h | 28 +++ tcg/loongarch64/tcg-target.c.inc | 52 2 files changed, 80 insertions(+) create mode 100644 tcg

[PATCH v7 16/31] tcg/loongarch64: Implement shl/shr/sar/rotl/rotr ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 91 tcg/loongarch64/tcg-target.h | 4 +- 3 files changed, 94 insertions

[PATCH v7 17/31] tcg/loongarch64: Implement add/sub ops

2021-11-22 Thread WANG Xuerui
The neg_i{32,64} ops is fully expressible with sub, so omitted for simplicity. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 2 ++ tcg/loongarch64/tcg-target.c.inc | 38

[PATCH v7 11/31] tcg/loongarch64: Implement sign-/zero-extension ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 82 tcg/loongarch64/tcg-target.h | 24 3 files changed, 95

[PATCH v7 08/31] tcg/loongarch64: Implement the memory barrier op

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 32 1 file changed, 32 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index

[PATCH v7 18/31] tcg/loongarch64: Implement mul/mulsh/muluh/div/divu/rem/remu ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 65 tcg/loongarch64/tcg-target.h | 16 +++ 3 files changed, 74

[PATCH v7 14/31] tcg/loongarch64: Implement bswap{16,32,64} ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 10 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/tcg

[PATCH v7 12/31] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.c.inc | 88 tcg/loongarch64/tcg-target.h | 16 ++--- 3 files changed, 98 insertions

[PATCH v7 10/31] tcg/loongarch64: Implement goto_ptr

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 17 + tcg/loongarch64/tcg-target.c.inc | 15 +++ 2 files changed, 32 insertions(+) create mode 100644 tcg/loongarch64/tcg

[PATCH v7 30/31] configure, meson.build: Mark support for loongarch64 hosts

2021-11-22 Thread WANG Xuerui
nately. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- configure | 7 ++- meson.build | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 48c21775f3..23c366a69a 100755 --- a/configure +++

[PATCH v7 23/31] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.c.inc | 353 +++ 2 files changed, 355 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH v7 15/31] tcg/loongarch64: Implement clz/ctz ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 42 tcg/loongarch64/tcg-target.h | 8 +++--- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a

[PATCH v7 21/31] tcg/loongarch64: Implement tcg_out_call

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 34 1 file changed, 34 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 682bf76ceb..e470d7e145 100644 --- a/tcg

[PATCH v7 26/31] tcg/loongarch64: Implement tcg_target_init

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 2d066a035d..ff167d686b 100644 --- a/tcg

[PATCH v7 13/31] tcg/loongarch64: Implement deposit/extract ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 21 + tcg/loongarch64/tcg-target.h | 8 3 files changed, 26 insertions

[PATCH v7 22/31] tcg/loongarch64: Implement simple load/store ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 131 +++ 2 files changed, 132 insertions(+) diff --git a/tcg/loongarch64/tcg-target

[PATCH v7 20/31] tcg/loongarch64: Implement setcond ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 69 2 files changed, 70 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH v7 27/31] tcg/loongarch64: Register the JIT

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 44 1 file changed, 44 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index ff167d686b..8ce30ecae5 100644 --- a/tcg

[PATCH v7 19/31] tcg/loongarch64: Implement br/brcond ops

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 53 2 files changed, 54 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con

[PATCH v7 31/31] tests/docker: Add gentoo-loongarch64-cross image and run cross builds in GitLab

2021-11-22 Thread WANG Xuerui
. As a reference, the image takes about 27 minutes to rebuild on a Threadripper 3990X system with Docker operating on HDD; YMMV but it probably wouldn't become significantly shorter, as everything needs to be built from source in our case. Signed-off-by: WANG Xuerui --- .gitlab-ci.d

[PATCH v7 24/31] tcg/loongarch64: Implement tcg_target_qemu_prologue

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 68 1 file changed, 68 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index c92587c823..a806e3352e 100644 --- a/tcg

[PATCH v7 29/31] accel/tcg/user-exec: Implement CPU-specific signal handler for loongarch64 hosts

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/host/loongarch64/host-signal.h | 82 +++ 1 file changed, 82 insertions(+) create mode 100644 linux-user/host/loongarch64/host-signal.h diff --git a/linux-user/host

[PATCH v7 28/31] linux-user: Add safe syscall handling for loongarch64 hosts

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- linux-user/host/loongarch64/hostdep.h | 34 .../host/loongarch64/safe-syscall.inc.S | 80 +++ 2 files changed, 114 insertions(+) create mode 100644 linux-user/host/loongarch64/hostdep.h create

[PATCH v7 25/31] tcg/loongarch64: Implement exit_tb/goto_tb

2021-11-22 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index a806e3352e..2d066a035d 100644 --- a/tcg/loongarch64

[PATCH for-7.0 v8 00/31] LoongArch64 port of QEMU TCG

2021-11-24 Thread WANG Xuerui
chew.org/QEMU/20210923165939.729081-1-...@xen0n.name/ v3: https://patchew.org/QEMU/20210922180927.666273-1-...@xen0n.name/ v2: https://patchew.org/QEMU/20210921201915.601245-1-...@xen0n.name/ v1: https://patchew.org/QEMU/20210920080451.408655-1-...@xen0n.name/ WANG Xuerui (31): elf: Add mach

[PATCH for-7.0 v8 02/31] MAINTAINERS: Add tcg/loongarch64 entry with myself as maintainer

2021-11-24 Thread WANG Xuerui
I ported the initial code, so I should maintain it of course. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d3879aa3c1..a638fb6b31 100644

[PATCH for-7.0 v8 07/31] tcg/loongarch64: Implement necessary relocation operations

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 66 1 file changed, 66 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 64e57bd055..fbacaef862 100644 --- a/tcg

[PATCH for-7.0 v8 05/31] tcg/loongarch64: Add register names, allocation order and input/output sets

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 118 +++ 1 file changed, 118 insertions(+) create mode 100644 tcg/loongarch64/tcg-target.c.inc diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg

[PATCH for-7.0 v8 01/31] elf: Add machine type value for LoongArch

2021-11-24 Thread WANG Xuerui
-gdb.git;a=commit;h=01a8c731aacbdbed0eb5682d13cc074dc7e25fb3 Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/elf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/elf.h b/include/elf.h index 811bf4a1cb..3a4bcb646a 100644 --- a

[PATCH for-7.0 v8 04/31] tcg/loongarch64: Add generated instruction opcodes and encoding helpers

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Acked-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 979 1 file changed, 979 insertions(+) create mode 100644 tcg/loongarch64/tcg-insn-defs.c.inc diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc b/tcg/loongarch64/tcg

[PATCH for-7.0 v8 10/31] tcg/loongarch64: Implement goto_ptr

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 17 + tcg/loongarch64/tcg-target.c.inc | 15 +++ 2 files changed, 32 insertions(+) create mode 100644 tcg/loongarch64/tcg

[PATCH for-7.0 v8 16/31] tcg/loongarch64: Implement shl/shr/sar/rotl/rotr ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 91 tcg/loongarch64/tcg-target.h | 4 +- 3 files changed, 94 insertions

[PATCH for-7.0 v8 03/31] tcg/loongarch64: Add the tcg-target.h file

2021-11-24 Thread WANG Xuerui
Support for all optional TCG ops are initially marked disabled; the bits are to be set in individual commits later. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.h | 180 +++ 1 file

[PATCH for-7.0 v8 09/31] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 137 +++ 1 file changed, 137 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index

[PATCH for-7.0 v8 13/31] tcg/loongarch64: Implement deposit/extract ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 21 + tcg/loongarch64/tcg-target.h | 8 3 files changed, 26 insertions

[PATCH for-7.0 v8 14/31] tcg/loongarch64: Implement bswap{16, 32, 64} ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 10 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/tcg

[PATCH for-7.0 v8 06/31] tcg/loongarch64: Define the operand constraints

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-str.h | 28 +++ tcg/loongarch64/tcg-target.c.inc | 52 2 files changed, 80 insertions(+) create mode 100644 tcg

[PATCH for-7.0 v8 15/31] tcg/loongarch64: Implement clz/ctz ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 42 tcg/loongarch64/tcg-target.h | 8 +++--- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a

[PATCH for-7.0 v8 20/31] tcg/loongarch64: Implement setcond ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 69 2 files changed, 70 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH for-7.0 v8 19/31] tcg/loongarch64: Implement br/brcond ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 53 2 files changed, 54 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con

[PATCH for-7.0 v8 21/31] tcg/loongarch64: Implement tcg_out_call

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 34 1 file changed, 34 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 682bf76ceb..e470d7e145 100644 --- a/tcg

[PATCH for-7.0 v8 23/31] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.c.inc | 353 +++ 2 files changed, 355 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH for-7.0 v8 25/31] tcg/loongarch64: Implement exit_tb/goto_tb

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index a806e3352e..2d066a035d 100644 --- a/tcg/loongarch64

[PATCH for-7.0 v8 08/31] tcg/loongarch64: Implement the memory barrier op

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.c.inc | 32 1 file changed, 32 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index

[PATCH for-7.0 v8 18/31] tcg/loongarch64: Implement mul/mulsh/muluh/div/divu/rem/remu ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 65 tcg/loongarch64/tcg-target.h | 16 +++ 3 files changed, 74

[PATCH for-7.0 v8 27/31] tcg/loongarch64: Register the JIT

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 44 1 file changed, 44 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index ff167d686b..8ce30ecae5 100644 --- a/tcg

[PATCH for-7.0 v8 12/31] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 2 + tcg/loongarch64/tcg-target.c.inc | 88 tcg/loongarch64/tcg-target.h | 16 ++--- 3 files changed, 98 insertions

[PATCH for-7.0 v8 11/31] tcg/loongarch64: Implement sign-/zero-extension ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 82 tcg/loongarch64/tcg-target.h | 24 3 files changed, 95

[PATCH for-7.0 v8 24/31] tcg/loongarch64: Implement tcg_target_qemu_prologue

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 68 1 file changed, 68 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index c92587c823..a806e3352e 100644 --- a/tcg

[PATCH for-7.0 v8 26/31] tcg/loongarch64: Implement tcg_target_init

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 2d066a035d..ff167d686b 100644 --- a/tcg

[PATCH for-7.0 v8 22/31] tcg/loongarch64: Implement simple load/store ops

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 131 +++ 2 files changed, 132 insertions(+) diff --git a/tcg/loongarch64/tcg-target

[PATCH for-7.0 v8 30/31] configure, meson.build: Mark support for loongarch64 hosts

2021-11-24 Thread WANG Xuerui
nately. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- configure | 7 ++- meson.build | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 48c21775f3..23c366a69a 100755 --- a/configure +++

[PATCH for-7.0 v8 31/31] tests/docker: Add gentoo-loongarch64-cross image and run cross builds in GitLab

2021-11-24 Thread WANG Xuerui
. As a reference, the image takes about 27 minutes to rebuild on a Threadripper 3990X system with Docker operating on HDD; YMMV but it probably wouldn't become significantly shorter, as everything needs to be built from source in our case. Signed-off-by: WANG Xuerui --- .gitlab-ci.d

[PATCH for-7.0 v8 29/31] linux-user: Implement CPU-specific signal handler for loongarch64 hosts

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/host/loongarch64/host-signal.h | 87 +++ 1 file changed, 87 insertions(+) create mode 100644 linux-user/host/loongarch64/host-signal.h diff --git a/linux-user/host

[PATCH for-7.0 v8 17/31] tcg/loongarch64: Implement add/sub ops

2021-11-24 Thread WANG Xuerui
The neg_i{32,64} ops is fully expressible with sub, so omitted for simplicity. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-con-set.h | 2 ++ tcg/loongarch64/tcg-target.c.inc | 38

[PATCH for-7.0 v8 28/31] linux-user: Add safe syscall handling for loongarch64 hosts

2021-11-24 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- linux-user/host/loongarch64/hostdep.h | 14 .../host/loongarch64/safe-syscall.inc.S | 80 +++ 2 files changed, 94 insertions(+) create mode 100644 linux-user/host/loongarch64/hostdep.h create mode

Re: [PATCH] linux-user: move target_signal.h generic definitions to generic/signal.h

2021-11-25 Thread WANG Xuerui
Hi, On 2021/11/25 16:55, Song Gao wrote: > diff --git a/linux-user/generic/signal.h b/linux-user/generic/signal.h > index 943bc1a..ceaf8a8 100644 > --- a/linux-user/generic/signal.h > +++ b/linux-user/generic/signal.h > @@ -55,6 +55,22 @@ > #define TARGET_SIG_UNBLOCK1/* for unblocking

Re: [PATCH v4 36/57] tcg/loongarch64: Assert the host supports unaligned accesses

2023-05-05 Thread WANG Xuerui
Hi, On 2023/5/3 15:06, Richard Henderson wrote: This should be true of all server class loongarch64. And desktop-class (i.e. all Loongson-3 series). Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tcg/loongarc

Re: [PATCH v3 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-09-23 Thread WANG Xuerui
Hi Richard, On 9/23/21 02:51, Richard Henderson wrote: On 9/22/21 11:09 AM, WANG Xuerui wrote: +    if (sextreg(val, 0, 52) == val) { +    /* + * Fits in 52-bits, upper bits are already properly sign-extended by + * cu32i.d. + */ +    return

[PATCH v4 00/30] LoongArch64 port of QEMU TCG

2021-09-23 Thread WANG Xuerui
could see - Updated generated instruction definitions to latest - Reordered the configure/meson.build changes to come last v3: https://patchew.org/QEMU/20210922180927.666273-1-...@xen0n.name/ v2: https://patchew.org/QEMU/20210921201915.601245-1-...@xen0n.name/ v1: https://patchew.org/QEMU/2021092008045

[PATCH v4 02/30] MAINTAINERS: Add tcg/loongarch64 entry with myself as maintainer

2021-09-23 Thread WANG Xuerui
I ported the initial code, so I should maintain it of course. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d7915ec128..859e5b5ba2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v4 01/30] elf: Add machine type value for LoongArch

2021-09-23 Thread WANG Xuerui
-gdb.git;a=commit;h=01a8c731aacbdbed0eb5682d13cc074dc7e25fb3 Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/elf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/elf.h b/include/elf.h index 811bf4a1cb..3a4bcb646a 100644 --- a

[PATCH v4 06/30] tcg/loongarch64: Define the operand constraints

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-str.h | 28 +++ tcg/loongarch64/tcg-target.c.inc | 52 2 files changed, 80 insertions(+) create mode 100644 tcg/loongarch64/tcg-target-con-str.h diff --git

[PATCH v4 05/30] tcg/loongarch64: Add register names, allocation order and input/output sets

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 118 +++ 1 file changed, 118 insertions(+) create mode 100644 tcg/loongarch64/tcg-target.c.inc diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg

[PATCH v4 16/30] tcg/loongarch64: Implement shl/shr/sar/rotl/rotr ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 91 tcg/loongarch64/tcg-target.h | 4 +- 3 files changed, 94 insertions(+), 2 deletions(-) diff --git a/tcg

[PATCH v4 03/30] tcg/loongarch64: Add the tcg-target.h file

2021-09-23 Thread WANG Xuerui
Support for all optional TCG ops are initially marked disabled; the bits are to be set in individual commits later. Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target.h | 180 +++ 1 file

[PATCH v4 08/30] tcg/loongarch64: Implement the memory barrier op

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 32 1 file changed, 32 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 6967f143e9..8f7c556c37 100644 --- a/tcg

[PATCH v4 04/30] tcg/loongarch64: Add generated instruction opcodes and encoding helpers

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Acked-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 891 1 file changed, 891 insertions(+) create mode 100644 tcg/loongarch64/tcg-insn-defs.c.inc diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc b/tcg/loongarch64/tcg

[PATCH v4 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui --- tcg/loongarch64/tcg-target.c.inc | 111 +++ 1 file changed, 111 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 8f7c556c37..afaed5017a 100644 --- a/tcg/loongarch64/tcg-target.c.inc

[PATCH v4 14/30] tcg/loongarch64: Implement bswap{16,32,64} ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 32 tcg/loongarch64/tcg-target.h | 10 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg

[PATCH v4 19/30] tcg/loongarch64: Implement br/brcond ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 53 2 files changed, 54 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH v4 07/30] tcg/loongarch64: Implement necessary relocation operations

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 66 1 file changed, 66 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index f0930f77ef..6967f143e9 100644 --- a/tcg

[PATCH v4 13/30] tcg/loongarch64: Implement deposit/extract ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 21 + tcg/loongarch64/tcg-target.h | 8 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tcg

[PATCH v4 22/30] tcg/loongarch64: Implement simple load/store ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 131 +++ 2 files changed, 132 insertions(+) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target

[PATCH v4 10/30] tcg/loongarch64: Implement goto_ptr

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 17 + tcg/loongarch64/tcg-target.c.inc | 15 +++ 2 files changed, 32 insertions(+) create mode 100644 tcg/loongarch64/tcg-target-con-set.h diff --git a/tcg

[PATCH v4 11/30] tcg/loongarch64: Implement sign-/zero-extension ops

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.c.inc | 82 tcg/loongarch64/tcg-target.h | 24 3 files changed, 95 insertions(+), 12 deletions(-) diff --git a

[PATCH v4 25/30] tcg/loongarch64: Implement exit_tb/goto_tb

2021-09-23 Thread WANG Xuerui
Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 3cf9a4924b..e09bf832bd 100644 --- a/tcg/loongarch64

  1   2   3   4   5   >