mbox series

[00/20] Add LoongArch linux-user emulation support

Message ID 1624881885-31692-1-git-send-email-gaosong@loongson.cn
Headers show
Series Add LoongArch linux-user emulation support | expand

Message

gaosong June 28, 2021, 12:04 p.m. UTC
Hi,

This series adds linux-user emulation support for LoongArch.

Patch 1 add an introduction to LoongArch.
Patches 2-5 adds LoongArch basic definition.
Patches 6-18 implements user mode instruction emulation.
Patche 19 add support for disassembling via option '-d in_asm'
Patch 20 add files to linux-user/loongarch64 and support compilling
linux-user binary.

About LoongArch, please see:
   https://github.com/loongson/LoongArch-Documentation

Please review!

thanks

Song Gao (20):
  target/loongarch: Add README
  target/loongarch: Add CSR registers definition
  target/loongarch: Add core definition
  target/loongarch: Add interrupt handling support
  target/loongarch: Add memory management support
  target/loongarch: Add main translation routines
  target/loongarch: Add fixed point arithmetic instruction translation
  target/loongarch: Add fixed point shift instruction translation
  target/loongarch: Add fixed point bit instruction translation
  target/loongarch: Add fixed point load/store instruction translation
  target/loongarch: Add fixed point atomic instruction translation
  target/loongarch: Add fixed point extra instruction translation
  target/loongarch: Add floating point arithmetic instruction
    translation
  target/loongarch: Add floating point comparison instruction
    translation
  target/loongarch: Add floating point conversion instruction
    translation
  target/loongarch: Add floating point 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 linux-user emulation support

 MAINTAINERS                                        |    7 +
 default-configs/targets/loongarch64-linux-user.mak |    4 +
 disas/loongarch.c                                  | 2528 +++++++++++++++++++
 disas/meson.build                                  |    1 +
 include/disas/dis-asm.h                            |    2 +
 include/elf.h                                      |    2 +
 linux-user/elfload.c                               |   58 +
 linux-user/loongarch64/cpu_loop.c                  |  177 ++
 linux-user/loongarch64/signal.c                    |  193 ++
 linux-user/loongarch64/sockbits.h                  |    1 +
 linux-user/loongarch64/syscall_nr.h                |  307 +++
 linux-user/loongarch64/target_cpu.h                |   36 +
 linux-user/loongarch64/target_elf.h                |   14 +
 linux-user/loongarch64/target_fcntl.h              |   12 +
 linux-user/loongarch64/target_signal.h             |   28 +
 linux-user/loongarch64/target_structs.h            |   49 +
 linux-user/loongarch64/target_syscall.h            |   46 +
 linux-user/loongarch64/termbits.h                  |  229 ++
 linux-user/syscall_defs.h                          |    8 +-
 meson.build                                        |    3 +-
 qapi/machine-target.json                           |    4 +-
 target/loongarch/README                            |   16 +
 target/loongarch/cpu-csr.h                         |  724 ++++++
 target/loongarch/cpu-param.h                       |   21 +
 target/loongarch/cpu-qom.h                         |   41 +
 target/loongarch/cpu.c                             |  477 ++++
 target/loongarch/cpu.h                             |  245 ++
 target/loongarch/fpu_helper.c                      | 1436 +++++++++++
 target/loongarch/fpu_helper.h                      |   34 +
 target/loongarch/helper.h                          |  158 ++
 target/loongarch/insns.decode                      |  483 ++++
 target/loongarch/instmap.h                         |  200 ++
 target/loongarch/internal.h                        |  107 +
 target/loongarch/meson.build                       |   19 +
 target/loongarch/op_helper.c                       |  231 ++
 target/loongarch/tlb_helper.c                      |  109 +
 target/loongarch/trans.inc.c                       | 2426 ++++++++++++++++++
 target/loongarch/translate.c                       | 2607 ++++++++++++++++++++
 target/loongarch/translate.h                       |   58 +
 target/meson.build                                 |    1 +
 40 files changed, 13096 insertions(+), 6 deletions(-)
 create mode 100644 default-configs/targets/loongarch64-linux-user.mak
 create mode 100644 disas/loongarch.c
 create mode 100644 linux-user/loongarch64/cpu_loop.c
 create mode 100644 linux-user/loongarch64/signal.c
 create mode 100644 linux-user/loongarch64/sockbits.h
 create mode 100644 linux-user/loongarch64/syscall_nr.h
 create mode 100644 linux-user/loongarch64/target_cpu.h
 create mode 100644 linux-user/loongarch64/target_elf.h
 create mode 100644 linux-user/loongarch64/target_fcntl.h
 create mode 100644 linux-user/loongarch64/target_signal.h
 create mode 100644 linux-user/loongarch64/target_structs.h
 create mode 100644 linux-user/loongarch64/target_syscall.h
 create mode 100644 linux-user/loongarch64/termbits.h
 create mode 100644 target/loongarch/README
 create mode 100644 target/loongarch/cpu-csr.h
 create mode 100644 target/loongarch/cpu-param.h
 create mode 100644 target/loongarch/cpu-qom.h
 create mode 100644 target/loongarch/cpu.c
 create mode 100644 target/loongarch/cpu.h
 create mode 100644 target/loongarch/fpu_helper.c
 create mode 100644 target/loongarch/fpu_helper.h
 create mode 100644 target/loongarch/helper.h
 create mode 100644 target/loongarch/insns.decode
 create mode 100644 target/loongarch/instmap.h
 create mode 100644 target/loongarch/internal.h
 create mode 100644 target/loongarch/meson.build
 create mode 100644 target/loongarch/op_helper.c
 create mode 100644 target/loongarch/tlb_helper.c
 create mode 100644 target/loongarch/trans.inc.c
 create mode 100644 target/loongarch/translate.c
 create mode 100644 target/loongarch/translate.h