Re: [RFC PATCH v3 22/27] hw/loongarch: Add some devices support for 3A5000.

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 13:07, Xiaojuan Yang wrote: > 1.Add uart,virtio-net,vga and usb for 3A5000. > 2.Add irq set and map for the pci host. Non pci device > use irq 0-16, pci device use 16-64. > 3.Add some unimplented device to emulate guest unused > memory space. > > Signed-off-by: Xiaojuan Yang > Signed-o

Re: [PATCH v13 17/26] linux-user: Add LoongArch generic header files

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > This includes: > - sockbits.h > - target_errno_defs.h > - target_fcntl.h > - termbits.h > > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > linux-user/loongarch64/sockbits.h | 11 +++ > linux-u

Re: [PATCH v13 22/26] linux-user: Add LoongArch cpu_loop support

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > configure | 5 ++ > linux-user/loongarch64/cpu_loop.c | 94 > + > linux-user/loongarch64/target_c

Re: [PATCH v13 25/26] target/loongarch: 'make check-tcg' support

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > Acked-by: Alex Bennée > --- > tests/tcg/configure.sh | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v13 24/26] target/loongarch: Add target build suport

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > This patch adds build loongarch-linux-user target support. > > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > meson.build | 2 +- > target/loongarch/meson.build | 19 +++ > ta

Re: [PATCH v13 21/26] linux-user: Add LoongArch syscall support

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > We should disable '__BITS_PER_LONG' at [1] before run gensyscalls.sh > > [1] arch/loongarch/include/uapi/asm/bitsperlong.h > > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > linux-user/loongarch64/syscall_nr

Re: [PATCH v13 02/26] target/loongarch: Add core definition

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > This patch adds target state header, target definitions > and initialization routines. > > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > target/loongarch/cpu-param.h | 18 +++ > target/loongarch/cpu.c

Re: [PATCH v13 20/26] linux-user: Add LoongArch elf support

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/4/21 10:29, Song Gao wrote: > Signed-off-by: Song Gao > Signed-off-by: Xiaojuan Yang > Reviewed-by: Richard Henderson > --- > include/elf.h | 2 ++ > linux-user/elfload.c| 58 > + > linux-user/loongarch64/target_e

Re: [PATCH v2 07/15] target/m68k: Fix pc, c flag, and address argument for EXCP_DIV0

2021-12-04 Thread Laurent Vivier
Le 02/12/2021 à 21:48, Richard Henderson a écrit : According to the M68040 Users Manual, section 8.4.3, Six word stack frame (format 2), Zero Div (and others) is supposed to record the next insn in PC and the address of the trapping instruction in ADDRESS. While the N, Z and V flags are document

[RFC PATCH v3 07/27] target/loongarch: Add LoongArch CSR instruction

2021-12-04 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h | 88 + target/loongarch/csr_helper.c| 112 + target/loongarch/disas.c | 15 +++ targe

[RFC PATCH v3 08/27] target/loongarch: Add LoongArch IOCSR instruction

2021-12-04 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 8 ++ target/loongarch/helper.h| 2 + target/loongarch/insn_trans/trans_core.c.inc | 103 ++ target/loongarch/i

[RFC PATCH v3 06/27] target/loongarch: Add MMU support for LoongArch CPU.

2021-12-04 Thread Xiaojuan Yang
This patch introduces basic TLB interfaces. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 32 target/loongarch/cpu.h| 45 - target/loongarch/internals.h | 10 + target/loongarch/machine.c

[RFC PATCH v3 23/27] hw/loongarch: Add LoongArch ls7a rtc device support

2021-12-04 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 3 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 323 + hw/rtc/meson.build

[RFC PATCH v3 13/27] target/loongarch: Add gdb support.

2021-12-04 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 43 +++ gdb-xml/loongarch-fpu64.xml | 57 +++ target/loongarch/cpu.c | 7 ++ target/loongarch/gdbst

[RFC PATCH v3 24/27] hw/loongarch: Add default bios startup support.

2021-12-04 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 4 hw/loongarch/fw_cfg.c| 33 ++ hw/loongarch/fw_cfg.h| 15 ++ hw/loongarch/loongson3.c | 35

[RFC PATCH v3 25/27] hw/loongarch: Add -kernel and -initrd options support

2021-12-04 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 79 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 84 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index bc3c1920ef..677d61c

