This patch implements Loongson VirtualiZation (LVZ) extension support for LoongArch's TCG target. With this patch, it is now possible to start a nested KVM-accelerated virtual machine on a TCG-emulated virtual machine.
Cc: Bibo Mao <[email protected]> Cc: xianglai li <[email protected]> Signed-off-by: SignKirigami <[email protected]> Signed-off-by: Hengyu Yu <[email protected]> SignKirigami (4): target/loongarch: add LVZ CPU state and CSR metadata target/loongarch: add LVZ guest runtime support target/loongarch: translate LVZ CSR and trap instructions target/loongarch: virtualize guest TLB and address translation target/loongarch/cpu-csr.h | 42 ++ target/loongarch/cpu-mmu.h | 37 +- target/loongarch/cpu.c | 132 ++++ target/loongarch/cpu.h | 125 +++- target/loongarch/cpu_helper.c | 119 ++-- target/loongarch/csr.c | 122 ++++ target/loongarch/csr.h | 3 + target/loongarch/disas.c | 10 + target/loongarch/insns.decode | 17 + target/loongarch/internals.h | 8 +- target/loongarch/kvm/kvm.c | 1 + target/loongarch/machine.c | 249 ++++--- target/loongarch/tcg/constant_timer.c | 62 +- target/loongarch/tcg/csr_helper.c | 127 +++- target/loongarch/tcg/helper.h | 30 +- .../tcg/insn_trans/trans_privileged.c.inc | 353 +++++++++- target/loongarch/tcg/op_helper.c | 83 ++- target/loongarch/tcg/tcg_cpu.c | 182 +++-- target/loongarch/tcg/tcg_loongarch.h | 6 +- target/loongarch/tcg/tlb_helper.c | 629 +++++++++++++----- target/loongarch/tcg/translate.c | 6 +- target/loongarch/translate.h | 2 + 22 files changed, 1909 insertions(+), 436 deletions(-) -- 2.52.0
