[PATCH v5 09/11] target/loongarch: CPU enable msg interrupts.

2025-07-11 Thread Song Gao
when loongarch cpu set irq is INT_AVEC, we need set CSR_ESTAT.MSGINT bit. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- target/loongarch/cpu.c | 10 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch

[PATCH v5 08/11] hw/loongarch: Implement avec set irq

2025-07-11 Thread Song Gao
Implement avec set irq and update CSR_MSIS. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index 1f9f376898..af6c75c4a9 100644 --- a

[PATCH v5 10/11] target/loongarch:Implement csrrd CSR_MSGIR register

2025-07-11 Thread Song Gao
implement the read-clear feature for CSR_MSGIR register. Signed-off-by: Song Gao --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c | 21 +++ target/loongarch/tcg/helper.h | 1 + .../tcg/insn_trans

[PATCH v5 06/11] hw/loongarch: AVEC controller add a MemoryRegion

2025-07-11 Thread Song Gao
the AVEC controller use [2fe0-2ff00) Memory. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 24 hw/loongarch/virt.c | 39 +++- include/hw/intc/loongarch_avec.h | 1 + include/hw/loongarch/virt.h | 1

[PATCH v5 11/11] hw/loongarch: Implement AVEC plug/unplug interfaces

2025-07-11 Thread Song Gao
when cpu added, connect avec irq to cpu INT_AVEC irq pin. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 71 hw/loongarch/virt.c | 11 +++ 2 files changed, 82 insertions(+) diff --git a/hw/intc/loongarch_avec.c b/hw/intc

[PATCH v5 05/11] target/loongarch: add msg interrupt CSR registers

2025-07-11 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.h | 10 ++ target/loongarch/machine.c | 27 +-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/target

[PATCH v5 01/11] target/loongarch: move some machine define to virt.h

2025-07-11 Thread Song Gao
move some machine define to virt.h Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- include/hw/loongarch/virt.h | 19 +++ target/loongarch/cpu.h | 21 - 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/include/hw/loongarch/virt.h b

[PATCH v5 00/11] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-07-11 Thread Song Gao
into one patch8; 4: Fix patch7 get wrong cpu_num and irq_num; 5: Add vmstate_msg for messag-interrupt registers migrate; 6: Update test scripts use '-bios', because kernel use avec need acpi support. the bios is qemu/pc_bios/edk2-loongarch64-code.fd.bz2. Thanks. Song Gao Song G

[PATCH v5 04/11] loongarch: add a advance interrupt controller device

2025-07-11 Thread Song Gao
Add Loongarch advance interrupt controller device base Definition. Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_avec.c | 68 hw/intc/meson.build | 1 + hw/loongarch/Kconfig | 1

[PATCH v5 07/11] hw/loongarch: Implement avec controller imput and output pins

2025-07-11 Thread Song Gao
the AVEC controller supports 256*256 irqs input, all the irqs connect CPU INT_AVEC irq Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 20 hw/loongarch/virt.c | 11 +-- target/loongarch/cpu.h | 3 ++- 3 files changed, 31 insertions(+), 3 deletions

[PATCH v5 02/11] hw/loongarch: add virt feature avecintc support

2025-07-11 Thread Song Gao
default avec feature bit. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 30 ++ include/hw/loongarch/virt.h | 14 ++ 2 files changed, 44 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index b15ada2078..112cf9a9db 100644 --- a

[PATCH v5 03/11] hw/loongarch: add misc register supoort avecintc

2025-07-11 Thread Song Gao
Add feature register and misc register for avecintc feature checking and setting Signed-off-by: Song Gao --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 112cf9a9db..0d05404eb5 100644 --- a/hw/loongarch

[PATCH v4 07/11] hw/loongarch: Implement avec controller imput and output pins

2025-07-03 Thread Song Gao
the AVEC controller supports 256*256 irqs input, all the irqs connect CPU INT_AVEC irq Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 20 hw/loongarch/virt.c | 11 +-- target/loongarch/cpu.h | 3 ++- 3 files changed, 31 insertions(+), 3 deletions

