[RFC PATCH] target/loongarch: Add kvm support dintc

2025-10-15 Thread Song Gao
This patch adds set/get msgint CSRs and check msgint feature. Signed-off-by: Song Gao --- RFC: this patch need update linux-headers and the linux kernel kvm support avec(not merged). linux-headers/asm-loongarch/kvm.h | 1 + target/loongarch/cpu.h| 1 + target/loongarch/kvm/kvm.c

[PULL 1/6] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*

2025-10-13 Thread Song Gao
From: Huacai Chen Signed-off-by: Huacai Chen Reviewed-by: Message-ID: <20250923143542.2391576-2-chenhua...@kernel.org> Signed-off-by: Song Gao --- tests/qtest/bios-tables-test-allowed-diff.h | 4 1 file changed, 4 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-

[PULL 4/6] target/loongarch: Move TCG specified functions to tcg_cpu.c

2025-10-11 Thread Song Gao
: <20250929035338.2320419-2-maob...@loongson.cn> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 262 +- target/loongarch/internals.h | 2 + target/loongarch/tcg/meson.build | 1 + target/loongarch/tcg/tcg_cpu.c | 266 +++

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

2025-10-09 Thread Song Gao
The following changes since commit 37ad0e48e9fd58b170abbf31c18a994346f62ed7: Merge tag 'pull-10.2-maintainer-071025-1' of https://gitlab.com/stsquad/qemu into staging (2025-10-07 08:46:28 -0700) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongar

[PULL 5/6] target/loongarch: Move function do_raise_exception() to tcg_cpu.c

2025-10-09 Thread Song Gao
aob...@loongson.cn> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 56 -- target/loongarch/tcg/tcg_cpu.c | 56 ++ 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c

[PULL v2 04/11] loongarch: add a direct interrupt controller device

2025-10-02 Thread Song Gao
Add Loongarch direct interrupt controller device base Definition. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-5-gaos...@loongson.cn> --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_dintc.c | 68 +

[PULL v2 06/11] hw/loongarch: DINTC add a MemoryRegion

2025-09-28 Thread Song Gao
the DINTC use [2fe0-2ff0) Memory. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-7-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 24 +++ hw/loongarch/virt.c | 38 ++- incl

[PULL v2 05/11] target/loongarch: add msg interrupt CSR registers

2025-09-28 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-6-gaos...@loongson.cn> --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.h | 11 +++ target/loongarch/machine.

[PULL v2 07/11] hw/loongarch: Implement dintc realize and unrealize

2025-09-28 Thread Song Gao
Implement th DINTC realize and unrealize. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-8-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 23 ++- target/loongarch/cpu.h| 3 ++- 2 files changed, 24 insertions(+), 2 del

[PULL v2 02/11] hw/loongarch: add virt feature dmsi support

2025-09-28 Thread Song Gao
dintc feature bit. Msgint feature is added in LoongArchCPU, and it is used to check whether th cpu supports the Message-Interrupts and by default set mesgint with ON_OFF_AUTO_AUTO. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-3-gaos...@loongson.cn> -

[PULL v2 11/11] hw/loongarch: Implement DINTC plug/unplug interfaces

2025-09-28 Thread Song Gao
when cpu added, connect dintc irq to cpu INT_DMSI irq pin. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-12-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 71 +++ hw/loongarch/virt.c | 11 ++ 2 files c

[PULL v2 03/11] hw/loongarch: add misc register support dmsi

2025-09-28 Thread Song Gao
Add feature register and misc register for dmsi feature checking and setting Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-4-gaos...@loongson.cn> --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.

[PULL v2 10/11] target/loongarch:Implement csrrd CSR_MSGIR register

2025-09-28 Thread Song Gao
implement the read-clear feature for CSR_MSGIR register. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-11-gaos...@loongson.cn> --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c

[PULL v2 00/11] loongarch-to-apply queue