[RFC PATCH v3 20/27] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2021-12-04 Thread Xiaojuan Yang
This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 499 + hw/intc/meson.build| 1 + hw/intc/trace-events

[RFC PATCH v3 26/27] hw/loongarch: Add LoongArch smbios support

2021-12-04 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 41 include/hw/loongarch/loongarch.h | 1 + 3 files changed, 43 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/K

[RFC PATCH v3 18/27] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2021-12-04 Thread Xiaojuan Yang
This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 357 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v3 22/27] hw/loongarch: Add some devices support for 3A5000.

2021-12-04 Thread Xiaojuan Yang
1.Add uart,virtio-net,vga and usb for 3A5000. 2.Add irq set and map for the pci host. Non pci device use irq 0-16, pci device use 16-64. 3.Add some unimplented device to emulate guest unused memory space. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig|

[RFC PATCH v3 17/27] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2021-12-04 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 162 hw/intc/meson.build | 1 + hw/intc/trace-events|

[RFC PATCH v3 16/27] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2021-12-04 Thread Xiaojuan Yang
Loongson-3A5000 support 14 interrupts from 64 - 77(Timer->75 IPI->76) Loongson-3A5000 and ls7a form a legacy model and extended model irq hierarchy.Tcg mode emulate a simplified extended model which has no Legacy I/O Interrupt Controller(LIOINTC) and LPC. e.g: |+-++-+ +---

[RFC PATCH v3 21/27] hw/loongarch: Add irq hierarchy for the system

2021-12-04 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 84 ++ include/hw/pci-host/ls7a.h | 13 ++ 2 files changed, 97 insertions(+) diff --git a/hw/loongarch/loongson3.c

[RFC PATCH v3 27/27] hw/loongarch: Add LoongArch acpi support

2021-12-04 Thread Xiaojuan Yang
Add a simple acpi model for LoongArch cpu More complex functions will be added later Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/acpi/Kconfig | 4 + hw/acpi/ls7a.c | 349 + hw/acpi/meson.build | 1 + hw/loongarc

[RFC PATCH v3 14/27] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson3 Platform

2021-12-04 Thread Xiaojuan Yang
This is a model of the PCIe Host Bridge found on a Loongson-5000 processor. It includes a interrupt controller, some interface for pci and nonpci devices. Mainly emulate part of it that is not exactly the same as the host and only use part devices for tcg mode. It support for MSI and MSIX interrupt

[RFC PATCH v3 09/27] target/loongarch: Add TLB instruction support

2021-12-04 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 17 + target/loongarch/helper.h| 12 + target/loongarch/insn_trans/trans_core.c.inc | 109

[RFC PATCH v3 01/27] target/loongarch: Update README

2021-12-04 Thread Xiaojuan Yang
Mainly introduce how to run the softmmu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/README | 20 1 file changed, 20 insertions(+) diff --git a/target/loongarch/README b/target/loongarch/README index 09f809cf80..49c1f1575a 100644 --- a/target/l

[RFC PATCH v3 02/27] target/loongarch: Add CSR registers definition

2021-12-04 Thread Xiaojuan Yang
1.Define All the CSR registers and its field. 2.Set some default csr values. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 236 + target/loongarch/cpu.c | 35 ++ target/loongarch/cpu.h | 57 + 3 fi

[RFC PATCH v3 19/27] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI)

2021-12-04 Thread Xiaojuan Yang
This patch realize PCH-MSI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 5 +++ hw/intc/loongarch_pch_msi.c | 67 + hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v3 10/27] target/loongarch: Add other core instructions support

2021-12-04 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h | 2 + target/loongarch/disas.c | 17 target/loongarch/helper.h| 4 + target/loongarch/insn_

[RFC PATCH v3 03/27] target/loongarch: Add basic vmstate description of CPU.

2021-12-04 Thread Xiaojuan Yang
This patch introduce vmstate_loongarch_cpu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 3 ++ target/loongarch/internals.h | 4 ++ target/loongarch/machine.c | 84 target/loongarc

[RFC PATCH v3 11/27] target/loongarch: Add LoongArch interrupt and exception handle

2021-12-04 Thread Xiaojuan Yang
1.This patch Add loongarch interrupt and exception handle. 2.Rename the user excp to the exccode from the csr defintions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- linux-user/loongarch64/cpu_loop.c | 8 +- target/loongarch/cpu.c| 254