[PATCH v4 05/11] target/loongarch: add msg interrupt CSR registers

2025-07-03 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.h | 10 ++ target/loongarch/machine.c | 27 +-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/target

[PATCH v4 03/11] hw/loongarch: add misc register supoort avecintc

2025-07-03 Thread Song Gao
Add write misc avecintc status bit and read avecintc feature and status bit. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 112cf9a9db..26db1bbd68 100644 --- a/hw/loongarch/virt.c

[PATCH v4 02/11] hw/loongarch: add virt feature avecintc support

2025-07-03 Thread Song Gao
-off-by: Song Gao --- hw/loongarch/virt.c | 30 ++ include/hw/loongarch/virt.h | 13 + 2 files changed, 43 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index b15ada2078..112cf9a9db 100644 --- a/hw/loongarch/virt.c +++ b/hw

[PATCH v4 04/11] loongarch: add a advance interrupt controller device

2025-07-03 Thread Song Gao
Add Loongarch advance interrupt controller device base Definition. Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_avec.c | 68 hw/intc/meson.build | 1 + hw/loongarch/Kconfig | 1

[PATCH v4 10/11] target/loongarch:Implement csrrd CSR_MSGIR register

2025-07-03 Thread Song Gao
implement the read-clear feature for CSR_MSGIR register. Signed-off-by: Song Gao --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c | 22 +++ target/loongarch/tcg/helper.h | 1 + .../tcg/insn_trans

[PATCH v4 00/11] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-07-03 Thread Song Gao
me code style; 3: Merge patch8 and patch9 into one patch8; 4: Fix patch7 get wrong cpu_num and irq_num; 5: Add vmstate_msg for messag-interrupt registers migrate; 6: Update test scripts use '-bios', because kernel use avec need acpi support. the bios is qemu/pc_bios/edk2-loongarch

[PATCH v4 11/11] hw/loongarch: Implement AVEC plug/unplug interfaces

2025-07-03 Thread Song Gao
when cpu added, connect avec irq to cpu INT_AVEC irq pin. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 71 hw/loongarch/virt.c | 7 2 files changed, 78 insertions(+) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c

[PATCH v4 09/11] target/loongarch: CPU enable msg interrupts.

2025-07-03 Thread Song Gao
when loongarch cpu set irq is INT_AVEC, we need set CSR_ESTAT.MSGINT bit and CSR_ECFG.MSGINT bit. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- target/loongarch/cpu.c | 10 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu

[PATCH v4 06/11] hw/loongarch: AVEC controller add a MemoryRegion

2025-07-03 Thread Song Gao
the AVEC controller use [2fe0-2ff00) Memory. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 24 hw/loongarch/virt.c | 39 +++- include/hw/intc/loongarch_avec.h | 1 + include/hw/loongarch/virt.h | 1

[PATCH v4 08/11] hw/loongarch: Implement avec set irq

2025-07-03 Thread Song Gao
Implement avec set irq and update CSR_MSIS. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index 1f9f376898..8ccd6092e6 100644 --- a

[PATCH v4 01/11] target/loongarch: move some machine dfine to virt.h

2025-07-03 Thread Song Gao
move some machine define to virt.h Signed-off-by: Song Gao --- include/hw/loongarch/virt.h | 19 +++ target/loongarch/cpu.h | 21 - 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h

[PATCH v3 8/9] target/loongarch: CPU enable msg interrupts.

2025-06-26 Thread Song Gao
when loongarch cpu set irq is INT_AVEC, we need set CSR_ESTAT.MSGINT bit and CSR_ECFG.MSGINT bit. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- target/loongarch/cpu.c | 10 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu

[PATCH v3 0/9] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-06-26 Thread Song Gao
qemu/pc_bios/edk2-loongarch64-code.fd.bz2. v2: 1: Use one irqline for avec parent_irq; 2; Correct avec memroy area; 3; Pch-msi not connecet to avec when avec is enabled and drop patch 7; 4: Add misc_feature and misc_status for misc features an misc Thanks. Song Gao Song Gao (9): hw/loongarch

[PATCH v3 7/9] hw/loongarch: Implement avec set irq

2025-06-26 Thread Song Gao
Implement avec set irq and update CSR_MSIS and CSR_MSGIR. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index c686ac9483

[PATCH v3 4/9] target/loongarch: add msg interrupt CSR registers

2025-06-26 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.c | 7 +++ target/loongarch/cpu.h | 10 ++ target/loongarch/machine.c | 25 +++-- 4 files changed, 43 insertions(+), 2

[PATCH v3 9/9] target/loongarch:Implement csrrd CSR_MSGIR register

2025-06-26 Thread Song Gao
implement the read-clear feature for CSR_MSGIR register. Signed-off-by: Song Gao --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c | 21 +++ target/loongarch/tcg/helper.h | 1 + .../tcg/insn_trans

[PATCH v3 1/9] hw/loongarch: move some machine define to virt.h

2025-06-26 Thread Song Gao
]:https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-loongarch-avec.c Signed-off-by: Song Gao --- hw/loongarch/virt.c | 4 include/hw/loongarch/virt.h | 20 target/loongarch/cpu.h | 21 - 3 files changed, 24 insertions

[PATCH v3 3/9] loongarch: add a advance interrupt controller device

2025-06-26 Thread Song Gao
Add Loongarch advance interrupt controller device base Definition. Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_avec.c | 68 hw/intc/meson.build | 1 + hw/loongarch/Kconfig | 1

[PATCH v3 5/9] hw/loongarch: AVEC controller add a MemoryRegion

2025-06-26 Thread Song Gao
the AVEC controller use [2fe0-2ff00) Memory. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 24 hw/loongarch/virt.c | 39 +++- include/hw/intc/loongarch_avec.h | 1 + include/hw/loongarch/virt.h | 1

[PATCH v3 6/9] hw/loongarch: Implement avec controller imput and output pins

2025-06-26 Thread Song Gao
the AVEC controller supports 256*256 irqs input, all the irqs connect CPU INT_AVEC irq Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 21 + hw/loongarch/virt.c | 11 +-- target/loongarch/cpu.h | 3 ++- 3 files changed, 32 insertions(+), 3 deletions

[PATCH v3 2/9] hw/loongarch: add virt feature avecintc support

2025-06-26 Thread Song Gao
. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 43 + include/hw/loongarch/virt.h | 15 + 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 6a169d4824..426eaaef84 100644 --- a/hw

[PULL 10/14] hw/loongarch/virt: Add reset support for kernel irqchip

2025-06-19 Thread Song Gao
used to notify kvm to reload register state. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-11-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_extioi.c | 4 hw/intc/loongarch_extioi_kvm.c | 4 hw/intc/loongarch_ipi.c

[PULL 08/14] hw/intc/loongarch_pch: Add kernel irqchip save and restore function

2025-06-19 Thread Song Gao
From: Bibo Mao Add save and store funtction if kvm_irqchip_in_kernel() return true, it is to get and set PCH PCI irqchip state from KVM kernel. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-9-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PULL 11/14] target/loongarch: Report error with split kernel_irqchip option

2025-06-19 Thread Song Gao
From: Bibo Mao Option kernel_irqchip=split is not supported on LoongArch virt machine, report error and exit if detect split kernel_irqchip option. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063431.2557468-1-maob...@loongson.cn> Signed-off-by: Song Gao ---

[PULL 01/14] hw/intc/loongarch_extioi: Add kernel irqchip realize function

2025-06-19 Thread Song Gao
From: Bibo Mao Function kvm_extioi_realize() is added if kvm_irqchip_in_kernel is set. It is to create and initialize ExtIOI device in kernel mode. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-2-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PULL 05/14] hw/intc/loongarch_ipi: Add kernel irqchip save and restore function

