[PATCH 12/31] target/loongarch: Add timer related instructions support.

2021-10-19 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 | 2 ++ target/loongarch/insn_trans/trans_core.c | 23 + target/loongarch/insn_trans/trans_extra.c | 2 ++ target/loongarch

[PATCH 03/31] target/loongarch: Set default csr values.

2021-10-19 Thread Xiaojuan Yang
This patch set default csr values Mainly used for cpu_initfn and cpu_reset. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 40 target/loongarch/cpu.h | 6 ++ 2 files changed, 46 insertions(+) diff --git a/target

[PATCH 18/31] hw/intc: Add loongarch ls7a msi interrupt controller support(PCH-MSI)

2021-10-19 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 | 74 + hw/intc/meson.build | 1 + hw/loongarch/Kconfig

[PATCH 16/31] hw/loongarch: Add loongarch ipi interrupt support(IPI)

2021-10-19 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/ipi.c | 145 +++ hw/loongarch/ls3a5000_virt.c | 2 + hw/loongarch/meson.build | 2 +- include/hw/loongarch/gipi.h

[PATCH 13/31] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson Platform

2021-10-19 Thread Xiaojuan Yang
doc at https://github.com/loongson/LoongArch-Documentation/releases/latest/ download/Loongson-7A1000-usermanual-2.00-EN.pdf Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/pci-host/Kconfig| 4 + hw/pci-host/ls7a.c | 188 + hw/pci

[PATCH 19/31] hw/intc: Add loongarch extioi interrupt controller(EIOINTC)

2021-10-19 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 | 571 + hw/intc/meson.build| 1 + hw/loongarch/Kconfig

[PATCH 14/31] hw/loongarch: Add a virt loongarch 3A5000 board support

2021-10-19 Thread Xiaojuan Yang
LoongArch is a new RISC ISA, support 32bit mode or 64bit mode. Now we only add 64bit support. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- .../devices/loongarch64-softmmu/default.mak | 3

[RFC PATCH v4 00/30] Add LoongArch softmmu support.

2022-01-08 Thread Xiaojuan Yang
27;s code review comments. Please help review! Thanks Xiaojuan Yang (30): target/loongarch: Update README target/loongarch: Add CSR registers definition target/loongarch: Add basic vmstate description of CPU. target/loongarch: Implement qmp_query_cpu_definitions() target/loongarch: A

[RFC PATCH v4 09/30] target/loongarch: Add TLB instruction support

2022-01-08 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

[RFC PATCH v4 07/30] target/loongarch: Add LoongArch CSR instruction

2022-01-08 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

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

2022-01-08 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 | 164 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 01/30] target/loongarch: Update README

2022-01-08 Thread Xiaojuan Yang
Mainly introduce how to run the softmmu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/README | 25 + 1 file changed, 25 insertions(+) diff --git a/target/loongarch/README b/target/loongarch/README index d5780c5918..337ba55f33 100644 --- a

[RFC PATCH v4 02/30] target/loongarch: Add CSR registers definition

2022-01-08 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

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

2022-01-08 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

[RFC PATCH v4 27/30] hw/loongarch: Add LoongArch smbios support

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 40 include/hw/loongarch/loongarch.h | 1 + 3 files changed, 42 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch

[RFC PATCH v4 04/30] target/loongarch: Implement qmp_query_cpu_definitions()

2022-01-08 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

[RFC PATCH v4 08/30] target/loongarch: Add LoongArch IOCSR instruction

2022-01-08 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 8 ++ target/loongarch/cpu.h | 4 + target/loongarch/disas.c | 8 ++ target/loongarch/helper.h

[RFC PATCH v4 30/30] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-01-08 Thread Xiaojuan Yang
- We write a very minimal softmmu harness. - This is a very simple smoke test with no need to run a full Linux/kernel. - The Makefile.softmmu-target record the rule to run. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.softmmu-target | 33

[RFC PATCH v4 13/30] target/loongarch: Add gdb support.

2022-01-08 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

[RFC PATCH v4 11/30] target/loongarch: Add LoongArch interrupt and exception handle

2022-01-08 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| 252

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

