[RFC PATCH v2] target/loongarch/kvm: Add pmu support

2024-05-14 Thread Song Gao
This patch adds PMU support, We just sets some cpucfg6 default value to PMU config on kvm mode, and then check the PMU config with kvm ioctl KVM_GET_DEVICE_ATTR. e.g '... -cpu max,pmu=on' (enable PMU)' '... -cpu max,pmu=off' (disable PMU)' Signed-off-by: Song Gao --- v2: - Drop

[PATCH] target/loongarch/kvm: fpu save the vreg registers high 192bit

2024-05-14 Thread Song Gao
On kvm side, get_fpu/set_fpu save the vreg registers high 192bits, but QEMU missing. Signed-off-by: Song Gao --- target/loongarch/kvm/kvm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c index a9f9020071..0b5dbb7ed8 100644

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

2024-05-14 Thread Song Gao
) Signed-off-by: Song Gao --- This patch adds the 'RFC' heading because it requires the kernel to merge into patch[1] first [1]: https://lore.kernel.org/all/20240507120140.3119714-1-gaos...@loongson.cn/ target/loongarch/cpu.h| 2 + target/loongarch/cpu.c| 64

[PATCH v2 2/2] hw/loongarch/virt: Enable extioi virt extension

2024-05-14 Thread Song Gao
This patch adds a new board attribute 'v-eiointc'. A value of true enables the virt extended I/O interrupt controller. VMs working in kvm mode have 'v-eiointc' enabled by default. Signed-off-by: Song Gao --- include/hw/loongarch/virt.h | 2 + target/loongarch/cpu.h | 1 + hw/loongarch

[PATCH v2 0/2] Add extioi virt extension support

2024-05-14 Thread Song Gao
commit/5d97cff72f91f4f20a536efd60eca75bfcb78a64 Thanks. Song Gao. Song Gao (2): hw/intc/loongarch_extioi: Add extioi virt extension definition hw/loongarch/virt: Enable extioi virt extension include/hw/intc/loongarch_extioi.h | 21 ++ include/hw/loongarch/virt.h| 2 + target/loongarch/cpu.h

[PATCH v2 1/2] hw/intc/loongarch_extioi: Add extioi virt extension definition

2024-05-14 Thread Song Gao
On LoongArch, IRQs can be routed to four vcpus with hardware extioi. This patch adds the extioi virt extension definition so that the IRQ can route to 256 vcpus. Signed-off-by: Song Gao --- include/hw/intc/loongarch_extioi.h | 21 +++ hw/intc/loongarch_extioi.c | 92

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

2024-05-09 Thread Song Gao
The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240509 for

[PULL 2/3] target/loongarch: Add TCG macro in structure CPUArchState

2024-05-09 Thread Song Gao
entries are not used and do not need migrate. It is only useful when it runs in TCG mode. Signed-off-by: Bibo Mao Reviewed-by: Richard Henderson Message-Id: <20240506011912.2108842-1-maob...@loongson.cn> Signed-off-by: Song Gao --- target/loongarch/cpu.c| 7 +-- target/loo

[PULL 3/3] target/loongarch: Put cpucfg operation before CSR register

2024-05-09 Thread Song Gao
. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20240428031651.1354587-1-maob...@loongson.cn> Signed-off-by: Song Gao --- target/loongarch/kvm/kvm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/loongarch/kvm/kvm.c b/target/loongar

[PULL 1/3] hw/loongarch: Refine default numa id calculation

2024-05-09 Thread Song Gao
: Bibo Mao Reviewed-by: Song Gao Message-Id: <20240319022606.2994565-1-maob...@loongson.cn> Signed-off-by: Song Gao --- hw/loongarch/virt.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index c0999878df..12d20055fe

[PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures

2024-05-07 Thread Song Gao
vmstate does not save kvm_state_conter, which can cause VM recovery from disk to fail. Signed-off-by: Song Gao --- v2: - Update the version. - Link to v1: https://patchew.org/QEMU/20240430012356.2620763-1-gaos...@loongson.cn/ target/loongarch/machine.c | 6 -- 1 file changed, 4

[PATCH v2] hw/loongarch/virt: Fix memory leak

2024-05-07 Thread Song Gao
The char pointer 'ramName' point to a block of memory, but never free it. Use a small fixed-size buffer for 'ramName'. Resolves: Coverity CID 1544773 Fixes: 0cf1478d6 ("hw/loongarch: Add numa support") Signed-off-by: Song Gao --- v2: - Use a small fixed-size buffer for 'ramName'

[PATCH] hw/loongarch/virt: Fix memory leak

2024-05-06 Thread Song Gao
The char pointer 'ramName' point to a block of memory, but never free it. Use 'g_autofree' to automatically free it. Resolves: Coverity CID 1544773 Fixes: 0cf1478d6 ("hw/loongarch: Add numa support") Signed-off-by: Song Gao --- hw/loongarch/virt.c | 3 +-- 1 file changed, 1 inser

[PATCH] target/loongarch/kvm: Fix VM recovery from disk failures

2024-04-29 Thread Song Gao
vmstate does not save kvm_state_conter, which can cause VM recovery from disk to fail. Signed-off-by: Song Gao --- target/loongarch/machine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/machine.c b/target/loongarch/machine.c index c7029fb9b4..4cd1bf06ff 100644

[PULL v2 06/17] hw/loongarch: Init efi_boot_memmap table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_boot_memmap configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-7-gaos...@loongson.cn> --- hw/loongarch/boot.c | 40 + hw/loongarch/virt.c

[PULL v2 08/17] hw/loongarch: Init efi_fdt table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_fdt configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-9-gaos...@loongson.cn> --- hw/loongarch/boot.c | 11 +++ hw/loongarch/virt.c | 6 ++ include/hw/loongarch/boot.

[PULL v2 03/17] hw/loongarch: Add slave cpu boot_code

2024-04-28 Thread Song Gao
Load the slave CPU boot code at pflash0 and set the slave CPU elf_address to VIRT_FLASH0_BASE. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-4-gaos...@loongson.cn> --- hw/loongarch/boot.c | 62 - 1 file chang

[PULL v2 12/17] hw/loongarch: fdt adds pch_pic Controller

2024-04-28 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

[PULL v2 07/17] hw/loongarch: Init efi_initrd table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_initrd configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-8-gaos...@loongson.cn> --- hw/loongarch/boot.c | 23 +-- include/hw/loongarch/boot.h | 9 + 2 files chang

[PULL v2 02/17] hw/loongarch: Add load initrd

2024-04-28 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-3-gaos...@loongson.cn> --- hw/loongarch/boot.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/

[PULL v2 15/17] hw/loongarch: fdt remove unused irqchip node

2024-04-28 Thread Song Gao
This patch removes the unused fdt irqchip node. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-16-gaos...@loongson.cn> --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loo

[PULL v2 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2024-04-28 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-eiointc.c https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubin...@loongson.cn Signed-off-by: Song Gao

[PULL v2 17/17] hw/loongarch: Add cells missing from rtc node

2024-04-28 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-18-gaos...@loongson.cn> --- hw/loongarch/virt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.

[PULL v2 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2024-04-28 Thread Song Gao
<0x02 0x00 0x02 0x1000>; }; Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-Id: <20240426091551.2397867-10-gaos...@loongson.cn> --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 42e5df8a24

[PULL v2 16/17] hw/loongarch: Add cells missing from uart node

2024-04-28 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-17-gaos...@loongson.cn> --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.

[PULL v2 04/17] hw/loongarch: Add init_cmdline

2024-04-28 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-5-gaos...@loongson.cn> --- hw/loongarch/boot.c | 30 ++ include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h |

[PULL v2 14/17] hw/loongarch: fdt adds pcie irq_map node

2024-04-28 Thread Song Gao
This patch adds pcie irq_map node for FDT. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-15-gaos...@loongson.cn> --- hw/loongarch/virt.c | 73 ++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --gi

[PULL v2 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2024-04-28 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongarch-cpu.c https://lore.kernel.org/r/20221114113824.1880-2-liupei...@loongson.cn Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message

[PULL v2 05/17] hw/loongarch: Init efi_system_table

2024-04-28 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-6-gaos...@loongson.cn> --- hw/loongarch/boot.c | 22 + include/hw/loongarch/boot.h | 48 + 2 files ch

[PULL v2 01/17] hw/loongarch: Move boot functions to boot.c

2024-04-28 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240426091551.2397867-2-gaos...@loongson.cn> --- hw/loongarch/boot.c

[PULL v2 13/17] hw/loongarch: fdt adds pch_msi Controller

2024-04-28 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-msi.c https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

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

2024-04-28 Thread Song Gao
. Song Gao (17): hw/loongarch: Move boot functions to boot.c hw/loongarch: Add load initrd hw/loongarch: Add slave cpu boot_code hw/loongarch: Add init_cmdline hw/loongarch: Init efi_system_table hw/loongarch: Init

[PULL 12/17] hw/loongarch: fdt adds pch_pic Controller

2024-04-28 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

[PULL 16/17] hw/loongarch: Add cells missing from uart node

2024-04-28 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-17-gaos...@loongson.cn> --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.

[PULL 05/17] hw/loongarch: Init efi_system_table

2024-04-28 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-6-gaos...@loongson.cn> --- hw/loongarch/boot.c | 22 + include/hw/loongarch/boot.h | 48 + 2 files ch

[PULL 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2024-04-28 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-eiointc.c https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubin...@loongson.cn Signed-off-by: Song Gao

[PULL 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2024-04-28 Thread Song Gao
<0x02 0x00 0x02 0x1000>; }; Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-Id: <20240426091551.2397867-10-gaos...@loongson.cn> --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 42e5df8a24

[PULL 13/17] hw/loongarch: fdt adds pch_msi Controller

2024-04-28 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-msi.c https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

[PULL 03/17] hw/loongarch: Add slave cpu boot_code

2024-04-28 Thread Song Gao
Load the slave CPU boot code at pflash0 and set the slave CPU elf_address to VIRT_FLASH0_BASE. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-4-gaos...@loongson.cn> --- hw/loongarch/boot.c | 62 - 1 file chang

[PULL 17/17] hw/loongarch: Add cells missing from rtc node

2024-04-28 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-18-gaos...@loongson.cn> --- hw/loongarch/virt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.

[PULL 08/17] hw/loongarch: Init efi_fdt table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_fdt configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-9-gaos...@loongson.cn> --- hw/loongarch/boot.c | 11 +++ hw/loongarch/virt.c | 6 ++ include/hw/loongarch/boot.

[PULL 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2024-04-28 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongarch-cpu.c https://lore.kernel.org/r/20221114113824.1880-2-liupei...@loongson.cn Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message

[PULL 14/17] hw/loongarch: fdt adds pcie irq_map node

2024-04-28 Thread Song Gao
This patch adds pcie irq_map node for FDT. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-15-gaos...@loongson.cn> --- hw/loongarch/virt.c | 73 ++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --gi

[PULL 01/17] hw/loongarch: Move boot functions to boot.c

2024-04-28 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240426091551.2397867-2-gaos...@loongson.cn> --- hw/loongarch/boot.c

[PULL 15/17] hw/loongarch: fdt remove unused irqchip node

2024-04-28 Thread Song Gao
This patch removes the unused fdt irqchip node. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-16-gaos...@loongson.cn> --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loo

[PULL 07/17] hw/loongarch: Init efi_initrd table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_initrd configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-8-gaos...@loongson.cn> --- hw/loongarch/boot.c | 23 +-- include/hw/loongarch/boot.h | 9 + 2 files chang

[PULL 02/17] hw/loongarch: Add load initrd

2024-04-28 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-3-gaos...@loongson.cn> --- hw/loongarch/boot.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/loo

[PULL 04/17] hw/loongarch: Add init_cmdline

2024-04-28 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-5-gaos...@loongson.cn> --- hw/loongarch/boot.c | 30 ++ include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h |

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

2024-04-28 Thread Song Gao
Song Gao (17): hw/loongarch: Move boot functions to boot.c hw/loongarch: Add load initrd hw/loongarch: Add slave cpu boot_code hw/loongarch: Add init_cmdline hw/loongarch: Init efi_system_table hw/loongarch: Init efi_boot_memmap table hw

[PULL 06/17] hw/loongarch: Init efi_boot_memmap table

2024-04-28 Thread Song Gao
The efi_system_table adds a efi_boot_memmap configuration table. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240426091551.2397867-7-gaos...@loongson.cn> --- hw/loongarch/boot.c | 40 + hw/loongarch/virt.c

[PATCH v7 03/17] hw/loongarch: Add slave cpu boot_code

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240307164835.300412-4-gaos...@loongson.cn> --- hw/loongarch/boot.c | 62 - 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index a9522d6912..d1a8

[PATCH v7 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2024-04-26 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongarch-cpu.c https://lore.kernel.org/r/20221114113824.1880-2-liupei...@loongson.cn Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message

[PATCH v7 04/17] hw/loongarch: Add init_cmdline

2024-04-26 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-5-gaos...@loongson.cn> --- include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h | 2 ++ hw/loongarch/boot.c | 30

[PATCH v7 15/17] hw/loongarch: fdt remove unused irqchip node

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-16-gaos...@loongson.cn> --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 91a5

[PATCH v7 17/17] hw/loongarch: Add cells missing from rtc node

2024-04-26 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-18-gaos...@loongson.cn> --- hw/loongarch/virt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.

[PATCH v7 01/17] hw/loongarch: Move boot functions to boot.c

2024-04-26 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240307164835.300412-2-gaos...@loongson.cn> --- include/hw/loongarch/boot.h

[PATCH v7 12/17] hw/loongarch: fdt adds pch_pic Controller

2024-04-26 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

[PATCH v7 05/17] hw/loongarch: Init efi_system_table

2024-04-26 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-6-gaos...@loongson.cn> --- include/hw/loongarch/boot.h | 48 + hw/loongarch/boot.c | 22 + 2 files ch

[PATCH v7 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2024-04-26 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-eiointc.c https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubin...@loongson.cn Signed-off-by: Song Gao

[PATCH v7 07/17] hw/loongarch: Init efi_initrd table

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-8-gaos...@loongson.cn> --- include/hw/loongarch/boot.h | 9 + hw/loongarch/boot.c | 23 +-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/hw/loo

[PATCH v7 00/17] Add boot LoongArch elf kernel with FDT

2024-04-26 Thread Song Gao
to be reviewed. Thanks. Song Gao V7: - Rebase and R-b; - Patch3, replace reg_num with reg_name. move slave boot code buf to pflash0; - Patch5: replace __aligned(8) with QEMU_ALIGNED(8); - Patch8: Use the macro FDT_BASE to indicate the fdt base size. V6: - Fixes test/compilation failures

[PATCH v7 02/17] hw/loongarch: Add load initrd

2024-04-26 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-3-gaos...@loongson.cn> --- hw/loongarch/boot.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/

[PATCH v7 16/17] hw/loongarch: Add cells missing from uart node

2024-04-26 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-17-gaos...@loongson.cn> --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loo

[PATCH v7 14/17] hw/loongarch: fdt adds pcie irq_map node

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-15-gaos...@loongson.cn> --- hw/loongarch/virt.c | 73 ++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c

[PATCH v7 13/17] hw/loongarch: fdt adds pch_msi Controller

2024-04-26 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-msi.c https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id

[PATCH v7 06/17] hw/loongarch: Init efi_boot_memmap table

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240307164835.300412-7-gaos...@loongson.cn> --- include/hw/loongarch/boot.h | 27 + include/hw/loongarch/virt.h | 10 ++ hw/loongarch/boot.c | 40 + hw/loongarch/virt.c

[PATCH v7 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2024-04-26 Thread Song Gao
<0x02 0x00 0x02 0x1000>; }; Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-Id: <20240307164835.300412-10-gaos...@loongson.cn> --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 42e5df8a24

[PATCH v7 08/17] hw/loongarch: Init efi_fdt table

2024-04-26 Thread Song Gao
Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240307164835.300412-9-gaos...@loongson.cn> --- include/hw/loongarch/boot.h | 4 include/hw/loongarch/virt.h | 2 ++ hw/loongarch/boot.c | 11 +++ hw/loongarch/virt.c | 6 ++ 4 files chang

[PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'

2024-03-22 Thread Song Gao
qemu-system-loongarch64 assert failed with the option '-d int', the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined. Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240321123606.1704900-1-gaos...@loongson.cn> --- target/loongarch

[PULL 0/1] loongarch fix for 9.0

2024-03-22 Thread Song Gao
-loongarch-20240322 Song Gao (1): target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' target/loongarch/cpu.c | 74 +++--- 1 file changed, 40 insertions

[PATCH v3] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'

2024-03-21 Thread Song Gao
qemu-system-loongarch64 assert failed with the option '-d int', the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 74 +++--- 1 file changed, 40 insertions(+), 34 deletions

[PATCH v2] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'

2024-03-21 Thread Song Gao
qemu-system-loongarch64 assert failed with the option '-d int', the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 76 +++--- 1 file changed, 42 insertions(+), 34 deletions

[PATCH v1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'

2024-03-20 Thread Song Gao
qemu-system-loongarch64 assert failed with the option '-d int', the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 75 ++ 1 file changed, 46 insertions(+), 29 deletions

[PULL 2/3] target/loongarch: Fix tlb huge page loading issue

2024-03-19 Thread Song Gao
-by: Richard Henderson Signed-off-by: Song Gao Message-Id: <20240318070332.1273939-1-lixiang...@loongson.cn> --- target/loongarch/cpu-csr.h| 3 + target/loongarch/internals.h | 5 -- target/loongarch/tcg/tlb_helper.c | 113 +- 3 files chang

[PULL 3/3] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0'

2024-03-19 Thread Song Gao
off-by: Song Gao Message-Id: <20240320013955.1561311-1-gaos...@loongson.cn> --- target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/loongarch/tcg/insn_trans/trans_atomic.c.inc b/target/loongarch/tcg/i

[PULL 0/3] loongarch fixes for 9.0

2024-03-19 Thread Song Gao
Bibo Mao (1): hw/intc/loongarch_extioi: Fix interrupt routing update Song Gao (1): target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0' Xianglai Li (1): target/loongarch: Fix tlb huge page loading issue hw/intc/loongarch_extioi.c

[PULL 1/3] hw/intc/loongarch_extioi: Fix interrupt routing update

2024-03-19 Thread Song Gao
From: Bibo Mao Interrupt number in loop sentence should be base irq plus loop index, it is missing on checking whether the irq is pending. Fixes: 428a6ef4396 ("Add vmstate post_load support") Signed-off-by: Bibo Mao Reviewed-by: Song Gao Signed-off-by: Song Gao

[PATCH v2] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0'

2024-03-19 Thread Song Gao
On gen_ll, if a->imm is zero, make_address_x return src1, but the load to destination may clobber src1. We use a new destination to fix this problem. Fixes: c5af6628f4be (target/loongarch: Extract make_address_i() helper) Suggested-by: Richard Henderson Signed-off-by: Song Gao --- tar

[PATCH v1] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0'

2024-03-19 Thread Song Gao
On gen_ll, if a->imm is 0, The value of t0 should be src1. Links: https://www.openwall.com/lists/musl/2024/03/12/4 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/loongarch/

[PATCH v6 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2024-03-07 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongarch-cpu.c https://lore.kernel.org/r/20221114113824.1880-2-liupei...@loongson.cn Signed-off-by: Song Gao Message-Id

[PATCH v6 12/17] hw/loongarch: fdt adds pch_pic Controller

2024-03-07 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Message-Id: <20240301093839.663947-13-g

[PATCH v6 01/17] hw/loongarch: Move boot fucntions to boot.c

2024-03-07 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao Message-Id: <20240301093839.663947-2-gaos...@loongson.cn> --- hw/loongarch/boot.c | 128 hw/loongarch/meson.build

[PATCH v6 14/17] hw/loongarch: fdt adds pcie irq_map node

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-15-gaos...@loongson.cn> --- hw/loongarch/virt.c | 73 ++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 1e767c49f8..d003

[PATCH v6 15/17] hw/loongarch: fdt remove unused irqchip node

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-16-gaos...@loongson.cn> --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index d00343f0c2..c80732a223 100644 --

[PATCH v6 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2024-03-07 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-eiointc.c https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubin...@loongson.cn Signed-off-by: Song Gao

[PATCH v6 17/17] hw/loongarch: Add cells missing from rtc node

2024-03-07 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Message-Id: <20240301093839.663947-18-gaos...@loongson.cn> --- hw/loongarch/virt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c

[PATCH v6 05/17] hw/loongarch: Init efi_system_table

2024-03-07 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao Message-Id: <20240301093839.663947-6-gaos...@loongson.cn> --- hw/loongarch/boot.c | 22 + include/hw/loongarch/boot.h | 48 + 2 files changed, 70 insertions(+) d

[PATCH v6 07/17] hw/loongarch: Init efi_initrd table

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-8-gaos...@loongson.cn> --- hw/loongarch/boot.c | 23 +-- include/hw/loongarch/boot.h | 9 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/

[PATCH v6 06/17] hw/loongarch: Init efi_boot_memmap table

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-7-gaos...@loongson.cn> --- hw/loongarch/boot.c | 39 + hw/loongarch/virt.c | 11 ++- include/hw/loongarch/boot.h | 27 + include/hw/loongarch/virt.

[PATCH v6 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2024-03-07 Thread Song Gao
<0x02 0x00 0x02 0x1000>; }; Reviewed-by: Bibo Mao Signed-off-by: Song Gao Message-Id: <20240301093839.663947-10-gaos...@loongson.cn> --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 8981b57b12

[PATCH v6 04/17] hw/loongarch: Add init_cmdline

2024-03-07 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao Message-Id: <20240301093839.663947-5-gaos...@loongson.cn> --- hw/loongarch/boot.c | 19 +++ include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h | 2 ++ 3 files changed, 23 insertions

[PATCH v6 02/17] hw/loongarch: Add load initrd

2024-03-07 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao Message-Id: <20240301093839.663947-3-gaos...@loongson.cn> --- hw/loongarch/boot.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/

[PATCH v6 16/17] hw/loongarch: Add cells missing from uart node

2024-03-07 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Message-Id: <20240301093839.663947-17-gaos...@loongson.cn> --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c

[PATCH v6 08/17] hw/loongarch: Init efi_fdt table

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-9-gaos...@loongson.cn> --- hw/loongarch/boot.c | 11 +++ include/hw/loongarch/boot.h | 4 2 files changed, 15 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 6126a37858..c6c6e6d194

[PATCH v6 03/17] hw/loongarch: Add slave cpu boot_code

2024-03-07 Thread Song Gao
Signed-off-by: Song Gao Message-Id: <20240301093839.663947-4-gaos...@loongson.cn> --- hw/loongarch/boot.c | 70 - 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 149deb2e01..e560

[PATCH v6 00/17] Add boot LoongArch elf kernel with FDT

2024-03-07 Thread Song Gao
/loongarch-binary/releases Please review! Thanks. Song Gao Song Gao (17): hw/loongarch: Move boot fucntions to boot.c hw/loongarch: Add load initrd hw/loongarch: Add slave cpu boot_code hw/loongarch: Add init_cmdline hw/loongarch: Init efi_system_table hw/loongarch: Init efi_boot_memmap

[PATCH v6 13/17] hw/loongarch: fdt adds pch_msi Controller

2024-03-07 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-msi.c https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Message-Id: <20240301093839.663947-14-g

[PULL v2 16/17] hw/loongarch: Add cells missing from uart node

2024-03-07 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao Message-Id: <20240301093839.663947-17-gaos...@loongson.cn> --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c

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

2024-03-07 Thread Song Gao
Song Gao (17): hw/loongarch: Move boot fucntions to boot.c hw/loongarch: Add load initrd hw/loongarch: Add slave cpu boot_code hw/loongarch: Add init_cmdline hw/loongarch: Init efi_system_table hw/loongarch: Init efi_boot_memmap table hw

[PULL v2 12/17] hw/loongarch: fdt adds pch_pic Controller

2024-03-07 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.y...@flygoat.com Signed-off-by: Song Gao Message-Id: <20240301093839.663947-13-g

  1   2   3   4   5   6   7   8   9   10   >