2025-06-19 Thread Song Gao
From: Bibo Mao Add save and store funtction if kvm_irqchip_in_kernel() return true, it is to get and set IPI irqchip state from KVM kernel. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-6-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PULL 03/14] hw/intc/loongarch_ipi: Add kernel irqchip realize function

2025-06-19 Thread Song Gao
From: Bibo Mao Function kvm_ipi_realize() is added if kvm_irqchip_in_kernel() return true. It is to create and initialize IPI device in kernel mode. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-4-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PULL 12/14] hw/loongarch/virt: Disable emulation with IOCSR misc register

2025-06-19 Thread Song Gao
From: Bibo Mao Register IOCSR MISC_FUNC_REG is to enable features about EXTIOI irqchip. If EXTIOI is emulated in kernel, MISC_FUNC_REG register should be emulated in kernel also. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063523.2557513-1-maob...@loongson.cn>

[PULL 06/14] hw/intc/loongarch_pch_msi: Inject MSI interrupt to kernel

2025-06-19 Thread Song Gao
From: Bibo Mao If kvm_irqchip_in_kernel() return true, MSI interrupt can be injected with API kvm_irqchip_send_msi() to KVM. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-7-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_pch_msi.

[PULL 14/14] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-19 Thread Song Gao
/3A5000 we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Fixes: 29bb5d727ff ("target/loongarch: Implement vldi") Cc: qemu-sta...@nongnu.org Reviewed-by: Bibo Mao Reviewed-by: Richard Henderson Signed-off-by: Song Gao ---

[PULL 09/14] hw/intc/loongarch_pch: Inject irq line interrupt to kernel

2025-06-19 Thread Song Gao
From: Bibo Mao If kvm_irqchip_in_kernel() return true, irq line interrupt can be injected with API kvm_set_irq() to KVM. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-10-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_pch_pic

[PULL 07/14] hw/intc/loongarch_pch: Add kernel irqchip realize function

2025-06-19 Thread Song Gao
From: Bibo Mao Function kvm_pic_realize() is added if kvm_irqchip_in_kernel() return true. It is to notify KVM kernel to create and initialize PCH PCI device in kernel mode. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-8-maob...@loongson.cn> Signed-

[PULL 04/14] hw/intc/loongson_ipi: Add load and save interface with ipi_common class

2025-06-19 Thread Song Gao
From: Bibo Mao Add pre_save and post_load interfaces with ipi_common class, here only framework ipi_common adds these interfaces. The defailed implementation is LoongArchIPI child device in later. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-5-m

[PULL 00/14] loongarch-to-apply queue

2025-06-19 Thread Song Gao
Add kernel irqchip support Song Gao (1): target/loongarch: fix vldi/xvldi raise wrong error hw/intc/loongarch_extioi.c | 49 +++-- hw/intc/loongarch_extioi_kvm.c | 140 hw/intc/loongarch_ipi.c | 29

[PULL 13/14] hw/loongarch/virt: Add kernel irqchip support

2025-06-19 Thread Song Gao
From: Bibo Mao If kvm_irqchip_in_kernel() return true, interrupt controller ExtIOI, IPI, PCH_PCI and PCH_MSI should be emlated in kernel. And it is not necessary to create memory region for these devices in user space. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID

[PULL 02/14] hw/intc/loongarch_extioi: Add kernel irqchip save and restore function

2025-06-19 Thread Song Gao
From: Bibo Mao Add save and store funtction if kvm_irqchip_in_kernel() return true, it is to get and set ExtIOI irqchip state from KVM kernel. Reviewed-by: Song Gao Signed-off-by: Bibo Mao Message-ID: <20250606063033.2557365-3-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PATCH v2 9/9] target/loongarch: CSR_ECFG enable msg interrupt

2025-06-18 Thread Song Gao
when loongarch cpu set irq is INT_AVEC, we need set CSR_ECFG MSGINT bit. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 5 +++-- target/loongarch/cpu.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h