2022-01-08 Thread Xiaojuan Yang
son.git/tree/Documentation/loongarch?h=loongarch-next 2.https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 24 1 file changed, 24 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongar

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

2022-01-08 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 | 75 + hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 23/30] hw/loongarch: Add some devices support for 3A5000.

2022-01-08 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 | 7

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

2022-01-08 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 v4 10/30] target/loongarch: Add other core instructions support

2022-01-08 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

[RFC PATCH v4 25/30] hw/loongarch: Add default bios startup support.

2022-01-08 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 v4 24/30] hw/loongarch: Add LoongArch ls7a rtc device support

2022-01-08 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 | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 322 + hw/rtc

[RFC PATCH v4 05/30] target/loongarch: Add constant timer support

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/constant_timer.c | 63 +++ target/loongarch/cpu.c| 9 + target/loongarch/cpu.h| 10 + target/loongarch/meson.build | 1 + 4 files changed, 83 insertions

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

2022-01-08 Thread Xiaojuan Yang
interrupt sources. For more detailed info about ls7a1000 you can see the doc at https://github.com/loongson/LoongArch-Documentation/releases/latest/ download/Loongson-7A1000-usermanual-2.00-EN.pdf Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/pci-host/Kconfig| 4 + hw/pci-host

[RFC PATCH v4 12/30] target/loongarch: Add timer related instructions support.

2022-01-08 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/op_helper.c | 6 target

[RFC PATCH v4 28/30] hw/loongarch: Add LoongArch acpi support

2022-01-08 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 | 374 ++ hw/acpi/meson.build | 1 + hw

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

2022-01-08 Thread Xiaojuan Yang
emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64-softmmu.mak | 3 + hw/Kconfig

[RFC PATCH v4 26/30] hw/loongarch: Add -kernel and -initrd options support

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index 31c285a74d

[RFC PATCH v4 21/30] hw/loongarch: Add irq hierarchy for the system

2022-01-08 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 | 85 ++ include/hw/pci-host/ls7a.h | 13 ++ 2 files changed, 98 insertions(+) diff --git a/hw/loongarch/loongson3.c

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

2022-01-08 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 | 428 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 29/30] hw/loongarch: Add fdt support.

2022-01-08 Thread Xiaojuan Yang
Add tree nodes for 3A5000 device tree. - cpu nodes; - fw_cfg nodes; - pcie nodes. The lastest loongarch bios have supported fdt. - https://github.com/loongson/edk2 - https://github.com/loongson/edk2-platforms Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c

[RFC PATCH v4 22/30] Enable common virtio pci support for LoongArch

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- softmmu/qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 01f3834db5..49491d74a1 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c

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

2022-01-08 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 | 376 + hw/intc/meson.build| 1 + hw/intc/trace-events

[PATCH v3 04/43] target/loongarch: Add fixed point arithmetic instruction translation

2022-04-29 Thread Xiaojuan Yang
, ORI, XORI Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_arith.c.inc | 304 ++ target/loongarch/insns.decode | 79 + target/loongarch/translate.c | 83 + target

[PATCH v3 01/43] target/loongarch: Add README

2022-04-29 Thread Xiaojuan Yang
From: 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 | 6 ++ target/loongarch/README | 10 ++ 2 files changed, 16 insertions(+) create mode

[PATCH v3 09/43] target/loongarch: Add fixed point extra instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 00/43] Add LoongArch softmmu support

2022-04-29 Thread Xiaojuan Yang
int move instruction translation target/loongarch: Add floating point load/store instruction translation target/loongarch: Add branch instruction translation target/loongarch: Add disassembler target/loongarch: Add target build suport target/loongarch: 'make check-tcg' supp

[PATCH v3 03/43] target/loongarch: Add main translation routines

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 26/43] target/loongarch: Add LoongArch IOCSR instruction

2022-04-29 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c| 44 target/loongarch/cpu.h| 25 +++ target/loongarch/disas.c | 8 +++ target/loongarch

[PATCH v3 02/43] target/loongarch: Add core definition

2022-04-29 Thread Xiaojuan Yang
From: 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 Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/cpu-param.h | 18 ++ target/loongarch/cpu.c

