Add basic configs to run kunit tests on some more PowerPC variants.
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de --- Thomas Weißschuh (2): kunit: qemu_configs: powerpc: Explicitly enable CONFIG_CPU_BIG_ENDIAN=y kunit: qemu_configs: Add PowerPC 32-bit BE and 64-bit LE
tools/testing/kunit/qemu_configs/powerpc.py | 1 + tools/testing/kunit/qemu_configs/powerpc32.py | 17 +++++++++++++++++ tools/testing/kunit/qemu_configs/powerpcle.py | 14 ++++++++++++++ 3 files changed, 32 insertions(+) --- base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8 change-id: 20250220-kunit-ppc-3744e371112f
Best regards,
The configuration generated by kunit ends up with big endian. A new kunit configuration for little endian is to be added. To make the difference clearer spell out the endianness in the kunit reference config.
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de --- tools/testing/kunit/qemu_configs/powerpc.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/testing/kunit/qemu_configs/powerpc.py b/tools/testing/kunit/qemu_configs/powerpc.py index 7ec38d4131f7ec3b95d1ec6e49c60a6945be47c8..5b4c895d5d5a2cbcf7e2b987017cbb9f124dd089 100644 --- a/tools/testing/kunit/qemu_configs/powerpc.py +++ b/tools/testing/kunit/qemu_configs/powerpc.py @@ -3,6 +3,7 @@ from ..qemu_config import QemuArchParams QEMU_ARCH = QemuArchParams(linux_arch='powerpc', kconfig=''' CONFIG_PPC64=y +CONFIG_CPU_BIG_ENDIAN=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_HVC_CONSOLE=y''',
On Tue, 15 Apr 2025 at 17:23, Thomas Weißschuh thomas.weissschuh@linutronix.de wrote:
The configuration generated by kunit ends up with big endian. A new kunit configuration for little endian is to be added. To make the difference clearer spell out the endianness in the kunit reference config.
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de
Looks good to me, thanks!
Reviewed-by: David Gow davidgow@google.com
Cheers, -- David
tools/testing/kunit/qemu_configs/powerpc.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/testing/kunit/qemu_configs/powerpc.py b/tools/testing/kunit/qemu_configs/powerpc.py index 7ec38d4131f7ec3b95d1ec6e49c60a6945be47c8..5b4c895d5d5a2cbcf7e2b987017cbb9f124dd089 100644 --- a/tools/testing/kunit/qemu_configs/powerpc.py +++ b/tools/testing/kunit/qemu_configs/powerpc.py @@ -3,6 +3,7 @@ from ..qemu_config import QemuArchParams QEMU_ARCH = QemuArchParams(linux_arch='powerpc', kconfig=''' CONFIG_PPC64=y +CONFIG_CPU_BIG_ENDIAN=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_HVC_CONSOLE=y''',
-- 2.49.0
Add basic configs to run kunit tests on some more PowerPC variants.
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de --- tools/testing/kunit/qemu_configs/powerpc32.py | 17 +++++++++++++++++ tools/testing/kunit/qemu_configs/powerpcle.py | 14 ++++++++++++++ 2 files changed, 31 insertions(+)
diff --git a/tools/testing/kunit/qemu_configs/powerpc32.py b/tools/testing/kunit/qemu_configs/powerpc32.py new file mode 100644 index 0000000000000000000000000000000000000000..88bd60dbb9483af244d42d3d36c769ce2effe2b4 --- /dev/null +++ b/tools/testing/kunit/qemu_configs/powerpc32.py @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0 + +from ..qemu_config import QemuArchParams + +QEMU_ARCH = QemuArchParams(linux_arch='powerpc', + kconfig=''' +CONFIG_PPC32=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_ADB_CUDA=y +CONFIG_SERIAL_PMACZILOG=y +CONFIG_SERIAL_PMACZILOG_TTYS=y +CONFIG_SERIAL_PMACZILOG_CONSOLE=y +''', + qemu_arch='ppc', + kernel_path='vmlinux', + kernel_command_line='console=ttyS0', + extra_qemu_params=['-M', 'g3beige', '-cpu', 'max']) diff --git a/tools/testing/kunit/qemu_configs/powerpcle.py b/tools/testing/kunit/qemu_configs/powerpcle.py new file mode 100644 index 0000000000000000000000000000000000000000..7ddee8af4bd79a85a1dbbbd0446d3ea47c5947d8 --- /dev/null +++ b/tools/testing/kunit/qemu_configs/powerpcle.py @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0 + +from ..qemu_config import QemuArchParams + +QEMU_ARCH = QemuArchParams(linux_arch='powerpc', + kconfig=''' +CONFIG_PPC64=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_HVC_CONSOLE=y +''', + qemu_arch='ppc64', + kernel_path='vmlinux', + kernel_command_line='console=ttyS0', + extra_qemu_params=['-M', 'pseries', '-cpu', 'power8'])
On Tue, 15 Apr 2025 at 17:23, Thomas Weißschuh thomas.weissschuh@linutronix.de wrote:
Add basic configs to run kunit tests on some more PowerPC variants.
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de
Hmm... a part of me wonders whether it'd make more sense to rename the 64-bit one to powerpc64, to match e.g. arm/arm64. But it's probably not worth the breakage for existing users. Equally, I doubt there are enough people who care about 32-bit little endian to warrant a powerpc32le config (and if there are, they can always add them in a follow up).
So this looks good as-is, thanks!
Reviewed-by: David Gow davidgow@google.com
tools/testing/kunit/qemu_configs/powerpc32.py | 17 +++++++++++++++++ tools/testing/kunit/qemu_configs/powerpcle.py | 14 ++++++++++++++ 2 files changed, 31 insertions(+)
diff --git a/tools/testing/kunit/qemu_configs/powerpc32.py b/tools/testing/kunit/qemu_configs/powerpc32.py new file mode 100644 index 0000000000000000000000000000000000000000..88bd60dbb9483af244d42d3d36c769ce2effe2b4 --- /dev/null +++ b/tools/testing/kunit/qemu_configs/powerpc32.py @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0
+from ..qemu_config import QemuArchParams
+QEMU_ARCH = QemuArchParams(linux_arch='powerpc',
kconfig='''
+CONFIG_PPC32=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_ADB_CUDA=y +CONFIG_SERIAL_PMACZILOG=y +CONFIG_SERIAL_PMACZILOG_TTYS=y +CONFIG_SERIAL_PMACZILOG_CONSOLE=y +''',
qemu_arch='ppc',
kernel_path='vmlinux',
kernel_command_line='console=ttyS0',
extra_qemu_params=['-M', 'g3beige', '-cpu', 'max'])
diff --git a/tools/testing/kunit/qemu_configs/powerpcle.py b/tools/testing/kunit/qemu_configs/powerpcle.py new file mode 100644 index 0000000000000000000000000000000000000000..7ddee8af4bd79a85a1dbbbd0446d3ea47c5947d8 --- /dev/null +++ b/tools/testing/kunit/qemu_configs/powerpcle.py @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0
+from ..qemu_config import QemuArchParams
+QEMU_ARCH = QemuArchParams(linux_arch='powerpc',
kconfig='''
+CONFIG_PPC64=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_HVC_CONSOLE=y +''',
qemu_arch='ppc64',
kernel_path='vmlinux',
kernel_command_line='console=ttyS0',
extra_qemu_params=['-M', 'pseries', '-cpu', 'power8'])
-- 2.49.0
linux-kselftest-mirror@lists.linaro.org