[RFC PATCH v3 12/27] target/loongarch: Add timer related instructions support.

2021-12-04 Thread Xiaojuan Yang
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/helper.h | 1 + target/loongarch/insn_trans/trans_extra.c.inc | 32 +++ target/loongarch/translate.c | 2 ++ 3 files changed,

[RFC PATCH v3 05/27] target/loongarch: Add stabletimer support

2021-12-04 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 9 + target/loongarch/cpu.h | 10 ++ target/loongarch/meson.build | 1 + target/loongarch/stabletimer.c | 63 ++ 4 files changed, 83 insertions(+) create

[RFC PATCH v3 15/27] hw/loongarch: Add support loongson3-ls7a machine type.

2021-12-04 Thread Xiaojuan Yang
Emulate a 3A5000 board use the new loongarch instruction. 3A5000 belongs to the Loongson3 series processors. The board consists of a 3A5000 cpu model and the 7A1000 bridge. The host 3A5000 board is really complicated and contains many functions.Now for the tcg softmmu mode only part functions are e

[RFC PATCH v3 00/27] Add LoongArch softmmu support.

2021-12-04 Thread Xiaojuan Yang
This series patch add softmmu support for LoongArch. Base on the linux-user emulation support V13 patch. * https://patchew.org/QEMU/1638610165-15036-1-git-send-email-gaos...@loongson.cn/ The latest kernel: * https://github.com/loongson/linux/tree/loongarch-next The manual: * https://github.c

[RFC PATCH v3 04/27] target/loongarch: Implement qmp_query_cpu_definitions()

2021-12-04 Thread Xiaojuan Yang
This patch introduce qmp_query_cpu_definitions interface. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 26 ++ 2 files changed, 30 insertions(+), 2 deletions(-) d