[PATCH v2 2/9] loongarch: add virt feature avecintc support

2025-06-18 Thread Song Gao
-off-by: Song Gao --- hw/loongarch/virt.c | 43 + include/hw/loongarch/virt.h | 15 + 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 90d4643721..3ad165af36 100644 --- a/hw

[PATCH v2 8/9] target/loongarch: CSR_ESTAT enable msg interrupts.

2025-06-18 Thread Song Gao
when loongarch cpu set irq is INT_AVEC, we need set CSR_ESTAT.MSGINT bit. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 1 + target/loongarch/cpu.c | 9 + 2 files changed, 10 insertions(+) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index

[PATCH v2 6/9] hw/loongarch: Implement avec controller imput and output pins

2025-06-18 Thread Song Gao
the AVEC controller supports 256*256 irqs input, all the irqs connect CPU INT_AVEC irq Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 21 + hw/loongarch/virt.c | 11 +-- target/loongarch/cpu.h | 3 ++- 3 files changed, 32 insertions(+), 3 deletions

[PATCH v2 4/9] target/loongarch: add msg interrupt CSR registers

2025-06-18 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 7 +++ target/loongarch/cpu.h | 10 ++ target/loongarch/machine.c | 5 + 3 files changed, 22 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c

[PATCH v2 1/9] hw/loongarch: move some machine define to virt.h

2025-06-18 Thread Song Gao
]:https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-loongarch-avec.c Signed-off-by: Song Gao --- hw/loongarch/virt.c | 4 include/hw/loongarch/virt.h | 20 target/loongarch/cpu.h | 21 - 3 files changed, 24 insertions

[PATCH v2 5/9] hw/loongarch: AVEC controller add a MemoryRegion

2025-06-18 Thread Song Gao
the AVEC controller use [2fe0-2ff00) Memory. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 25 hw/loongarch/virt.c | 39 +++- include/hw/intc/loongarch_avec.h | 1 + include/hw/loongarch/virt.h | 1

[PATCH v2 7/9] hw/loongarch: Implement avec set irq

2025-06-18 Thread Song Gao
Implement avec set irq and update CSR_MSIS and CSR_MSGIR. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index 7dd8bac696..bbd1b48c7d

[PATCH v2 0/9] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-06-18 Thread Song Gao
n avec is enabled and drop patch 7; 4: Add misc_feature and misc_status for misc features an misc fetures status 5: Define CSR_ESTAT and CSR_ECFG bit15 for msg interupt. clean patch9. 6: Fix test demsg error. Thanks. Song Gao Song Gao (9): hw/loongarch: move some machine define

[PATCH v2 3/9] loongarch: add a advance interrupt controller device

2025-06-18 Thread Song Gao
Add Loongarch advance interrupt controller device base Definition. Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_avec.c | 68 hw/intc/meson.build | 1 + hw/loongarch/Kconfig | 1

[PULL 4/7] hw/loongarch/virt: inform guest of kvm

2025-06-10 Thread Song Gao
From: Qiang Ma Commit bab27ea2e3 ("hw/arm/virt: smbios: inform guest of kvm") fixes the same issue on arm. without this patch: [root@localhost ~]# virt-what qemu with this patch: [root@localhost ~]# virt-what kvm Signed-off-by: Qiang Ma Reviewed-by: Bibo Mao Reviewed-by: Song Ga

[PULL 0/7] loongarch-to-apply queue

2025-06-10 Thread Song Gao
garch/virt: Remove global variables about initrd hw/loongarch/virt: Remove global variables about memmap tables Qiang Ma (1): hw/loongarch/virt: inform guest of kvm Song Gao (1): target/loongarch: add check for fcond hw/intc/loongarch_pch_pic.c | 2 +- hw

[PULL 3/7] hw/intc/loongarch_extioi: Fix typo issue about register EXTIOI_COREISR_END