2025-09-28 Thread Song Gao
n64 errors. -------- Song Gao (11): target/loongarch: move some machine define to virt.h hw/loongarch: add virt feature dmsi support hw/loongarch: add misc register support dmsi loongarch: add a direct interrupt controller device

[PULL v2 09/11] target/loongarch: Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for msg interrupts.

2025-09-28 Thread Song Gao
Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for DINTC irq. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-10-gaos...@loongson.cn> --- target/loongarch/cpu-csr.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-c

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

2025-09-28 Thread Song Gao
move some machine define to virt.h Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-2-gaos...@loongson.cn> --- include/hw/loongarch/virt.h | 19 +++ target/loongarch/cpu.h | 21 - 2 files changed, 19 insertions(

[PULL v2 08/11] hw/loongarch: Implement dintc set irq

2025-09-28 Thread Song Gao
Implement dintc set irq and update CSR_MSGIS. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-9-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/h

[PULL 11/11] hw/loongarch: Implement DINTC plug/unplug interfaces

2025-09-25 Thread Song Gao
when cpu added, connect dintc irq to cpu INT_DMSI irq pin. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-12-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 71 +++ hw/loongarch/virt.c | 11 ++ 2 files c

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

2025-09-25 Thread Song Gao
move some machine define to virt.h Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-2-gaos...@loongson.cn> --- include/hw/loongarch/virt.h | 19 +++ target/loongarch/cpu.h | 21 - 2 files changed, 19 insertions(

[PULL 09/11] target/loongarch: Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for msg interrupts.

2025-09-24 Thread Song Gao
Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for DINTC irq. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-10-gaos...@loongson.cn> --- target/loongarch/cpu-csr.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-c

[PULL 03/11] hw/loongarch: add misc register support dmsi

2025-09-24 Thread Song Gao
Add feature register and misc register for dmsi feature checking and setting Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-4-gaos...@loongson.cn> --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.

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

2025-09-24 Thread Song Gao
implement the read-clear feature for CSR_MSGIR register. Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-ID: <20250916122109.749813-11-gaos...@loongson.cn> --- target/loongarch/csr.c| 5 + target/loongarch/tcg/csr_helper.c

[PULL 02/11] hw/loongarch: add virt feature dmsi support

2025-09-24 Thread Song Gao
dintc feature bit. Msgint feature is added in LoongArchCPU, and it is used to check whether th cpu supports the Message-Interrupts and by default set mesgint with ON_OFF_AUTO_AUTO. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-3-gaos...@loongson.cn> -

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

2025-09-24 Thread Song Gao
h-20250925 -------- Song Gao (11): target/loongarch: move some machine define to virt.h hw/loongarch: add virt feature dmsi support hw/loongarch: add misc register support dmsi loongarch: add a direct interrupt controller device target/loongarch: add msg interrupt CSR

[PULL 04/11] loongarch: add a direct interrupt controller device

2025-09-24 Thread Song Gao
Add Loongarch direct interrupt controller device base Definition. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-5-gaos...@loongson.cn> --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_dintc.c | 68 +

[PULL 07/11] hw/loongarch: Implement dintc realize and unrealize

2025-09-24 Thread Song Gao
Implement th DINTC realize and unrealize. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250916122109.749813-8-gaos...@loongson.cn> --- hw/intc/loongarch_dintc.c | 23 ++- target/loongarch/cpu.h| 3 ++- 2 files changed, 24 insertions(+), 2 del

[PATCH v7 09/11] target/loongarch: Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for msg interrupts.

2025-09-20 Thread Song Gao
Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for AVEC irq. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 4792677086..f296eb8d06

[PATCH v8 08/11] hw/loongarch: Implement dintc set irq

2025-09-20 Thread Song Gao
Implement dintc set irq and update CSR_MSGIS. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- hw/intc/loongarch_dintc.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_dintc.c b/hw/intc/loongarch_dintc.c index 598c666ec6

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

2025-09-20 Thread Song Gao
ix 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 Gao (11): target/loongarch:

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

2025-09-18 Thread Song Gao
The following changes since commit f0007b7f03e2d7fc33e71c3a582f2364c51a226b: Merge tag 'pull-target-arm-20250916' of https://gitlab.com/pm215/qemu into staging (2025-09-17 11:10:55 -0700) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongarch-2025

[PULL 3/3] hw/loongarch/virt: Register reset interface with cpu plug callback

2025-09-18 Thread Song Gao
their reset interface registered. And remove reset interface with CPU unplug callback. Signed-off-by: Bibo Mao Reviewed-by: Igor Mammedov Tested-by: Song Gao Message-ID: <20250906070200.3749326-4-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/loongarch/boot.c | 13 ---

[PULL 2/3] hw/loongarch/virt: Remove unnecessay pre-boot setting with BSP

2025-09-18 Thread Song Gao
From: Bibo Mao With BSP core, it boots from aux boot code and loads data into register A0-A2 and PC. Pre-boot setting is not unnecessary and can be removed. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-ID: <20250906070200.3749326-3-maob...@loongson.cn> Signed-off-by: So

[PULL 1/3] hw/loongarch/virt: Add BSP support with aux boot code

2025-09-18 Thread Song Gao
. With BSP core, load data to register A0-A2 and PC. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-ID: <20250906070200.3749326-2-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/loongarch/boot.c | 36 ++-- 1 file changed, 34 insertions(+), 2 del

[PATCH v8 07/11] hw/loongarch: Implement dintc realize and unrealize

2025-09-17 Thread Song Gao
Implement th DINTC realize and unrealize. Signed-off-by: Song Gao --- hw/intc/loongarch_dintc.c | 23 ++- target/loongarch/cpu.h| 3 ++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_dintc.c b/hw/intc/loongarch_dintc.c index

[PATCH v8 02/11] hw/loongarch: add virt feature dmsi support

2025-09-17 Thread Song Gao
dintc feature bit. Msgint feature is added in LoongArchCPU, and it is used to check whether th cpu supports the Message-Interrupts and by default set mesgint with ON_OFF_AUTO_AUTO. Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 50

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

2025-09-16 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 v8 06/11] hw/loongarch: DINTC add a MemoryRegion

2025-09-16 Thread Song Gao
the DINTC use [2fe0-2ff0) Memory. Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/intc/loongarch_dintc.c | 24 +++ hw/loongarch/virt.c | 38 ++- include/hw/intc/loongarch_dintc.h | 1 + include/hw/loongarch/virt.h

[PATCH v8 04/11] loongarch: add a direct interrupt controller device

2025-09-16 Thread Song Gao
Add Loongarch direct interrupt controller device base Definition. Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/intc/Kconfig | 3 ++ hw/intc/loongarch_dintc.c | 68 +++ hw/intc/meson.build | 1 + hw/loongarch/Kconfig

[PATCH v8 09/11] target/loongarch: Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for msg interrupts.

2025-09-16 Thread Song Gao
Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for DINTC irq. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 4792677086..f296eb8d06

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

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

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

2025-09-16 Thread Song Gao
include CSR_MSGIS0-3, CSR_MSGIR and CSR_MSGIE. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 +++ target/loongarch/cpu.h | 11 +++ target/loongarch/machine.c | 25 +++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff

[PATCH v8 03/11] hw/loongarch: add misc register support dmsi

2025-09-16 Thread Song Gao
Add feature register and misc register for dmsi feature checking and setting Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2f64089eac..cc23e98b3a 100644

[PATCH v8 11/11] hw/loongarch: Implement DINTC plug/unplug interfaces

2025-09-16 Thread Song Gao
when cpu added, connect dintc irq to cpu INT_DMSI irq pin. Reviewed-by: Bibo Mao Signed-off-by: Song Gao --- hw/intc/loongarch_dintc.c | 71 +++ hw/loongarch/virt.c | 9 + 2 files changed, 80 insertions(+) diff --git a/hw/intc/loongarch_dintc.c b

[PATCH v8 00/11] hw/loongarch: add the direct interrupt controller(DINTC) support

2025-09-16 Thread Song Gao
CSR_MSGIR register 2: Fix some 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 bi

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

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

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

2025-09-10 Thread Song Gao
when cpu added, connect avec irq to cpu INT_AVEC irq pin. Reviewed-by: Bibo Mao 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

[PATCH v7 02/11] hw/loongarch: add virt feature avecintc and cpu feature msgint support

2025-09-10 Thread Song Gao
default avec feature bit. Msegint feature is added in LoongArchCPU, and it is used to check whether th cpu supports the Message-Interrupts and by default set mesgint with ON_OFF_AUTO_AUTO. Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 32

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

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

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

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

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

2025-09-10 Thread Song Gao
Add feature register and misc register for avecintc feature checking and setting Signed-off-by: Song Gao Reviewed-by: Bibo Mao --- hw/loongarch/virt.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 37c38ae63f..0883f3a272 100644

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

2025-09-10 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 v7 08/11] hw/loongarch: Implement avec set irq

