[RFC PATCH v3 0/2] LoongArch : Add KVM DINTC support

Song Gao posted 2 patches 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260319112930.2255004-1-gaosong@loongson.cn
Maintainers: Song Gao <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
hw/intc/loongarch_dintc.c         | 13 ++++++
hw/intc/loongarch_dintc_kvm.c     | 48 +++++++++++++++++++++
hw/intc/meson.build               |  2 +
include/hw/intc/loongarch_dintc.h | 10 +++++
linux-headers/asm-loongarch/kvm.h |  4 ++
linux-headers/linux/kvm.h         |  2 +
target/loongarch/cpu.c            |  5 +--
target/loongarch/cpu.h            |  1 +
target/loongarch/kvm/kvm.c        | 69 +++++++++++++++++++++++++++++++
9 files changed, 151 insertions(+), 3 deletions(-)
create mode 100644 hw/intc/loongarch_dintc_kvm.c
[RFC PATCH v3 0/2] LoongArch : Add KVM DINTC support
Posted by Song Gao 2 weeks, 3 days ago
Hi

This series adds KVM put/get support for msgint CSRs and introduces
msgint feature checks. It also adds kvm_dintc_realize() when
kvm_irqchip_in_kernel is enabled, which creates and initializes the DINTC
device in kernel mode. This series uses the  'RFC'tag in the title,
as some required linux headers have not yet been merged upstream.

Test;
1. add kernel patch:
https://patchew.org/linux/20260304013254.2543620-1-maobibo@loongson.cn/
https://patchew.org/linux/20260311085059.1040263-1-gaosong@loongson.cn/

2. run script with '-cpu max,msgint=on' and virt,dmsi=on.
'
./build/qemu-system-loongarch64 -accel kvm \
     -bios /usr/share/edk2/loongarch64/QEMU_EFI-silent-pflash.raw \
     -cpu max,msgint=on\
     -smp 4 \
     -machine virt,dmsi=on,kernel_irqchip=on\
     -m 16G \
     -netdev tap,id=net0,ifname=tap0,script=/root/net.sh,downscript=no,vhost=on,queues=4 \
    -device virtio-net-pci,netdev=net0,mq=on,vectors=128,mac=52:54:00:12:34:56 \
     -monitor telnet:localhost:4418,server,nowait \
    -device virtio-gpu-pci \
    -drive if=none,id=disk0,file=/home/kvm/lns23.qcow2,format=qcow2 \
    -device virtio-blk-pci,drive=disk0,id=virtio_disk0 \
    --nographic
'
3  the vm can work well with with net test, such as netperf or iperf test.

Thanks.
Song Gao

Song Gao (2):
  target/loongarch: Add kvm support dintc
  Add dintc kvm_irqchip_in_kernel support

 hw/intc/loongarch_dintc.c         | 13 ++++++
 hw/intc/loongarch_dintc_kvm.c     | 48 +++++++++++++++++++++
 hw/intc/meson.build               |  2 +
 include/hw/intc/loongarch_dintc.h | 10 +++++
 linux-headers/asm-loongarch/kvm.h |  4 ++
 linux-headers/linux/kvm.h         |  2 +
 target/loongarch/cpu.c            |  5 +--
 target/loongarch/cpu.h            |  1 +
 target/loongarch/kvm/kvm.c        | 69 +++++++++++++++++++++++++++++++
 9 files changed, 151 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/loongarch_dintc_kvm.c

-- 
2.41.0