2025-06-10 Thread Song Gao
Reviewed-by: Song Gao Message-Id: <20250605092848.1550985-1-maob...@loongson.cn> Signed-off-by: Song Gao --- include/hw/intc/loongarch_extioi_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/intc/loongarch_extioi_common.h b/include/h

[PULL 2/7] hw/intc/loongarch_pch: Convert to little endian with ID register

2025-06-10 Thread Song Gao
g endian host machine with TCG method. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250604065502.1114098-3-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_pch_pic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/loongarch_

[PULL 5/7] target/loongarch: add check for fcond

2025-06-10 Thread Song Gao
fcond only has 22 types, add a check for fcond. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2972 Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-Id: <20250603024810.350510-1-gaos...@loongson.cn> --- .../loongarch/tcg/insn_trans/trans_fcmp.c.in

[PULL 1/7] hw/loongarch/virt: Fix big endian support with MCFG table

2025-06-10 Thread Song Gao
big endian host machine S390. Fixes: 735143f10d3e ("hw/loongarch: Add acpi ged support") Cc: qemu-sta...@nongnu.org Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250604065502.1114098-2-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/loongarch/virt-acpi-build.c

[PULL 7/7] hw/loongarch/virt: Remove global variables about memmap tables

2025-06-10 Thread Song Gao
From: Bibo Mao Global variables memmap_table and memmap_entries stores UEFI memory map table informations. It can be moved into structure LoongArchVirtMachineState. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250430094738.1556670-3-maob...@loongson.cn> Signed-off-by: So

[PULL 6/7] hw/loongarch/virt: Remove global variables about initrd

2025-06-10 Thread Song Gao
From: Bibo Mao Global variables initrd_offset and initrd_size records loading information about initrd, it can be moved to structure loongarch_boot_info. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20250430094738.1556670-2-maob...@loongson.cn> Signed-off-by

[PATCH 10/10] target/loongarch: cpu do interrupt support msg interrupt.

2025-06-09 Thread Song Gao
we use CSR_ESTAT and CSR_ECFG bit 15 for msg interrupt. and loongarch_cpu_do_interrupt support msg interrupts. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 ++- target/loongarch/cpu.c | 35 ++- 2 files changed, 32 insertions(+), 6 deletions

[PATCH 01/10] hw/loongarch: add a new type iocsr read for Avdance interrupt controller

2025-06-09 Thread Song Gao
-loongarch-avec.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 4 target/loongarch/cpu.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 1b504047db..90d4643721 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -548,6 +548,8

[PATCH 04/10] target/loongarch: add msg interrupt CSR registers

2025-06-09 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 7 +++ target/loongarch/cpu.h | 10 ++ target/loongarch/machine.c | 5 + 3 files changed, 22 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c

[PATCH 05/10] hw/loongarch: AVEC controller add a MemoryRegion

2025-06-09 Thread Song Gao
the AVEC controller use 2ff0-2fff Memory. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 25 hw/loongarch/virt.c | 39 +++- include/hw/intc/loongarch_avec.h | 1 + include/hw/loongarch/virt.h | 1 + 4

[PATCH 07/10] hw/loongarch: connect pch_msi controller to avec controller

2025-06-09 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/virt.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 718b5b4f92..6b670e7936 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -503,11 +503,19 @@ static

[PATCH 09/10] target/loongarch: loongarch CPU supoort avec irqs

2025-06-09 Thread Song Gao
Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 1 + target/loongarch/cpu.c | 17 + 2 files changed, 18 insertions(+) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 0834e91f30..83f6cb081a 100644 --- a/target/loongarch/cpu-csr.h +++ b

[PATCH 03/10] loongarch: add a advance interrupt controller device

2025-06-09 Thread Song Gao
Add Loongarch advance interrupt controller device base Definition. Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_avec.c | 68 hw/intc/meson.build | 1 + hw/loongarch/Kconfig | 1

[PATCH 06/10] hw/loongarch: Implement avec controller imput and output pins