2025-09-10 Thread Song Gao
Implement avec set irq and update CSR_MSGIS. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc/loongarch_avec.c index 1f9f376898..0c90579de2 100644 --- a

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

2025-09-10 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 | 11 +++ target/loongarch/machine.c | 25 +++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/target

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

2025-09-10 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 target/loongarch/cpu.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hw/intc/loongarch_avec.c b/hw

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

2025-09-06 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 | 10 +- target/loongarch/cpu.h | 3 ++- 3 files changed, 31 insertions(+), 2 deletions

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

2025-09-04 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 v6 01/11] target/loongarch: move some machine define to virt.h

2025-09-04 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 v6 00/11] hw/loongarch: add the advanced extended interrupt controllers (AVECINTC) support

2025-09-04 Thread Song Gao
7;-bios', because kernel use avec need acpi support. the bios is qemu/pc_bios/edk2-loongarch64-code.fd.bz2. Thanks. Song Gao Song Gao (11): target/loongarch: move some machine define to virt.h hw/loongarch: add virt feature avecintc support hw/loongarch: add misc register supoort avecintc

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

2025-09-04 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 1a2aa92c25..124f96af03 100644 --- a/hw/loongarch

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

2025-09-04 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 v6 08/11] hw/loongarch: Implement avec set irq

