[PATCH] fw_cfg: Set the max fw_cfg mem read size to 8 bytes

2021-05-18 Thread Xiaojuan Yang
From: yangxiaojuan fw_cfg_data_read() func supports access widths from 1 to 8 bytes while the ops set the wrong read size. Most arch use 8 bytes to send ram_size to bios. Signed-off-by: yangxiaojuan --- hw/nvram/fw_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[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 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 13/31] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson Platform

2021-10-19 Thread Xiaojuan Yang
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/ls7a.c | 188 + hw/pci

[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

[PATCH 10/31] target/loongarch: Add loongarch interrupt and exception handle

2021-10-19 Thread Xiaojuan Yang
This patch Add loongarch interrupt and exception handle. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 293 + target/loongarch/cpu.h | 6 +- 2 files changed, 298 insertions(+), 1 deletion(-) diff --git a/target

[PATCH 04/31] target/loongarch: Add basic vmstate description of CPU.

2021-10-19 Thread Xiaojuan Yang
This patch introduce vmstate_loongarch_cpu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 12 +++ target/loongarch/internals.h | 4 + target/loongarch/machine.c | 155 +++ target/loongarch/meson.build | 6 ++ 4

[PATCH 15/31] hw/loongarch: Add loongarch cpu interrupt support(CPUINTC)

2021-10-19 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/loongarch_int.c | 62 hw/loongarch/ls3a5000_virt.c | 2 ++ hw/loongarch/meson.build

[PATCH 11/31] target/loongarch: Add stabletimer support

2021-10-19 Thread Xiaojuan Yang
This patch add a stabletimer support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 1 + target/loongarch/cpu.h | 10 + target/loongarch/csr_helper.c | 26 + target/loongarch/meson.build | 1 + target/loongarch

[PATCH 08/31] target/loongarch: Add tlb instruction support

2021-10-19 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 19 + target/loongarch/helper.h| 8 + target/loongarch/insn_trans/trans_core.c | 54

[PATCH 00/31] Add Loongarch softmmu support.

2021-10-19 Thread Xiaojuan Yang
more than 4 cpus. Patch 30-31 Add some functions for debug. Xiaojuan Yang (31): target/loongarch: Upate the README for the softmmu. target/loongarch: Add CSR registers definition target/loongarch: Set default csr values. target/loongarch: Add basic vmstate description of CPU. target

[PATCH 02/31] target/loongarch: Add CSR registers definition

2021-10-19 Thread Xiaojuan Yang
This patch define All the CSR registers and its field. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 493 + 1 file changed, 493 insertions(+) create mode 100644 target/loongarch/cpu-csr.h diff --git a/target

[PATCH 20/31] hw/loongarch: Add irq hierarchy for the system

2021-10-19 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/ls3a5000_virt.c | 49 include/hw/pci-host/ls7a.h | 4 +++ 2 files changed, 53 insertions(+) diff --git a/hw/loongarch

[PATCH 17/31] hw/intc: Add loongarch ls7a interrupt controller support(PCH-PIC)

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

[PATCH 09/31] target/loongarch: Add other core instructions support

2021-10-19 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 1 + target/loongarch/cpu.h | 5 +- target/loongarch/helper.h| 4 ++ target/loongarch/insn_trans

[PATCH 05/31] target/loongarch: Implement qmp_query_cpu_definitions()

2021-10-19 Thread Xiaojuan Yang
This patch introduce qmp_query_cpu_definitions interface. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 28 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/qapi/machine

[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

[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

[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 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

[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 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

[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 16/27] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2021-12-04 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 --- target/loongarch/cpu.c | 28 1 file changed, 28 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loo

[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

[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 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

[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

[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 15/27] hw/loongarch: Add support loongson3-ls7a machine type.

2021-12-04 Thread Xiaojuan Yang
are 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 v3 00/27] Add LoongArch softmmu support.

2021-12-04 Thread Xiaojuan Yang
on the github. 4.Modify some emulate errors when use the kernel from the github. 5.Adjust some format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (27): target/loongarch: Update README target/loongarch: Add CSR registers

[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

[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

[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

[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 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

[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 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 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

[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

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

2021-12-04 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 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

[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

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

2021-11-10 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..6f64bde22f 100644 --- a/target

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

2021-11-10 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/csr_helper.c| 322 ++ target/loongarch/helper.h| 11 + target/loongarch/insn_trans/trans_core.c.inc | 437

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

2021-11-10 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 | 334 + target/loongarch/cpu.c | 12 ++ target/loongarch/cpu.h | 127 ++ 3

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

2021-11-10 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/helper.h| 8 + target/loongarch/insn_trans/trans_core.c.inc | 71 +++ target/loongarch/insns.decode

[RFC PATCH v2 10/30] target/loongarch: Add other core instructions support

2021-11-10 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/helper.h| 4 + target/loongarch/insn_trans/trans_core.c.inc | 62 +++ target

[RFC PATCH v2 15/30] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson Platform

2021-11-10 Thread Xiaojuan Yang
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/ls7a.c | 187 + hw/pci

[RFC PATCH v2 30/30] hw/loongarch: Add Numa support.

2021-11-10 Thread Xiaojuan Yang
1.From Loongson-3A5000 4 cpus belongs to 1 node. Now support mostly 4 nodes 16 cpus. 2.Different nodes access different address spaces. All memory access should be handle correctly even nodes not assigned memory by numa parameters in the command line. Signed-off-by: Xiaojuan Yang Signed

[RFC PATCH v2 16/30] hw/loongarch: Add a virt LoongArch 3A5000 board support

2021-11-10 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 v2 21/30] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

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

[RFC PATCH v2 22/30] hw/loongarch: Add irq hierarchy for the system

2021-11-10 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/ls3a5000_virt.c | 64 include/hw/pci-host/ls7a.h | 4 +++ 2 files changed, 68 insertions(+) diff --git a/hw/loongarch

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

2021-11-10 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/ls3a5000_virt.c | 41 include/hw/loongarch/loongarch.h | 2 ++ 3 files changed, 44 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch

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

2021-11-10 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/ls3a5000_virt.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/ls3a5000_virt.c b/hw/loongarch/ls3a5000_virt.c index 85c8466d75

[RFC PATCH v2 05/30] target/loongarch: Implement qmp_query_cpu_definitions()

2021-11-10 Thread Xiaojuan Yang
This patch introduces 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 | 28 2 files changed, 32 insertions(+), 2 deletions

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

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

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

2021-11-10 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-31. 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 v2 03/30] target/loongarch: Add basic vmstate description of CPU.

2021-11-10 Thread Xiaojuan Yang
This patch introduces vmstate_loongarch_cpu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 4 + target/loongarch/internals.h | 4 + target/loongarch/machine.c | 154 +++ target/loongarch/meson.build | 6 ++ 4

[RFC PATCH v2 00/30] Add Loongarch softmmu support.

2021-11-10 Thread Xiaojuan Yang
the kernel from the github. 5.Adjust some format problem and the Naming problem 6.Others mainly follow Richard'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

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

2021-11-10 Thread Xiaojuan Yang
This patch introduces basic TLB interfaces. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 3 + target/loongarch/cpu.c| 36 target/loongarch/cpu.h| 57 ++ target/loongarch/internals.h | 7 + target/loongarch/machine.c

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

2021-11-10 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/loongarch_int.c | 59 hw/loongarch/ls3a5000_virt.c | 2 ++ hw/loongarch/meson.build

[RFC PATCH v2 04/30] target/loongarch: Define exceptions for LoongArch.

2021-11-10 Thread Xiaojuan Yang
This patch introduces all possible exceptions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 13 + target/loongarch/cpu.h | 17 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu.c b/target

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

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

[RFC PATCH v2 24/30] hw/loongarch: Add LoongArch ls7a rtc device support

2021-11-10 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/ls3a5000_virt.c | 3 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c| 323 +++ hw/rtc

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

2021-11-10 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/ls3a5000_virt.c | 60 +--- hw/loongarch

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

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

[RFC PATCH v2 06/30] target/loongarch: Add stabletimer support

2021-11-10 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h | 11 ++ target/loongarch/meson.build | 1 + target/loongarch/stabletimer.c | 70 ++ 3 files changed, 82 insertions(+) create mode 100644 target/loongarch

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

2021-11-10 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 | 4 +++ target

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

2021-11-10 Thread Xiaojuan Yang
This patch Add loongarch interrupt and exception handle. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 279 + 1 file changed, 279 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index

[RFC PATCH v2 14/30] target/loongarch: Implement privilege instructions disassembly

2021-11-10 Thread Xiaojuan Yang
Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang --- target/loongarch/disas.c | 86 1 file changed, 86 insertions(+) diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c index 1501462991..65aa0443bd 100644 --- a/target/loongarch/disas.c

[RFC PATCH v2 29/30] hw/loongarch: Add machine->possible_cpus

2021-11-10 Thread Xiaojuan Yang
Use possible_cpus for storing possible topology info Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/acpi-build.c| 16 ++-- hw/loongarch/ls3a5000_virt.c | 35 ++- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git

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

2021-11-10 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 | 9 +++ target/loongarch

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

2021-11-10 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

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

2021-11-09 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 | 4 +++ target

[PATCH v2 04/30] target/loongarch: Define exceptions for LoongArch.

2021-11-09 Thread Xiaojuan Yang
This patch introduces all possible exceptions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 13 + target/loongarch/cpu.h | 17 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu.c b/target

[PATCH v2 05/30] target/loongarch: Implement qmp_query_cpu_definitions()

2021-11-09 Thread Xiaojuan Yang
This patch introduces 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 | 28 2 files changed, 32 insertions(+), 2 deletions

[PATCH v2 01/30] target/loongarch: Update README

2021-11-09 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..b307bd4091 100644 --- a/target

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

2021-11-09 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 4 + target/loongarch/internals.h | 4 + target/loongarch/machine.c | 154 +++ target/loongarch/meson.build | 6 ++ 4 files changed, 168 insertions(+) create mode

[PATCH v2 00/30] Add Loongarch softmmu support.

2021-11-09 Thread Xiaojuan Yang
.Others mainly follow Richard's code review comments. Please 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: Define exceptions for LoongArch

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

2021-11-09 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 | 334 + target/loongarch/cpu.c | 12 ++ target/loongarch/cpu.h | 127 ++ 3

[RFC PATCH v6 17/29] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-02-25 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 | 488 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v6 28/29] hw/loongarch: Add fdt support.

2022-02-25 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 v6 11/29] target/loongarch: Add LoongArch interrupt and exception handle

2022-02-25 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| 251

[RFC PATCH v6 05/29] target/loongarch: Add constant timer support

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/constant_timer.c | 62 +++ target/loongarch/cpu.h| 10 + target/loongarch/meson.build | 1 + 3 files changed, 73 insertions(+) create mode 100644 target/loongarch

[RFC PATCH v6 19/29] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-02-25 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 | 417 + hw/intc/meson.build| 1 + hw/intc/trace-events

[RFC PATCH v6 29/29] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-02-25 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 --- MAINTAINERS | 1 + tests/tcg

[RFC PATCH v6 10/29] target/loongarch: Add other core instructions support

2022-02-25 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 + .../insn_trans

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

2022-02-25 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 --- MAINTAINERS | 2 + hw/acpi/Kconfig | 4 + hw/acpi/ls7a.c | 374 ++ hw/acpi

[RFC PATCH v6 00/29] Add LoongArch softmmu support

2022-02-25 Thread Xiaojuan Yang
nto one. 2.Adjust the order of the patch. 3.Put all the binaries on the github. 4.Modify some emulate errors when use the kernel from the github. 5.Adjust some format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (29)

[RFC PATCH v6 26/29] hw/loongarch: Add LoongArch smbios support

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

[RFC PATCH v6 00/29] Add LoongArch softmmu support

2022-02-25 Thread Xiaojuan Yang
nto one. 2.Adjust the order of the patch. 3.Put all the binaries on the github. 4.Modify some emulate errors when use the kernel from the github. 5.Adjust some format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (29)

[RFC PATCH v6 18/29] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI)

2022-02-25 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 v6 13/29] target/loongarch: Add gdb support.

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 43 +++ gdb-xml/loongarch-fpu64.xml | 57 +++ target/loongarch/cpu.c

[RFC PATCH v6 15/29] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2022-02-25 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 | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongar

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

2022-02-25 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

  1   2   3   4   5   6   7   >