2025-06-09 Thread Song Gao
the AVEC controller supports 256*256 irqs, all the irqs connect CPU INT_AVEC irq Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 28 hw/loongarch/virt.c | 11 +-- target/loongarch/cpu.h | 3 ++- 3 files changed, 39 insertions(+), 3 deletions

[PATCH 00/10] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-06-09 Thread Song Gao
h Feel free to point out any flaws! thanks. Song Gao Song Gao (10): hw/loongarch: add a new type iocsr read for Avdance interrupt controller loongarch: add virt feature avecintc support loongarch: add a advance interrupt controller device target/loongarch: add msg interrupt CSR reg

[PATCH 08/10] hw/loongarch: Implement avec set_irq

2025-06-09 Thread Song Gao
Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index c692fef43c..f609ed9aaa 100644 --- a/hw/intc/loongarch_avec.c +++ b/hw/intc

[PATCH 02/10] loongarch: add virt feature avecintc support

2025-06-09 Thread Song Gao
LoongArchVirtMachinState add avecintc features, and it use to check whether virt machine support advance interrupt controller and default is on. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 31 +++ include/hw/loongarch/virt.h | 9 + 2 files

[PATCH v6] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-04 Thread Song Gao
/3A5000 we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Fixes: 29bb5d727ff ("target/loongarch: Implement vldi") Cc: qemu-sta...@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Song Gao --- target/loongarch/tcg/insn_t

[PATCH v5] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-04 Thread Song Gao
/3A5000 we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Fixes: 29bb5d727ff ("target/loongarch: Implement vldi") Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 12 ++-- 1 file changed,

[PATCH v4] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-03 Thread Song Gao
we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/target/loongarch/tcg/

[PATCH v3] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-03 Thread Song Gao
we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target/loongarch/tcg/

[PATCH v2] target/loongarch: add check for fcond

2025-06-02 Thread Song Gao
fcond only has 22 types, add a check for fcond. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2972 Signed-off-by: Song Gao --- .../loongarch/tcg/insn_trans/trans_fcmp.c.inc | 25 +-- .../loongarch/tcg/insn_trans/trans_vec.c.inc | 16 +--- 2 files changed, 30

[PATCH v2] target/loongarch: fix vldi/xvldi raise wrong error

2025-06-02 Thread Song Gao
we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/target/loongarch/tcg/

[PATCH] target/loongarch: add check for fcond

2025-05-22 Thread Song Gao
fcond only has 22 types, add a check for fcond. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2972 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_fcmp.c.inc | 11 --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 4 ++-- 2 files changed, 10 insertions

[PATCH 1/1] target/loongarch: fix vldi/xvldi raise wrong error

2025-05-22 Thread Song Gao
we got a "Illegal instruction" error. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/loongarch/tcg/insn_trans/trans_ve

[PULL 11/17] hw/intc/loongarch_pch: Use generic write callback for iomem32_high region

2025-05-14 Thread Song Gao
From: Bibo Mao Add iomem32_high region register write operation emulation in generic write function loongarch_pch_pic_write(), and use this function for iomem32_high region. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023148.1877287-12-maob...@loongson.cn> Signed-

[PULL 17/17] hw/loongarch/boot: Adjust the loading position of the initrd

2025-05-14 Thread Song Gao
.cn> Signed-off-by: Song Gao --- hw/loongarch/boot.c | 52 + 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 0324d6adcb..9b6292eaa1 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/

[PULL 16/17] hw/intc/loongarch_pch: Merge three memory region into one

2025-05-14 Thread Song Gao
From: Bibo Mao Since memory region iomem supports memory access size with 1/2/4/8, it can be used for memory region iomem8 and iomem32_high. Now remove memory region iomem8 and iomem32_high, merge them into iomem together. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id

[PULL 15/17] hw/intc/loongarch_pch: Set flexible memory access size with iomem region

2025-05-14 Thread Song Gao
From: Bibo Mao The original iomem region only supports 4 bytes access size, set it ok with 1/2/4/8 bytes. Also unaligned memory access is not supported. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023754.1877445-4-maob...@loongson.cn> Signed-off-by: Song Gao -