[PATCH v3 15/43] target/loongarch: Add branch instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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 --- .../loongarch/insn_trans/trans_branch.c.inc | 83 +++ target/loongarch/insns.decode

[PATCH v3 10/43] target/loongarch: Add floating point arithmetic instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 17/43] target/loongarch: Add target build suport

2022-04-29 Thread Xiaojuan Yang
From: Song Gao Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/meson.build | 19 +++ target/meson.build | 1 + 2 files changed, 20 insertions(+) create mode 100644 target

[PATCH v3 16/43] target/loongarch: Add disassembler

2022-04-29 Thread Xiaojuan Yang
From: 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/dis

[PATCH v3 11/43] target/loongarch: Add floating point comparison instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 18/43] target/loongarch: Add system emulation introduction

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- MAINTAINERS | 8 + docs/system/loongarch/loongson3.rst | 41 ++ target/loongarch/README | 54 + 3 files changed, 103

[PATCH v3 22/43] target/loongarch: Add MMU support for LoongArch CPU.

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 24 +++ target/loongarch/cpu.h| 51 ++ target/loongarch/internals.h | 9 + target/loongarch/machine.c| 17

[PATCH v3 31/43] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-04-29 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- MAINTAINERS | 2 + hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 242 hw

[PATCH v3 30/43] hw/loongarch: Add support loongson3 virt machine type.

2022-04-29 Thread Xiaojuan Yang
emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- MAINTAINERS | 4 + .../devices/loongarch64-softmmu/default.mak | 3 + configs

[PATCH v3 21/43] target/loongarch: Implement qmp_query_cpu_definitions()

2022-04-29 Thread Xiaojuan Yang
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(-) diff --git a/qapi/machine-target.json b/qapi/machine

[PATCH v3 13/43] target/loongarch: Add floating point move instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 40/43] hw/loongarch: Add LoongArch ls7a acpi device support

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 2 + hw/acpi/Kconfig| 4 + hw/acpi/ls7a.c | 374 + hw/acpi/meson.build| 1 + hw/loongarch/Kconfig | 2 + hw/loongarch/loongson3

[PATCH v3 35/43] hw/loongarch: Add irq hierarchy for the system

2022-04-29 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- hw/loongarch/loongson3.c | 116 +++ 1 file changed, 116 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw

[PATCH v3 24/43] target/loongarch: Add constant timer support

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/constant_timer.c | 64 +++ target/loongarch/cpu.c| 2 + target/loongarch/cpu.h| 4 ++ target/loongarch/internals.h | 6

[PATCH v3 37/43] hw/loongarch: Add some devices support for 3A5000.

2022-04-29 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 Acked-by: Richard Henderson --- hw

[PATCH v3 12/43] target/loongarch: Add floating point conversion instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 42/43] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-04-29 Thread Xiaojuan Yang
- We write a very minimal softmmu harness. - This is a very simple smoke test with no need to run a full Linux/kernel. - The Makefile.softmmu-target record the rule to run. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- MAINTAINERS

[PATCH v3 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-04-29 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 | 248 + hw/intc/meson.build| 1 + hw/intc/trace-events

[PATCH v3 14/43] target/loongarch: Add floating point load/store instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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 --- .../loongarch/insn_trans/trans_fmemory.c.inc | 153 ++ target/loongarch

[PATCH v3 08/43] target/loongarch: Add fixed point atomic instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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 --- .../loongarch/insn_trans/trans_atomic.c.inc | 113

[PATCH v3 43/43] target/loongarch: 'make check-tcg' support

2022-04-29 Thread Xiaojuan Yang
From: Song Gao Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Acked-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- tests/tcg/configure.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index

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

2022-04-29 Thread Xiaojuan Yang
This patch realize PCH-MSI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- hw/intc/Kconfig | 5 ++ hw/intc/loongarch_pch_msi.c | 73 + hw/intc/meson.build

[PATCH v3 19/43] target/loongarch: Add CSRs definition

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu-csr.h | 208 + target/loongarch/cpu.c | 36 +++ target/loongarch/cpu.h | 64 3 files changed, 308 insertions(+) create

[PATCH v3 06/43] target/loongarch: Add fixed point bit instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 41/43] target/loongarch: Add gdb support.

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 44 ++ gdb-xml/loongarch-fpu64.xml | 57