Re: [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU

2021-12-04 Thread Hyman Huang
在 2021/12/3 20:34, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "vcpu-dirty-limit", "query-vc

Re: [PATCH] hid: Implement support for side and extra buttons

2021-12-04 Thread Noah Bergbauer
ping https://patchew.org/QEMU/20211126140437.79745-1-n...@statshelix.com/ On Fri, Nov 26, 2021 at 3:04 PM Noah Bergbauer wrote: > Simply set the respective bits and update the descriptor accordingly. > > Signed-off-by: Noah Bergbauer > --- > hw/input/hid.c | 2 ++ > hw/usb/dev-hid.c | 6 +++-

Re: [PATCH v2] hw/net: npcm7xx_emc fix missing queue_flush

2021-12-04 Thread Philippe Mathieu-Daudé
On 12/3/21 23:10, Patrick Venture wrote: > The rx_active boolean change to true should always trigger a try_read > call that flushes the queue. > > Signed-off-by: Patrick Venture > --- > v2: introduced helper method to encapsulate rx activation and queue flush. Thanks, Reviewed-by: Philippe Mat

[PATCH v13 00/26] Add LoongArch linux-user emulation support

2021-12-04 Thread Song Gao
Based-on: https://patchew.org/QEMU/1637893388-10282-1-git-send-email-gaos...@loongson.cn/ Hi all, This series only support linux-user emulation. More about LoongArch at: https://github.com/loongson/ The latest kernel: * https://github.com/loongson/linux/tree/loongarch-next Patches need revie

[PATCH v13 02/26] target/loongarch: Add core definition

2021-12-04 Thread Song Gao
This patch adds target state header, target definitions and initialization routines. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/cpu-param.h | 18 +++ target/loongarch/cpu.c | 313 +++ t

[PATCH v13 22/26] linux-user: Add LoongArch cpu_loop support

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- configure | 5 ++ linux-user/loongarch64/cpu_loop.c | 94 + linux-user/loongarch64/target_cpu.h | 34 ++ 3 files changed, 133 inse

[PATCH v13 18/26] linux-user: Add LoongArch specific structures

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/loongarch64/target_structs.h | 47 + 1 file changed, 47 insertions(+) create mode 100644 linux-user/loongarch64/target_structs.h diff --git a/linux-user/loongarch64/target_structs.h b/linux-use

Re: [RFC PATCH 2/2] qemu-img convert: Fix sparseness detection

2021-12-04 Thread Peter Lieven
> Am 04.12.2021 um 00:04 schrieb Vladimir Sementsov-Ogievskiy > : > > 03.12.2021 14:17, Peter Lieven wrote: >>> Am 19.05.21 um 18:48 schrieb Kevin Wolf: >>> Am 19.05.2021 um 15:24 hat Peter Lieven geschrieben: Am 20.04.21 um 18:52 schrieb Vladimir Sementsov-Ogievskiy: > 20.04.2021 18

[PATCH v13 06/26] target/loongarch: Add fixed point bit instruction translation

2021-12-04 Thread Song Gao
This includes: - EXT.W.{B/H} - CL{O/Z}.{W/D}, CT{O/Z}.{W/D} - BYTEPICK.{W/D} - REVB.{2H/4H/2W/D} - REVH.{2W/D} - BITREV.{4B/8B}, BITREV.{W/D} - BSTRINS.{W/D}, BSTRPICK.{W/D} - MASKEQZ, MASKNEZ Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loonga

[PATCH v13 10/26] target/loongarch: Add floating point arithmetic instruction translation

2021-12-04 Thread Song Gao
This includes: - F{ADD/SUB/MUL/DIV}.{S/D} - F{MADD/MSUB/NMADD/NMSUB}.{S/D} - F{MAX/MIN}.{S/D} - F{MAXA/MINA}.{S/D} - F{ABS/NEG}.{S/D} - F{SQRT/RECIP/RSQRT}.{S/D} - F{SCALEB/LOGB/COPYSIGN}.{S/D} - FCLASS.{S/D} Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --

[PATCH v13 12/26] target/loongarch: Add floating point conversion instruction translation

2021-12-04 Thread Song Gao
This includes: - FCVT.S.D, FCVT.D.S - FFINT.{S/D}.{W/L}, FTINT.{W/L}.{S/D} - FTINT{RM/RP/RZ/RNE}.{W/L}.{S/D} - FRINT.{S/D} Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/fpu_helper.c| 393 +++ tar

[PATCH v13 16/26] target/loongarch: Add disassembler

2021-12-04 Thread Song Gao
This patch adds support for disassembling via option '-d in_asm'. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- include/disas/dis-asm.h | 2 + meson.build | 1 + target/loongarch/disas.c | 612 +

[PATCH v13 25/26] target/loongarch: 'make check-tcg' support

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Acked-by: Alex Bennée --- tests/tcg/configure.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 9b76f58..49a05ec 100755 --- a/tests/tcg/configure.sh ++

[PATCH v13 20/26] linux-user: Add LoongArch elf support

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- include/elf.h | 2 ++ linux-user/elfload.c| 58 + linux-user/loongarch64/target_elf.h | 12 3 files changed, 72 insertions(

[PATCH v13 21/26] linux-user: Add LoongArch syscall support

2021-12-04 Thread Song Gao
We should disable '__BITS_PER_LONG' at [1] before run gensyscalls.sh [1] arch/loongarch/include/uapi/asm/bitsperlong.h Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- linux-user/loongarch64/syscall_nr.h | 313 linux

[PATCH v13 11/26] target/loongarch: Add floating point comparison instruction translation

2021-12-04 Thread Song Gao
This includes: - FCMP.cond.{S/D} Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/fpu_helper.c| 60 target/loongarch/helper.h| 9 + target/loongarch/insn_trans/trans_fc

[PATCH v13 19/26] linux-user: Add LoongArch signal support

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- linux-user/loongarch64/signal.c| 198 + linux-user/loongarch64/target_signal.h | 13 +++ 2 files changed, 211 insertions(+) create mode 100644 linux-user/loongarch64/signal.c create mode 100644 li

[PATCH v13 24/26] target/loongarch: Add target build suport

2021-12-04 Thread Song Gao
This patch adds build loongarch-linux-user target support. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- meson.build | 2 +- target/loongarch/meson.build | 19 +++ target/meson.build | 1 + 3 files changed,

[PATCH v13 14/26] target/loongarch: Add floating point load/store instruction translation

2021-12-04 Thread Song Gao
This includes: - FLD.{S/D}, FST.{S/D} - FLDX.{S/D}, FSTX.{S/D} - FLD{GT/LE}.{S/D}, FST{GT/LE}.{S/D} Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_fmemory.c.inc | 153 target/loongarch/insns.dec

[PATCH v13 15/26] target/loongarch: Add branch instruction translation

2021-12-04 Thread Song Gao
This includes: - BEQ, BNE, BLT[U], BGE[U] - BEQZ, BNEZ - B - BL - JIRL - BCEQZ, BCNEZ Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_branch.c.inc | 83 ++ target/loongarch/insns.decode

[PATCH v13 13/26] target/loongarch: Add floating point move instruction translation

2021-12-04 Thread Song Gao
This includes: - FMOV.{S/D} - FSEL - MOVGR2FR.{W/D}, MOVGR2FRH.W - MOVFR2GR.{S/D}, MOVFRH2GR.S - MOVGR2FCSR, MOVFCSR2GR - MOVFR2CF, MOVCF2FR - MOVGR2CF, MOVCF2GR Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/fpu_helper.c

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

2021-12-04 Thread Song Gao
This includes: - ADD.{W/D}, SUB.{W/D} - ADDI.{W/D}, ADDU16ID - ALSL.{W[U]/D} - LU12I.W, LU32I.D LU52I.D - SLT[U], SLT[U]I - PCADDI, PCADDU12I, PCADDU18I, PCALAU12I - AND, OR, NOR, XOR, ANDN, ORN - MUL.{W/D}, MULH.{W[U]/D[U]} - MULW.D.W[U] - DIV.{W[U]/D[U]}, MOD.{W[U]/D[U]} - ANDI, ORI, XORI Signed

[PATCH v13 17/26] linux-user: Add LoongArch generic header files

2021-12-04 Thread Song Gao
This includes: - sockbits.h - target_errno_defs.h - target_fcntl.h - termbits.h Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- linux-user/loongarch64/sockbits.h | 11 +++ linux-user/loongarch64/target_errno_defs.h | 12 lin

[PATCH v13 07/26] target/loongarch: Add fixed point load/store instruction translation

2021-12-04 Thread Song Gao
This includes: - LD.{B[U]/H[U]/W[U]/D}, ST.{B/H/W/D} - LDX.{B[U]/H[U]/W[U]/D}, STX.{B/H/W/D} - LDPTR.{W/D}, STPTR.{W/D} - PRELD - LD{GT/LE}.{B/H/W/D}, ST{GT/LE}.{B/H/W/D} - DBAR, IBAR Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/helpe

[PATCH v13 26/26] scripts: add loongarch64 binfmt config

2021-12-04 Thread Song Gao
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- scripts/qemu-binfmt-conf.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index 7de996d..da6a937 100755 --- a/scripts/qemu

[PATCH v13 08/26] target/loongarch: Add fixed point atomic instruction translation

2021-12-04 Thread Song Gao
This includes: - LL.{W/D}, SC.{W/D} - AM{SWAP/ADD/AND/OR/XOR/MAX/MIN}[_DB].{W/D} - AM{MAX/MIN}[_DB].{WU/DU} Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_atomic.c.inc | 114 + target/loongarch/i

[PATCH v13 23/26] default-configs: Add loongarch linux-user support

2021-12-04 Thread Song Gao
This patch adds loongarch64 linux-user default configs file. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- configs/targets/loongarch64-linux-user.mak | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/targets/loongarch64-linux-user.ma

[PATCH v13 03/26] target/loongarch: Add main translation routines

2021-12-04 Thread Song Gao
This patch adds main translation routines and basic functions for translation. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/helper.h| 6 ++ target/loongarch/op_helper.c | 21 ++ target/loongarch/translate.c | 159 ++

[PATCH v13 09/26] target/loongarch: Add fixed point extra instruction translation

2021-12-04 Thread Song Gao
This includes: - CRC[C].W.{B/H/W/D}.W - SYSCALL - BREAK - ASRT{LE/GT}.D - RDTIME{L/H}.W, RDTIME.D - CPUCFG Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/helper.h | 4 ++ target/loongarch/insn_trans/trans_extra.c.in

[PATCH v13 01/26] target/loongarch: Add README

2021-12-04 Thread Song Gao
This patch gives an introduction to the LoongArch target. Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- MAINTAINERS | 5 target/loongarch/README | 76 + 2 files changed, 81 insertions(+)

[PATCH v13 05/26] target/loongarch: Add fixed point shift instruction translation

2021-12-04 Thread Song Gao
This includes: - SLL.W, SRL.W, SRA.W, ROTR.W - SLLI.W, SRLI.W, SRAI.W, ROTRI.W - SLL.D, SRL.D, SRA.D, ROTR.D - SLLI.D, SRLI.D, SRAI.D, ROTRI.D Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_shift.c.inc | 106 +++