[PATCH v2 0/5] microblaze: KUnit support

1 view
Skip to first unread message

Thomas Weißschuh

unread,
Sep 13, 2026, 7:50:26 PMSep 13
to Michal Simek, Brendan Higgins, David Gow, Rae Moar, linux-...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com, Thomas Weißschuh
Add the necessary prerequisites and configuration to run KUnit on
microblaze.

Please note that various KUnit tests might fail depending on the
kernel configuration as the memmove() implementation from
arch/microblaze/lib/memmove.c seems to be broken.

gpu_buddy.gpu_test_buddy_alloc_exceeds_max_order is currently also
broken.

Intended for the microblaze tree.

Signed-off-by: Thomas Weißschuh <li...@weissschuh.net>
---
Changes in v2:
- Rebase on v7.3-rc1.
- Pick up review tags.
- Move do_kernel_power_off() after the message printing.
- Little endian support.
- Link to v1: https://patch.msgid.link/20260804-kunit-microb...@weissschuh.net

---
Thomas Weißschuh (5):
microblaze: uaccess: Zero out destination on failed get_user()
microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS
microblaze: reset: Call POWER_OFF handlers
microblaze: reset: Provide a power off handler through an unaligned PC
kunit: qemu_configs: Add microblaze configurations

arch/microblaze/Kconfig | 9 ++++++++
arch/microblaze/Makefile | 6 ++---
arch/microblaze/include/asm/uaccess.h | 3 ++-
arch/microblaze/kernel/reset.c | 22 +++++++++++++++++++
tools/testing/kunit/qemu_configs/microblazebe.py | 24 ++++++++++++++++++++
tools/testing/kunit/qemu_configs/microblazeel.py | 28 ++++++++++++++++++++++++
6 files changed, 87 insertions(+), 5 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260802-kunit-microblaze-7a3f6ac88b4d

Best regards,
--
Thomas Weißschuh <li...@weissschuh.net>

Thomas Weißschuh

unread,
Sep 13, 2026, 7:50:27 PMSep 13
to Michal Simek, Brendan Higgins, David Gow, Rae Moar, linux-...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com, Thomas Weißschuh
Add basic configurations to run kunit tests on big and little endian
microblaze.

Suggested-by: Michal Simek <mon...@monstr.eu>
Link: https://lore.kernel.org/lkml/5cd8df03-ad51-460c...@amd.com/
Signed-off-by: Thomas Weißschuh <li...@weissschuh.net>
Reviewed-by: David Gow <da...@davidgow.net>
---
tools/testing/kunit/qemu_configs/microblazebe.py | 24 ++++++++++++++++++++
tools/testing/kunit/qemu_configs/microblazeel.py | 28 ++++++++++++++++++++++++
2 files changed, 52 insertions(+)

diff --git a/tools/testing/kunit/qemu_configs/microblazebe.py b/tools/testing/kunit/qemu_configs/microblazebe.py
new file mode 100644
index 000000000000..f37b7af20142
--- /dev/null
+++ b/tools/testing/kunit/qemu_configs/microblazebe.py
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0-only
+from ..qemu_config import QemuArchParams
+
+QEMU_ARCH = QemuArchParams(linux_arch='microblaze',
+ kconfig='''
+CONFIG_KERNEL_BASE_ADDR=0x90000000
+CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
+CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
+CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
+CONFIG_XILINX_MICROBLAZE0_USE_DIV=0
+CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=1
+CONFIG_XILINX_MICROBLAZE0_USE_FPU=0
+CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_SERIAL_UARTLITE=y
+CONFIG_SERIAL_UARTLITE_CONSOLE=y
+CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC=y
+''',
+ qemu_arch='microblaze',
+ kernel_path='arch/microblaze/boot/linux.bin',
+ kernel_command_line='kunit_shutdown=poweroff',
+ extra_qemu_params=[
+ '-M', 'petalogix-s3adsp1800',
+ ],
+)
diff --git a/tools/testing/kunit/qemu_configs/microblazeel.py b/tools/testing/kunit/qemu_configs/microblazeel.py
new file mode 100644
index 000000000000..25db2052db06
--- /dev/null
+++ b/tools/testing/kunit/qemu_configs/microblazeel.py
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-only
+from ..qemu_config import QemuArchParams
+
+QEMU_ARCH = QemuArchParams(linux_arch='microblaze',
+ kconfig='''
+CONFIG_KERNEL_BASE_ADDR=0x50000000
+CONFIG_XILINX_MICROBLAZE0_FAMILY="virtex5"
+CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
+CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
+CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
+CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
+CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
+CONFIG_XILINX_MICROBLAZE0_USE_FPU=1
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_16550A_VARIANTS=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC=y
+''',
+ qemu_arch='microblaze',
+ kernel_path='arch/microblaze/boot/linux.bin',
+ kernel_command_line='kunit_shutdown=poweroff',
+ extra_qemu_params=[
+ '-M', 'petalogix-ml605',
+ ],
+)
+

--
2.55.0

Michal Simek

unread,
Sep 14, 2026, 6:25:46 AMSep 14
to Thomas Weißschuh, Brendan Higgins, David Gow, Rae Moar, linux-...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com
Applied.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP/Versal ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal/Versal NET SoCs
TF-A maintainer - Xilinx ZynqMP/Versal/Versal NET SoCs

Reply all
Reply to author
Forward
0 new messages