[PATCH v3 23/43] target/loongarch: Add LoongArch interrupt and exception handle

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 229 +++ target/loongarch/cpu.h | 2 + target/loongarch/internals.h | 2 + 3 files changed, 233 insertions(+) diff --git a/target

[PATCH v3 32/43] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-04-29 Thread Xiaojuan Yang
This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 1 + hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 431 hw/intc/meson.build

[PATCH v3 29/43] target/loongarch: Add timer related instructions support.

2022-04-29 Thread Xiaojuan Yang
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/disas.c | 3 ++ target/loongarch/helper.h | 2 ++ target/loongarch/insn_trans/trans_extra.c.inc | 33

[PATCH v3 39/43] hw/loongarch: Add LoongArch load elf function.

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c| 66 +++-- include/hw/loongarch/virt.h | 9 + target/loongarch/cpu.h | 2 ++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/loongson3.c

[PATCH v3 25/43] target/loongarch: Add LoongArch CSR instruction

2022-04-29 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/csr_helper.c | 92 ++ target/loongarch/disas.c | 101 +++ target/loongarch/helper.h | 9 + .../insn_trans

[PATCH v3 28/43] target/loongarch: Add other core instructions support

2022-04-29 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/disas.c | 17 target/loongarch/helper.h | 5 + .../insn_trans/trans_privileged.c.inc

[PATCH v3 07/43] target/loongarch: Add fixed point load/store instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v3 20/43] target/loongarch: Add basic vmstate description of CPU.

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 1 + target/loongarch/internals.h | 2 + target/loongarch/machine.c | 85 target/loongarch/meson.build | 6 +++ 4 files changed, 94

[PATCH v3 36/43] Enable common virtio pci support for LoongArch

2022-04-29 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- softmmu/qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 12fe60c467..bb5897fc76 100644 --- a/softmmu/qdev-monitor.c

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

2022-04-29 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/disas.c | 18 + target/loongarch/helper.h | 13 + .../insn_trans

[PATCH v3 38/43] hw/loongarch: Add LoongArch ls7a rtc device support

2022-04-29 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 322

[PATCH v3 05/43] target/loongarch: Add fixed point shift instruction translation

2022-04-29 Thread Xiaojuan Yang
From: 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

[PATCH v1] hw/loongarch: Fix acpi ged irq number in dsdt table

2022-08-18 Thread Xiaojuan Yang
In dsdt, acpi ged irq should use gsi number, and the VIRT_SCI_IRQ means it. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index d0f01a6485..95e30975a8 100644

[PATCH v1 1/2] hw/loongarch: Support memory hotplug

2022-08-26 Thread Xiaojuan Yang
Add hotplug/unplug interface for memory device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 2 + hw/loongarch/acpi-build.c | 32 +--- hw/loongarch/virt.c | 105 +- 3 files changed, 132 insertions(+), 7 deletions(-) diff

[PATCH v1 2/2] hw/loongarch: Improve acpi dsdt table

2022-08-26 Thread Xiaojuan Yang
Cleanup the previous pci information in acpi dsdt table. And using the common acpi_dsdt_add_gpex function to build the gpex and pci information. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 159 +--- hw/loongarch/virt.c | 1 + include

[PATCH v1 0/2] Add mem hotplug and improve acpi dsdt

2022-08-26 Thread Xiaojuan Yang
This series based on the 'Add funtions for LoongArch virt machine patch'(11 Aug) and 'Fix acpi ged irq number in dsdt table patch'(19 Aug). Changes for v1: 1.Support memory hotplug 2.Improve acpi dsdt table Xiaojuan Yang (2): hw/loongarch: Support memory hotplug hw/loo

[PATCH v1 2/3] hw/intc: Fix LoongArch extioi function

2022-09-22 Thread Xiaojuan Yang
1.When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the index of 's->coreisr' is current cpu number. 2.Remove the unused extioi system memory region and we only support the extioi iocsr memory region now. Signed-off-by: Xiaojuan Yang