2025-09-04 Thread Song Gao
Implement avec set irq and update CSR_MSIS. Signed-off-by: Song Gao --- hw/intc/loongarch_avec.c | 58 ++-- include/hw/intc/loongarch_avec.h | 3 ++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongarch_avec.c b/hw/intc

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

2025-09-04 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 v6 05/11] target/loongarch: add msg interrupt CSR registers

2025-09-04 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 | 11 +++ target/loongarch/machine.c | 27 +-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/target

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

2025-09-04 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..1a2aa92c25 100644 --- a

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

2025-09-04 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 v6 09/11] target/loongarch: Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for msg interrupts.

2025-09-04 Thread Song Gao
Add CSR_ESTAT.bit15 and CSR_ECFG.bit15 for AVEC irq. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 4792677086..6ec13d13d1 100644 --- a/target

[PULL 1/2] target/loongarch: Guard 64-bit-only insn translation with TRANS64 macro

2025-08-28 Thread Song Gao
. Signed-off-by: WANG Rui Reviewed-by: Bibo Mao Reviewed-by: Song Gao Signed-off-by: Song Gao --- .../tcg/insn_trans/trans_atomic.c.inc | 36 +-- .../tcg/insn_trans/trans_extra.c.inc | 8 +++-- .../tcg/insn_trans/trans_farith.c.inc | 8 ++--- .../loongarch

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

