MAINTAINERS | 20 + .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64-softmmu.mak | 4 + docs/system/loongarch/loongson3.rst | 37 + gdb-xml/loongarch-base64.xml | 44 + gdb-xml/loongarch-fpu64.xml | 57 ++ hw/Kconfig | 1 + hw/acpi/Kconfig | 4 + hw/acpi/ls7a.c | 374 +++++++++ hw/acpi/meson.build | 1 + hw/intc/Kconfig | 15 + hw/intc/loongarch_extioi.c | 408 ++++++++++ hw/intc/loongarch_ipi.c | 164 ++++ hw/intc/loongarch_pch_msi.c | 75 ++ hw/intc/loongarch_pch_pic.c | 488 +++++++++++ hw/intc/meson.build | 4 + hw/intc/trace-events | 27 + hw/loongarch/Kconfig | 23 + hw/loongarch/acpi-build.c | 636 +++++++++++++++ hw/loongarch/fw_cfg.c | 33 + hw/loongarch/fw_cfg.h | 15 + hw/loongarch/loongson3.c | 752 +++++++++++++++++ hw/loongarch/meson.build | 6 + hw/meson.build | 1 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 323 ++++++++ hw/rtc/meson.build | 1 + include/exec/poison.h | 2 + include/hw/acpi/ls7a.h | 53 ++ include/hw/intc/loongarch_extioi.h | 77 ++ include/hw/intc/loongarch_ipi.h | 47 ++ include/hw/intc/loongarch_pch_msi.h | 21 + include/hw/intc/loongarch_pch_pic.h | 80 ++ include/hw/loongarch/loongarch.h | 75 ++ include/hw/pci-host/ls7a.h | 48 ++ include/sysemu/arch_init.h | 1 + linux-user/loongarch64/cpu_loop.c | 8 +- qapi/machine-target.json | 6 +- qapi/machine.json | 2 +- softmmu/qdev-monitor.c | 3 +- target/Kconfig | 1 + target/loongarch/Kconfig | 2 + target/loongarch/README | 28 + target/loongarch/constant_timer.c | 62 ++ target/loongarch/cpu-csr.h | 236 ++++++ target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c | 363 ++++++++- target/loongarch/cpu.h | 218 ++++- target/loongarch/csr_helper.c | 112 +++ target/loongarch/disas.c | 57 ++ target/loongarch/fpu_helper.c | 2 +- target/loongarch/gdbstub.c | 99 +++ target/loongarch/helper.h | 26 + target/loongarch/insn_trans/trans_extra.c.inc | 36 +- .../insn_trans/trans_privileged.c.inc | 410 ++++++++++ target/loongarch/insns.decode | 44 + target/loongarch/internals.h | 28 + target/loongarch/iocsr_helper.c | 139 ++++ target/loongarch/machine.c | 102 +++ target/loongarch/meson.build | 11 + target/loongarch/op_helper.c | 52 ++ target/loongarch/tlb_helper.c | 767 ++++++++++++++++++ target/loongarch/translate.c | 9 +- tests/tcg/loongarch64/Makefile.softmmu-target | 33 + tests/tcg/loongarch64/system/boot.S | 56 ++ tests/tcg/loongarch64/system/kernel.ld | 30 + tests/tcg/loongarch64/system/regdef.h | 86 ++ 67 files changed, 6922 insertions(+), 31 deletions(-) create mode 100644 configs/devices/loongarch64-softmmu/default.mak create mode 100644 configs/targets/loongarch64-softmmu.mak create mode 100644 docs/system/loongarch/loongson3.rst create mode 100644 gdb-xml/loongarch-base64.xml create mode 100644 gdb-xml/loongarch-fpu64.xml create mode 100644 hw/acpi/ls7a.c create mode 100644 hw/intc/loongarch_extioi.c create mode 100644 hw/intc/loongarch_ipi.c create mode 100644 hw/intc/loongarch_pch_msi.c create mode 100644 hw/intc/loongarch_pch_pic.c create mode 100644 hw/loongarch/Kconfig create mode 100644 hw/loongarch/acpi-build.c create mode 100644 hw/loongarch/fw_cfg.c create mode 100644 hw/loongarch/fw_cfg.h create mode 100644 hw/loongarch/loongson3.c create mode 100644 hw/loongarch/meson.build create mode 100644 hw/rtc/ls7a_rtc.c create mode 100644 include/hw/acpi/ls7a.h create mode 100644 include/hw/intc/loongarch_extioi.h create mode 100644 include/hw/intc/loongarch_ipi.h create mode 100644 include/hw/intc/loongarch_pch_msi.h create mode 100644 include/hw/intc/loongarch_pch_pic.h create mode 100644 include/hw/loongarch/loongarch.h create mode 100644 include/hw/pci-host/ls7a.h create mode 100644 target/loongarch/Kconfig create mode 100644 target/loongarch/constant_timer.c create mode 100644 target/loongarch/cpu-csr.h create mode 100644 target/loongarch/csr_helper.c create mode 100644 target/loongarch/gdbstub.c create mode 100644 target/loongarch/insn_trans/trans_privileged.c.inc create mode 100644 target/loongarch/iocsr_helper.c create mode 100644 target/loongarch/machine.c create mode 100644 target/loongarch/tlb_helper.c create mode 100644 tests/tcg/loongarch64/Makefile.softmmu-target create mode 100644 tests/tcg/loongarch64/system/boot.S create mode 100644 tests/tcg/loongarch64/system/kernel.ld create mode 100644 tests/tcg/loongarch64/system/regdef.h