[PATCH v1 0/3] Add memmap and fix bugs for LoongArch

2022-09-22 Thread Xiaojuan Yang
This series add memmap table and fix extioi, ipi device emulation for LoongArch virt machine. Changes for v1: 1. Add memmap table for LoongArch virt machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Thanks for your reviewing. Xiaojuan Yang (3): hw/loongarch: Add

[PATCH v1 3/3] hw/intc: Fix LoongArch ipi device emulation

2022-09-22 Thread Xiaojuan Yang
In ipi_send function, it should not to set irq before writing data to dest cpu iocsr space, as the irq will trigger after data writing. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c

[PATCH v1 1/3] hw/loongarch: Add memmap for LoongArch virt machine

2022-09-22 Thread Xiaojuan Yang
Using memmap table for loongarch virt machine type, this method comes from arm/riscv architectures. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 46 ++-- hw/loongarch/fw_cfg.c | 5 +- hw/loongarch/virt.c | 138

[PATCH v2 3/3] hw/intc: Fix LoongArch ipi device emulation

2022-09-26 Thread Xiaojuan Yang
In ipi_send function, it should not to set irq before writing data to dest cpu iocsr space, as the irq will trigger after data writing. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c

[PATCH v2 0/3] Add memmap and fix bugs for LoongArch

2022-09-26 Thread Xiaojuan Yang
ipi device emulation Thanks for your reviewing. Xiaojuan Yang (3): hw/loongarch: Add memmap for LoongArch virt machine hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 17 +++-- hw/intc/loongarch_ipi.c | 1 - hw/loon

[PATCH v2 2/3] hw/intc: Fix LoongArch extioi function

2022-09-26 Thread Xiaojuan Yang
1.When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the index of 's->coreisr' is current cpu number. 2.Remove the unused extioi system memory region and we only support the extioi iocsr memory region now. Signed-off-by: Xiaojuan Yang

[PATCH v2 1/3] hw/loongarch: Add memmap for LoongArch virt machine

2022-09-26 Thread Xiaojuan Yang
Using memmap table for loongarch virt machine type, this method comes from arm/riscv architectures. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 46 ++-- hw/loongarch/fw_cfg.c | 5 +- hw/loongarch/virt.c | 138

[PATCH v3 1/2] hw/intc: Fix LoongArch extioi function

2022-09-30 Thread Xiaojuan Yang
xtioi iocsr memory region now. Based-on: <20220927141504.3886314-1-alex.ben...@linaro.org> Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/trace-events| 2 +- target/loongarch/iocsr_helper.c | 16 +-- 3 file

[PATCH v3 2/2] hw/intc: Fix LoongArch ipi device emulation

2022-09-30 Thread Xiaojuan Yang
raise will be called in this case. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 4f3c58f872..aa4bf9eb74 100644 --- a/hw/intc/loongarch_ipi.c +++ b/hw/intc/loongarch_ipi.c @@ -88,7

[PATCH v3 0/2] Add memmap and fix bugs for LoongArch

2022-09-30 Thread Xiaojuan Yang
Changes for v1: 1. Add memmap table for LoongArch virt machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (2): hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_ext

[PATCH v4 0/2] Add memmap and fix bugs for LoongArch

2022-09-30 Thread Xiaojuan Yang
function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (2): hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/loongarch_ipi.c | 1 - hw/intc/trace-events

[PATCH v4 1/2] hw/intc: Fix LoongArch extioi function

2022-09-30 Thread Xiaojuan Yang
xtioi iocsr memory region now. Based-on: <20220927141504.3886314-1-alex.ben...@linaro.org> Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/trace-events| 2 +- target/loongarch/iocsr_helper.c | 16 +-- 3 file

[PATCH v4 2/2] hw/intc: Fix LoongArch ipi device emulation

2022-09-30 Thread Xiaojuan Yang
raise will be called in this case. Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 4f3c58f872..aa4bf9eb74 100644 --- a/hw/intc/loongarch

<    1   2   3   4   5   6   7   >