2025-08-28 Thread Song Gao
The following changes since commit ca18b336e12c8433177a3cd639c5bf757952adaa: Merge tag 'pull-lu-20250828' of https://gitlab.com/rth7680/qemu into staging (2025-08-28 09:24:36 +1000) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongarch-20250828

[PULL 2/2] hw/intc/loongarch_pch_pic: Fix ubsan warning and endianness issue

2025-08-28 Thread Song Gao
nter to write values into an array of 8-bit values. Thus rework the code to use the stq_le_p / ldq_le_p helpers here and make sure that we do not create pointers with undefined behavior by accident. Signed-off-by: Thomas Huth Reviewed-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Tested-b

[PULL 1/1] target/loongarch: Fix [X]VLDI raising exception incorrectly

2025-08-07 Thread Song Gao
vr0, 3328 ret ``` Reported-by: Zhou Qiankang Signed-off-by: WANG Rui Reviewed-by: Song Gao Message-ID: <20250804132212.4816-1-wang...@loongson.cn> Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_vec.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) d

[PULL 0/1] loongarch bug fix for 10.1

2025-08-07 Thread Song Gao
The following changes since commit cd21ee5b27b22ae66c103d36516aa5077881aa3d: Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2025-08-07 11:02:50 -0400) are available in the Git repository at: https://github.com/gaosong715/qemu.git tags/pull-loongarch-20

[PULL 1/2] target/loongarch: Fix valid virtual address checking

2025-07-31 Thread Song Gao
, *addr1; int val; addr = malloc(100); *(int *)addr = 1; addr1 = 0xULL + addr; val = *(int *)addr1; printf("val %d \n", val); } Cc: qemu-sta...@nongnu.org Signed-off-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Song Gao

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

2025-07-31 Thread Song Gao
0731-for-10.1 Bibo Mao (1): target/loongarch: Fix valid virtual address checking Song Gao (1): hw/intc/loongarch_ipi: Fix start fail with smp cpu < smp maxcpus on KVM hw/intc/loongarch_ipi_kvm.c | 27 ---

[PULL 2/2] hw/intc/loongarch_ipi: Fix start fail with smp cpu < smp maxcpus on KVM

2025-07-31 Thread Song Gao
: qemu-system-loongarch64: KVM_SET_DEVICE_ATTR failed: Group 1073741825 attr 0x0001: Invalid argument Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-ID: <20250725081213.3867592-1-gaos...@loongson.cn> --- hw/intc/loongarch_ipi_kvm.c | 27 ---

[PATCH] hw/intc/loongarch_ipi: Fix start fail with smp cpu < smp maxcpus on KVM

2025-07-25 Thread Song Gao
: qemu-system-loongarch64: KVM_SET_DEVICE_ATTR failed: Group 1073741825 attr 0x0001: Invalid argument Signed-off-by: Song Gao --- hw/intc/loongarch_ipi_kvm.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/hw/intc/loongarch_ipi_kv

[PATCH v2] hw/intc/loongarch_ipi: use logical CPU ID for kvm_ipi_access_regs

2025-07-24 Thread Song Gao
QEMU reboot after inserting no-configuous cpus may start failed becaue the vcpu context may not have created on KVM, On QEMU side use logical CPU ID for kvm_ipi_access_regs and do some check. On KVM use kvm_get_vcpu_by_id() get vcpu. Signed-off-by: Song Gao --- hw/intc/loongarch_ipi_kvm.c

[PATCH 1/1] hw/intc/loongarch_ipi: use physical CPU ID for kvm_ipi_access_regs

2025-07-22 Thread Song Gao
QEMU reboot after inserting no-configuous cpus may start failed becaue the vcpu context may not have created on KVM, On QEMU side use physical CPU ID for kvm_ipi_access_regs and do some check. On KVM use kvm_get_vcpu_by_cpuid get vcpu. Signed-off-by: Song Gao --- hw/intc/loongarch_ipi_kvm.c

[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

  1   2   3   4   5   6   7   8   9   10   >