[PATCH 4/4] kunit: qemu_configs: loongarch: Enable shutdown

Thomas Weißschuh posted 4 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH 4/4] kunit: qemu_configs: loongarch: Enable shutdown
Posted by Thomas Weißschuh 1 month, 1 week ago
QEMU for LoongArch does not yet support shutdown/restart through ACPI.
Use the pvpanic driver to enable shutdowns.
This requires 9.1.0 for shutdown support in pvpanic, but that is the
requirement of kunit on LoongArch anyways.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/testing/kunit/qemu_configs/loongarch.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/kunit/qemu_configs/loongarch.py b/tools/testing/kunit/qemu_configs/loongarch.py
index e7bb7c07819677dfdefac012821a732555813cae..1d2b780fbd5c0bde20aa6a5cd1217d0b3b443a93 100644
--- a/tools/testing/kunit/qemu_configs/loongarch.py
+++ b/tools/testing/kunit/qemu_configs/loongarch.py
@@ -4,13 +4,16 @@ QEMU_ARCH = QemuArchParams(linux_arch='loongarch',
 			   kconfig='''
 CONFIG_EFI_STUB=n
 CONFIG_PCI_HOST_GENERIC=y
+CONFIG_PVPANIC=y
+CONFIG_PVPANIC_PCI=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
 ''',
 			   qemu_arch='loongarch64',
 			   kernel_path='arch/loongarch/boot/vmlinux.elf',
-			   kernel_command_line='console=ttyS0',
+			   kernel_command_line='console=ttyS0 kunit_shutdown=poweroff',
 			   extra_qemu_params=[
 					   '-machine', 'virt',
+					   '-device', 'pvpanic-pci',
 					   '-cpu', 'max',])

-- 
2.47.0

Re: [PATCH 4/4] kunit: qemu_configs: loongarch: Enable shutdown
Posted by David Gow 1 month, 1 week ago
On Mon, 14 Oct 2024 at 19:37, Thomas Weißschuh
<thomas.weissschuh@linutronix.de> wrote:
>
> QEMU for LoongArch does not yet support shutdown/restart through ACPI.
> Use the pvpanic driver to enable shutdowns.
> This requires 9.1.0 for shutdown support in pvpanic, but that is the
> requirement of kunit on LoongArch anyways.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---

Looks fine to me.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David
Re: [PATCH 4/4] kunit: qemu_configs: loongarch: Enable shutdown
Posted by maobibo 1 month, 1 week ago
Reviewed-by: Bibo Mao <maobibo@loongson.cn>

On 2024/10/14 下午7:36, Thomas Weißschuh wrote:
> QEMU for LoongArch does not yet support shutdown/restart through ACPI.
> Use the pvpanic driver to enable shutdowns.
> This requires 9.1.0 for shutdown support in pvpanic, but that is the
> requirement of kunit on LoongArch anyways.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>   tools/testing/kunit/qemu_configs/loongarch.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/kunit/qemu_configs/loongarch.py b/tools/testing/kunit/qemu_configs/loongarch.py
> index e7bb7c07819677dfdefac012821a732555813cae..1d2b780fbd5c0bde20aa6a5cd1217d0b3b443a93 100644
> --- a/tools/testing/kunit/qemu_configs/loongarch.py
> +++ b/tools/testing/kunit/qemu_configs/loongarch.py
> @@ -4,13 +4,16 @@ QEMU_ARCH = QemuArchParams(linux_arch='loongarch',
>   			   kconfig='''
>   CONFIG_EFI_STUB=n
>   CONFIG_PCI_HOST_GENERIC=y
> +CONFIG_PVPANIC=y
> +CONFIG_PVPANIC_PCI=y
>   CONFIG_SERIAL_8250=y
>   CONFIG_SERIAL_8250_CONSOLE=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   ''',
>   			   qemu_arch='loongarch64',
>   			   kernel_path='arch/loongarch/boot/vmlinux.elf',
> -			   kernel_command_line='console=ttyS0',
> +			   kernel_command_line='console=ttyS0 kunit_shutdown=poweroff',
>   			   extra_qemu_params=[
>   					   '-machine', 'virt',
> +					   '-device', 'pvpanic-pci',
>   					   '-cpu', 'max',])
>