[PULL 01/17] hw/intc/loongarch_pch: Modify name of some registers

2025-05-14 Thread Song Gao
Mao Reviewed-by: Clement Mathieu--Drif Reviewed-by: Song Gao Message-Id: <20250507023148.1877287-2-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_pch_pic.c| 50 +- hw/loongarch/virt.c| 2 +- include/h

[PULL 00/17] loongarch-to-apply queue

2025-05-14 Thread Song Gao
The following changes since commit 69ee0189d7977cfbb1b2c7a27393d8b9fb661b20: Merge tag 'qtest-20250509-pull-request' of https://gitlab.com/farosas/qemu into staging (2025-05-12 11:11:37 -0400) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongarch

[PULL 04/17] hw/intc/loongarch_pch: Set version information at initial stage

2025-05-14 Thread Song Gao
From: Bibo Mao Register PCH_PIC_INT_ID constains version and supported irq number information, and it is read only register. The detailed value can be set at initial stage, rather than read callback. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023148.1877287-5-m

[PULL 09/17] hw/intc/loongarch_pch: Use generic read callback for iomem8 region

2025-05-14 Thread Song Gao
From: Bibo Mao Add iomem8 region register read operation emulation in generic read function loongarch_pch_pic_read(), and use this function for iomem8 region. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023148.1877287-10-maob...@loongson.cn> Signed-off-by: So

[PULL 05/17] hw/intc/loongarch_pch: Use relative address in MemoryRegionOps

2025-05-14 Thread Song Gao
From: Bibo Mao Parameter address for read and write callback in MemoryRegionOps is relative offset with base address of this MemoryRegionOps. It can be directly used as offset and offset calculation can be removed. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id

[PULL 02/17] hw/intc/loongarch_pch: Modify register name PCH_PIC_xxx_OFFSET with PCH_PIC_xxx

2025-05-14 Thread Song Gao
From: Bibo Mao Macro PCH_PIC_HTMSI_VEC_OFFSET and PCH_PIC_ROUTE_ENTRY_OFFSET is renamed as PCH_PIC_HTMSI_VEC and PCH_PIC_ROUTE_ENTRY separately, it is easier to understand. Signed-off-by: Bibo Mao Reviewed-by: Clement Mathieu--Drif Reviewed-by: Song Gao Message-Id: <20250507023148.187728

[PULL 14/17] hw/intc/loongarch_pch: Rename memory region iomem32_low with iomem

2025-05-14 Thread Song Gao
ed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023754.1877445-3-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/intc/loongarch_pch_pic.c| 26 +++--- include/hw/intc/loongarch_pic_common.h | 2 +- 2 files changed, 8 insertions(+), 20 del

[PULL 12/17] hw/intc/loongarch_pch: Use generic write callback for iomem8 region

2025-05-14 Thread Song Gao
From: Bibo Mao Add iomem8 region register write operation emulation in generic write function loongarch_pch_pic_write(), and use this function for iomem8 region. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023754.1877445-1-maob...@loongson.cn> Signed-off-by: So

[PULL 08/17] hw/intc/loongarch_pch: Use generic read callback for iomem32_high region

2025-05-14 Thread Song Gao
From: Bibo Mao Add register read operation emulation in generic read function loongarch_pch_pic_read(), and use this function for iomem32_high region. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023148.1877287-9-maob...@loongson.cn> Signed-off-by: Song Gao --- h

[PULL 03/17] hw/intc/loongarch_pch: Remove some duplicate macro

2025-05-14 Thread Song Gao
From: Bibo Mao The meaning of macro definition STATUS_LO_START is simliar with PCH_PIC_INT_STATUS, only that offset is different, the same for macro POL_LO_START. Now remove these duplicated macro definitions. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20250507023148.187728

  1   2   3   4   5   6   7   8   9   10   >