* [PATCH 0/4] microblaze: KUnit support
@ 2026-08-04 5:32 Thomas Weißschuh
2026-08-04 5:32 ` [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() Thomas Weißschuh
` (4 more replies)
0 siblings, 5 replies; 20+ messages in thread
From: Thomas Weißschuh @ 2026-08-04 5:32 UTC (permalink / raw)
To: Michal Simek, Brendan Higgins, David Gow, Rae Moar
Cc: linux-kernel, linux-kselftest, kunit-dev, Thomas Weißschuh
Add the necessary prerequisites and configuration to run KUnit on
microblaze.
Please note that various KUnit tests will fail with the default
configuration as the memmove() implementation from
arch/microblaze/lib/memmove.c seems to be broken.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (4):
microblaze: uaccess: Zero out destination on failed get_user()
microblaze: reset: Call POWER_OFF handlers
microblaze: reset: Provide a power off handler through an unaligned PC
kunit: qemu_configs: Add microblaze configuration
arch/microblaze/Kconfig | 9 +++++++++
arch/microblaze/include/asm/uaccess.h | 3 ++-
arch/microblaze/kernel/reset.c | 22 ++++++++++++++++++++++
tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++
4 files changed, 50 insertions(+), 1 deletion(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260802-kunit-microblaze-7a3f6ac88b4d
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply [flat|nested] 20+ messages in thread* [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh @ 2026-08-04 5:32 ` Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-04 5:32 ` [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers Thomas Weißschuh ` (3 subsequent siblings) 4 siblings, 1 reply; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-04 5:32 UTC (permalink / raw) To: Michal Simek, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev, Thomas Weißschuh On failure get_user() is supposed to zero out the destination variable. This is documented in the kdoc of the microblaze get_user() implementation and validated in lib/tests/usercopy_kunit.c. Currently that zeroing is missing. Add it. Fixes: 0d6de9532663 ("microblaze_mmu_v2: uaccess MMU update") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- arch/microblaze/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index afa0dd8d013f..77203af255e5 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h @@ -95,7 +95,8 @@ extern long __user_bad(void); #define get_user(x, ptr) ({ \ const typeof(*(ptr)) __user *__gu_ptr = (ptr); \ access_ok(__gu_ptr, sizeof(*__gu_ptr)) ? \ - __get_user(x, __gu_ptr) : -EFAULT; \ + __get_user(x, __gu_ptr) : \ + ((x) = 0, -EFAULT); \ }) #define __get_user(x, ptr) \ -- 2.55.0 ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() 2026-08-04 5:32 ` [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() Thomas Weißschuh @ 2026-08-05 13:59 ` David Gow 0 siblings, 0 replies; 20+ messages in thread From: David Gow @ 2026-08-05 13:59 UTC (permalink / raw) To: Thomas Weißschuh, Michal Simek, Brendan Higgins, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : > On failure get_user() is supposed to zero out the destination variable. > This is documented in the kdoc of the microblaze get_user() > implementation and validated in lib/tests/usercopy_kunit.c. > > Currently that zeroing is missing. > > Add it. > > Fixes: 0d6de9532663 ("microblaze_mmu_v2: uaccess MMU update") > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- This test seems to be the gift which keeps on giving. Every architecture seems to have had a buggy get_user() at some point. Reviewed-by: David Gow <david@davidgow.net> Cheers, -- David > arch/microblaze/include/asm/uaccess.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h > index afa0dd8d013f..77203af255e5 100644 > --- a/arch/microblaze/include/asm/uaccess.h > +++ b/arch/microblaze/include/asm/uaccess.h > @@ -95,7 +95,8 @@ extern long __user_bad(void); > #define get_user(x, ptr) ({ \ > const typeof(*(ptr)) __user *__gu_ptr = (ptr); \ > access_ok(__gu_ptr, sizeof(*__gu_ptr)) ? \ > - __get_user(x, __gu_ptr) : -EFAULT; \ > + __get_user(x, __gu_ptr) : \ > + ((x) = 0, -EFAULT); \ > }) > > #define __get_user(x, ptr) \ > ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh 2026-08-04 5:32 ` [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() Thomas Weißschuh @ 2026-08-04 5:32 ` Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-31 8:13 ` Michal Simek 2026-08-04 5:32 ` [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC Thomas Weißschuh ` (2 subsequent siblings) 4 siblings, 2 replies; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-04 5:32 UTC (permalink / raw) To: Michal Simek, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev, Thomas Weißschuh System power off might be implemented through sys_off handlers. Currently these are not respected on microblaze. On power_off call into the generic power off function which will execute all regustered handlers. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- arch/microblaze/kernel/reset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index 2f66c7963084..3612a20ca16d 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c @@ -27,6 +27,7 @@ void machine_halt(void) void machine_power_off(void) { + do_kernel_power_off(); pr_notice("Machine power off...\n"); while (1) ; -- 2.55.0 ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers 2026-08-04 5:32 ` [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers Thomas Weißschuh @ 2026-08-05 13:59 ` David Gow 2026-08-31 8:13 ` Michal Simek 1 sibling, 0 replies; 20+ messages in thread From: David Gow @ 2026-08-05 13:59 UTC (permalink / raw) To: Thomas Weißschuh, Michal Simek, Brendan Higgins, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : > System power off might be implemented through sys_off handlers. > > Currently these are not respected on microblaze. > > On power_off call into the generic power off function which will execute > all regustered handlers. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- Seems sensible enough. Acked-by: David Gow <david@davidgow.net> Cheers, -- David > arch/microblaze/kernel/reset.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c > index 2f66c7963084..3612a20ca16d 100644 > --- a/arch/microblaze/kernel/reset.c > +++ b/arch/microblaze/kernel/reset.c > @@ -27,6 +27,7 @@ void machine_halt(void) > > void machine_power_off(void) > { > + do_kernel_power_off(); > pr_notice("Machine power off...\n"); > while (1) > ; > ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers 2026-08-04 5:32 ` [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers Thomas Weißschuh 2026-08-05 13:59 ` David Gow @ 2026-08-31 8:13 ` Michal Simek 2026-08-31 15:39 ` Thomas Weißschuh 1 sibling, 1 reply; 20+ messages in thread From: Michal Simek @ 2026-08-31 8:13 UTC (permalink / raw) To: Thomas Weißschuh, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev On 8/4/26 07:32, Thomas Weißschuh wrote: > System power off might be implemented through sys_off handlers. > > Currently these are not respected on microblaze. > > On power_off call into the generic power off function which will execute > all regustered handlers. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > arch/microblaze/kernel/reset.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c > index 2f66c7963084..3612a20ca16d 100644 > --- a/arch/microblaze/kernel/reset.c > +++ b/arch/microblaze/kernel/reset.c > @@ -27,6 +27,7 @@ void machine_halt(void) > > void machine_power_off(void) > { > + do_kernel_power_off(); > pr_notice("Machine power off...\n"); Likely it should be here. Or you will never see this notice. > while (1) > ; > M -- 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 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers 2026-08-31 8:13 ` Michal Simek @ 2026-08-31 15:39 ` Thomas Weißschuh 0 siblings, 0 replies; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-31 15:39 UTC (permalink / raw) To: Michal Simek Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 2026-08-31 10:13:52+0200, Michal Simek wrote: > On 8/4/26 07:32, Thomas Weißschuh wrote: > > System power off might be implemented through sys_off handlers. > > > > Currently these are not respected on microblaze. > > > > On power_off call into the generic power off function which will execute > > all regustered handlers. > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > --- > > arch/microblaze/kernel/reset.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c > > index 2f66c7963084..3612a20ca16d 100644 > > --- a/arch/microblaze/kernel/reset.c > > +++ b/arch/microblaze/kernel/reset.c > > @@ -27,6 +27,7 @@ void machine_halt(void) > > void machine_power_off(void) > > { > > + do_kernel_power_off(); > > pr_notice("Machine power off...\n"); > > Likely it should be here. Or you will never see this notice. Ack, will change. > > while (1) > > ; > > ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh 2026-08-04 5:32 ` [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() Thomas Weißschuh 2026-08-04 5:32 ` [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers Thomas Weißschuh @ 2026-08-04 5:32 ` Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-04 5:32 ` [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration Thomas Weißschuh 2026-08-31 12:57 ` [PATCH 0/4] microblaze: KUnit support Michal Simek 4 siblings, 1 reply; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-04 5:32 UTC (permalink / raw) To: Michal Simek, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev, Thomas Weißschuh microblaze is missing a generic architecture-wide power off mechanism. To enable KUnit for microblaze it is necessary for KUnit to shut down the machine in a way that QEMU will recognize. The machines emulated by QEMU do not provide machine-specific power off functionality which could be used. However at least the petalogix-s3adsp1800 machine will abort if an unaligned instruction is executed. An ugly message will be printed but that is not an issue for KUnit. Make use of this to provide a power off handler. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- This is quite hacky. But I didn't find a better solution. --- arch/microblaze/Kconfig | 9 +++++++++ arch/microblaze/kernel/reset.c | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 484ebb3baedf..0ca8999dd770 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -216,3 +216,12 @@ config MB_MANAGER Say N here unless you know what you are doing. endmenu + +config MB_POWER_OFF_THROUGH_UNALIGNED_PC + bool "Power off through unaligned PC" + help + This options adds a power off handler which executes an unaligned PC + so the machine resets in a generic way. This works for the + petalogix-s3adsp1800 QEMU machine. + + Say N here unless you know what you are doing. diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index 3612a20ca16d..4af660deed3b 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c @@ -41,3 +41,24 @@ void machine_restart(char *cmd) pr_emerg("Reboot failed -- System halted\n"); while (1); } + +#ifdef CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC +static int unaligned_pc_sys_off(struct sys_off_data *data) +{ + __asm__( + "bri 1\n" + ); + + return NOTIFY_DONE; +} + +static int __init register_unaligned_pc_sys_off(void) +{ + struct sys_off_handler *sys_off; + + sys_off = register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_LOW, + unaligned_pc_sys_off, NULL); + return PTR_ERR_OR_ZERO(sys_off); +} +device_initcall(register_unaligned_pc_sys_off); +#endif /* CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC */ -- 2.55.0 ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC 2026-08-04 5:32 ` [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC Thomas Weißschuh @ 2026-08-05 13:59 ` David Gow 0 siblings, 0 replies; 20+ messages in thread From: David Gow @ 2026-08-05 13:59 UTC (permalink / raw) To: Thomas Weißschuh, Michal Simek, Brendan Higgins, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : > microblaze is missing a generic architecture-wide power off mechanism. > > To enable KUnit for microblaze it is necessary for KUnit to shut down > the machine in a way that QEMU will recognize. The machines emulated by > QEMU do not provide machine-specific power off functionality which could > be used. > However at least the petalogix-s3adsp1800 machine will abort if an > unaligned instruction is executed. An ugly message will be printed but > that is not an issue for KUnit. > > Make use of this to provide a power off handler. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > --- > This is quite hacky. But I didn't find a better solution. This is hacky. It does work fine here, though, and I also don't have a better solution. But I'd feel better about it if a Microblaze person has seen it and at least not complained too loudly. Tested-by: David Gow <david@davidgow.net> > --- > arch/microblaze/Kconfig | 9 +++++++++ > arch/microblaze/kernel/reset.c | 21 +++++++++++++++++++++ > 2 files changed, 30 insertions(+) > > diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig > index 484ebb3baedf..0ca8999dd770 100644 > --- a/arch/microblaze/Kconfig > +++ b/arch/microblaze/Kconfig > @@ -216,3 +216,12 @@ config MB_MANAGER > Say N here unless you know what you are doing. > > endmenu > + > +config MB_POWER_OFF_THROUGH_UNALIGNED_PC > + bool "Power off through unaligned PC" > + help > + This options adds a power off handler which executes an unaligned PC > + so the machine resets in a generic way. This works for the > + petalogix-s3adsp1800 QEMU machine. > + > + Say N here unless you know what you are doing. > diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c > index 3612a20ca16d..4af660deed3b 100644 > --- a/arch/microblaze/kernel/reset.c > +++ b/arch/microblaze/kernel/reset.c > @@ -41,3 +41,24 @@ void machine_restart(char *cmd) > pr_emerg("Reboot failed -- System halted\n"); > while (1); > } > + > +#ifdef CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC > +static int unaligned_pc_sys_off(struct sys_off_data *data) > +{ > + __asm__( > + "bri 1\n" > + ); > + > + return NOTIFY_DONE; > +} > + > +static int __init register_unaligned_pc_sys_off(void) > +{ > + struct sys_off_handler *sys_off; > + > + sys_off = register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_LOW, > + unaligned_pc_sys_off, NULL); > + return PTR_ERR_OR_ZERO(sys_off); > +} > +device_initcall(register_unaligned_pc_sys_off); > +#endif /* CONFIG_MB_POWER_OFF_THROUGH_UNALIGNED_PC */ > ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh ` (2 preceding siblings ...) 2026-08-04 5:32 ` [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC Thomas Weißschuh @ 2026-08-04 5:32 ` Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-31 10:48 ` Michal Simek 2026-08-31 12:57 ` [PATCH 0/4] microblaze: KUnit support Michal Simek 4 siblings, 2 replies; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-04 5:32 UTC (permalink / raw) To: Michal Simek, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev, Thomas Weißschuh Add a basic configuration to run kunit tests on microblaze. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/testing/kunit/qemu_configs/microblaze.py b/tools/testing/kunit/qemu_configs/microblaze.py new file mode 100644 index 000000000000..ff012095e77d --- /dev/null +++ b/tools/testing/kunit/qemu_configs/microblaze.py @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-only +from ..qemu_config import QemuArchParams + +QEMU_ARCH = QemuArchParams(linux_arch='microblaze', + kconfig=''' +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', + ], +) -- 2.55.0 ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-04 5:32 ` [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration Thomas Weißschuh @ 2026-08-05 13:59 ` David Gow 2026-08-05 19:18 ` Thomas Weißschuh 2026-08-31 10:48 ` Michal Simek 1 sibling, 1 reply; 20+ messages in thread From: David Gow @ 2026-08-05 13:59 UTC (permalink / raw) To: Thomas Weißschuh, Michal Simek, Brendan Higgins, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : > Add a basic configuration to run kunit tests on microblaze. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- Works well here, though there are still a couple of test failures (and a longer timeout is needed to get through them all on my machine): > Testing complete. Ran 965 tests: passed: 866, failed: 3, skipped: 96 > Failures: blake2s.test_hash_alignment_consistency, memcpy.memmove_overlap_test, printf.dentry I'm okay with this going in via either the microblaze or KUnit trees. Any preferences? Reviewed-by: David Gow <david@davidgow.net> Cheers, -- David > tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/tools/testing/kunit/qemu_configs/microblaze.py b/tools/testing/kunit/qemu_configs/microblaze.py > new file mode 100644 > index 000000000000..ff012095e77d > --- /dev/null > +++ b/tools/testing/kunit/qemu_configs/microblaze.py > @@ -0,0 +1,17 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +from ..qemu_config import QemuArchParams > + > +QEMU_ARCH = QemuArchParams(linux_arch='microblaze', > + kconfig=''' > +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', > + ], > +) > ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-05 13:59 ` David Gow @ 2026-08-05 19:18 ` Thomas Weißschuh 2026-08-31 8:15 ` Michal Simek 0 siblings, 1 reply; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-05 19:18 UTC (permalink / raw) To: David Gow Cc: Michal Simek, Brendan Higgins, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 2026-08-05 21:59:16+0800, David Gow wrote: > Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : > > Add a basic configuration to run kunit tests on microblaze. > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > --- > > Works well here, though there are still a couple of test failures (and a > longer timeout is needed to get through them all on my machine): > > > Testing complete. Ran 965 tests: passed: 866, failed: 3, skipped: 96 > > Failures: blake2s.test_hash_alignment_consistency, > memcpy.memmove_overlap_test, printf.dentry These are all due to the broken memmove() implementation. It should be fixed by *either*: - Disabling CONFIG_OPT_LIB_FUNCTION - Enabling CONFIG_OPT_LIB_ASM > I'm okay with this going in via either the microblaze or KUnit trees. Any > preferences? None from me. I would have expected it to go through microblaze, though. > Reviewed-by: David Gow <david@davidgow.net> Thanks! (...) ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-05 19:18 ` Thomas Weißschuh @ 2026-08-31 8:15 ` Michal Simek 0 siblings, 0 replies; 20+ messages in thread From: Michal Simek @ 2026-08-31 8:15 UTC (permalink / raw) To: Thomas Weißschuh, David Gow Cc: Brendan Higgins, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 8/5/26 21:18, Thomas Weißschuh wrote: > On 2026-08-05 21:59:16+0800, David Gow wrote: >> Le 04/08/2026 à 13:32, Thomas Weißschuh a écrit : >>> Add a basic configuration to run kunit tests on microblaze. >>> >>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> >>> --- >> >> Works well here, though there are still a couple of test failures (and a >> longer timeout is needed to get through them all on my machine): >> >>> Testing complete. Ran 965 tests: passed: 866, failed: 3, skipped: 96 >>> Failures: blake2s.test_hash_alignment_consistency, >> memcpy.memmove_overlap_test, printf.dentry > > These are all due to the broken memmove() implementation. > > It should be fixed by *either*: > - Disabling CONFIG_OPT_LIB_FUNCTION > - Enabling CONFIG_OPT_LIB_ASM Let me comment this in the patch directly. > >> I'm okay with this going in via either the microblaze or KUnit trees. Any >> preferences? > > None from me. I would have expected it to go through microblaze, though. Not an issue to go this through Microblaze tree. 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 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-04 5:32 ` [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration Thomas Weißschuh 2026-08-05 13:59 ` David Gow @ 2026-08-31 10:48 ` Michal Simek 2026-08-31 15:43 ` Thomas Weißschuh 1 sibling, 1 reply; 20+ messages in thread From: Michal Simek @ 2026-08-31 10:48 UTC (permalink / raw) To: Thomas Weißschuh, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev On 8/4/26 07:32, Thomas Weißschuh wrote: > Add a basic configuration to run kunit tests on microblaze. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/tools/testing/kunit/qemu_configs/microblaze.py b/tools/testing/kunit/qemu_configs/microblaze.py > new file mode 100644 > index 000000000000..ff012095e77d > --- /dev/null > +++ b/tools/testing/kunit/qemu_configs/microblaze.py > @@ -0,0 +1,17 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +from ..qemu_config import QemuArchParams > + > +QEMU_ARCH = QemuArchParams(linux_arch='microblaze', > + kconfig=''' > +CONFIG_CPU_BIG_ENDIAN=y Big endian is quite old and I am even surprised that it is working. > +CONFIG_SERIAL_UARTLITE=y > +CONFIG_SERIAL_UARTLITE_CONSOLE=y I think it is just pure luck that this worked for you because you didn't rewrite the most important parts of config. You should define at least these values 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 to be aligned with s3adsp1800 It will solve these two issues too. ERROR: Microblaze BARREL, MSR, PCMP or DIV-different for kernel and DTS ERROR: Microblaze HW_MUL-different for kernel and DTS > +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', > + ], > +) > That's bring us to different topic. When qemu runs I see these 2 issues qemu-system-microblaze: -accel kvm: invalid accelerator kvm qemu-system-microblaze: -accel hvf: invalid accelerator hvf I don't have any issue if you want to wire big-endian version but would be more useful to wire little endian version. If there is an issue with memmove implementation I can't see any issue to disable that options to let it pass from the beginning and solve it separately. This should be fragment for Little endian. [linux](next)$ cat tools/testing/kunit/qemu_configs/microblazeel.py # 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='microblazeel', kernel_path='arch/microblaze/boot/linux.bin', kernel_command_line='kunit_shutdown=poweroff', extra_qemu_params=[ '-M', 'petalogix-ml605', ], ) Thanks, Michal ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-31 10:48 ` Michal Simek @ 2026-08-31 15:43 ` Thomas Weißschuh 2026-09-01 13:33 ` Michal Simek 0 siblings, 1 reply; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-31 15:43 UTC (permalink / raw) To: Michal Simek Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 2026-08-31 12:48:08+0200, Michal Simek wrote: > On 8/4/26 07:32, Thomas Weißschuh wrote: > > Add a basic configuration to run kunit tests on microblaze. > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > --- > > tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ > > 1 file changed, 17 insertions(+) > > > > diff --git a/tools/testing/kunit/qemu_configs/microblaze.py b/tools/testing/kunit/qemu_configs/microblaze.py > > new file mode 100644 > > index 000000000000..ff012095e77d > > --- /dev/null > > +++ b/tools/testing/kunit/qemu_configs/microblaze.py > > @@ -0,0 +1,17 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > +from ..qemu_config import QemuArchParams > > + > > +QEMU_ARCH = QemuArchParams(linux_arch='microblaze', > > + kconfig=''' > > +CONFIG_CPU_BIG_ENDIAN=y > > Big endian is quite old and I am even surprised that it is working. Oh ok. This was the only configuration that I got working. > > +CONFIG_SERIAL_UARTLITE=y > > +CONFIG_SERIAL_UARTLITE_CONSOLE=y > > I think it is just pure luck that this worked for you because you didn't > rewrite the most important parts of config. > > You should define at least these values > > 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 > > to be aligned with s3adsp1800 Will do. > It will solve these two issues too. > ERROR: Microblaze BARREL, MSR, PCMP or DIV-different for kernel and DTS > ERROR: Microblaze HW_MUL-different for kernel and DTS > > > +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', > > + ], > > +) > > > > That's bring us to different topic. When qemu runs I see these 2 issues > > qemu-system-microblaze: -accel kvm: invalid accelerator kvm > qemu-system-microblaze: -accel hvf: invalid accelerator hvf That is an artifact on how KUnit starts qemu. It should not matter. > I don't have any issue if you want to wire big-endian version but would be > more useful to wire little endian version. Understood. Let's try to have both. > If there is an issue with memmove implementation I can't see any issue to > disable that options to let it pass from the beginning and solve it > separately. Ack. Could you take care of this? I have next to no idea about microblaze. > This should be fragment for Little endian. Thanks, unfortunately this hangs for me with my distros QEMU 11.1.0. No output, 100% CPU usage during boot. I am using qemu-system-microblaze instead of qemu-system-microblazel, as the latter is not available anymore, but the former is documented to also handle little endian automatically. > > [linux](next)$ cat tools/testing/kunit/qemu_configs/microblazeel.py > # 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='microblazeel', > kernel_path='arch/microblaze/boot/linux.bin', > kernel_command_line='kunit_shutdown=poweroff', > extra_qemu_params=[ > '-M', 'petalogix-ml605', > ], > ) ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-08-31 15:43 ` Thomas Weißschuh @ 2026-09-01 13:33 ` Michal Simek 2026-09-01 18:33 ` Thomas Weißschuh 0 siblings, 1 reply; 20+ messages in thread From: Michal Simek @ 2026-09-01 13:33 UTC (permalink / raw) To: Thomas Weißschuh Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 8/31/26 17:43, Thomas Weißschuh wrote: > On 2026-08-31 12:48:08+0200, Michal Simek wrote: >> On 8/4/26 07:32, Thomas Weißschuh wrote: >>> Add a basic configuration to run kunit tests on microblaze. >>> >>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> >>> --- >>> tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ >>> 1 file changed, 17 insertions(+) >>> >>> diff --git a/tools/testing/kunit/qemu_configs/microblaze.py b/tools/testing/kunit/qemu_configs/microblaze.py >>> new file mode 100644 >>> index 000000000000..ff012095e77d >>> --- /dev/null >>> +++ b/tools/testing/kunit/qemu_configs/microblaze.py >>> @@ -0,0 +1,17 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> +from ..qemu_config import QemuArchParams >>> + >>> +QEMU_ARCH = QemuArchParams(linux_arch='microblaze', >>> + kconfig=''' >>> +CONFIG_CPU_BIG_ENDIAN=y >> >> Big endian is quite old and I am even surprised that it is working. > > Oh ok. This was the only configuration that I got working. > >>> +CONFIG_SERIAL_UARTLITE=y >>> +CONFIG_SERIAL_UARTLITE_CONSOLE=y >> >> I think it is just pure luck that this worked for you because you didn't >> rewrite the most important parts of config. >> >> You should define at least these values >> >> 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 >> >> to be aligned with s3adsp1800 > > Will do. > >> It will solve these two issues too. >> ERROR: Microblaze BARREL, MSR, PCMP or DIV-different for kernel and DTS >> ERROR: Microblaze HW_MUL-different for kernel and DTS >> >>> +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', >>> + ], >>> +) >>> >> >> That's bring us to different topic. When qemu runs I see these 2 issues >> >> qemu-system-microblaze: -accel kvm: invalid accelerator kvm >> qemu-system-microblaze: -accel hvf: invalid accelerator hvf > > That is an artifact on how KUnit starts qemu. It should not matter. > >> I don't have any issue if you want to wire big-endian version but would be >> more useful to wire little endian version. > > Understood. Let's try to have both. > >> If there is an issue with memmove implementation I can't see any issue to >> disable that options to let it pass from the beginning and solve it >> separately. > > Ack. Could you take care of this? I have next to no idea about microblaze. On little endian this is passing. I can add it to my todo list but big endian is very very old and likely none is using it anymore. > >> This should be fragment for Little endian. > > Thanks, unfortunately this hangs for me with my distros QEMU 11.1.0. > No output, 100% CPU usage during boot. I am using qemu-system-microblaze > instead of qemu-system-microblazel, as the latter is not available > anymore, but the former is documented to also handle little endian > automatically. > I built the latest qemu like this ../qemu/configure --target-list=microblaze-softmmu,microblaze-linux-user,microblazeel-linux-user --enable-gcrypt --disable-docs /mnt/projects/xilinx-new-git/qemu.org/build-microblaze/qemu-system-microblaze --version QEMU emulator version 11.1.50 (v11.1.0-779-gd2e570cc0f97) And can't see any issue. Thanks, Michal /mnt/projects/xilinx-new-git/qemu.org/build-microblaze/qemu-system-microblaze -nodefaults -m 1024 -kernel .kunit/arch/microblaze/boot/linux.bin -append 'kunit.enable=1 kunit_shutdown=poweroff' -no-reboot -nographic -accel kvm -accel hvf -accel tcg -serial stdio -M petalogix-ml605 qemu-system-microblaze: -accel kvm: invalid accelerator kvm qemu-system-microblaze: -accel hvf: invalid accelerator hvf qemu-system-microblaze: falling back to tcg qemu-system-microblaze: warning: nic xlnx.axi-ethernet.0 has no peer random: crng init done Ramdisk addr 0x00000000, FDT at 0x5058e528 Linux version 7.3.0-rc1-00023-g5a713478d535 (monstr@monstr-desktop3) (microblazeel-amd-linux-gcc.real (GCC) 13.4.0, GNU ld (GNU Binutils) 2.42.0.20240723) #11 Tue Sep 1 15:18:11 CEST 2026 setup_memory: min_low_pfn: 0x50000 setup_memory: max_low_pfn: 0x60000 setup_memory: max_pfn: 0x60000 OF: reserved mem: Reserved memory: No reserved-memory node in the DT setup_cpuinfo: initialising setup_cpuinfo: No PVR support. Using static CPU info from FDT wb_msr WB won't work properly Zone ranges: DMA [mem 0x0000000050000000-0x000000005fffffff] Normal empty Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000050000000-0x000000005fffffff] Initmem setup node 0 [mem 0x0000000050000000-0x000000005fffffff] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: [0] 0 Kernel command line: kunit.enable=1 kunit_shutdown=poweroff printk: log buffer data + meta data: 131072 + 409600 = 540672 bytes Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear) Built 1 zonelists, mobility grouping on. Total pages: 65536 mem auto-init: stack:all(zero), heap alloc:off, heap free:off SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 irq-xilinx: /axi/interrupt-controller@81800000: num_irq=6, edge=0x4 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns ERROR: CPU CCF input clock not found /axi/system-timer@83c00000: irq=2 ERROR: timer CCF input clock not found clocksource: xilinx_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns xilinx_timer_shutdown xilinx_timer_set_periodic sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns Console: colour dummy device 80x25 printk: legacy console [tty0] enabled Calibrating delay loop... 1945.60 BogoMIPS (lpj=3891200) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) VFS: Finished mounting rootfs on nullfs Memory: 253204K/262144K available (4023K kernel code, 596K rwdata, 832K rodata, 161K init, 192K bss, 8436K reserved, 0K cma-reserved) posixtimers hash table entries: 512 (order: 0, 2048 bytes, linear) futex hash table entries: 256 (3072 bytes on 1 NUMA nodes, total 3 KiB, linear). DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations clocksource: Switched to clocksource xilinx_clocksource workingset: timestamp_bits=30 (anon: 25) max_order=16 bucket_order=0 (anon: 0) io scheduler mq-deadline registered io scheduler kyber registered Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled 83e00000.serial: ttyS0 MMIO:0x83e01000 (irq = 5, base_baud = 6250000) is a 16550A printk: console [ttyS0] enabled clk: Disabling unused clocks KTAP version 1 1..118 KTAP version 1 # Subtest: example_init # module: kunit_example_test # is_init: true 1..1 ok 1 example_init_test ok 1 example_init # miscdev_init: found misc device minor 15 available # miscdev_init: found misc device minor 128 available # miscdev_init: found misc device minor 0 available # miscdev_init: found misc device minor 254 available KTAP version 1 # Subtest: miscdev_init # module: misc_minor_kunit # is_init: true 1..7 KTAP version 1 # Subtest: miscdev_test_static_basic ok 1 lower static range, top ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-09-01 13:33 ` Michal Simek @ 2026-09-01 18:33 ` Thomas Weißschuh 2026-09-02 10:44 ` Michal Simek 0 siblings, 1 reply; 20+ messages in thread From: Thomas Weißschuh @ 2026-09-01 18:33 UTC (permalink / raw) To: Michal Simek Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 2026-09-01 15:33:11+0200, Michal Simek wrote: > On 8/31/26 17:43, Thomas Weißschuh wrote: > > On 2026-08-31 12:48:08+0200, Michal Simek wrote: (...) > > > If there is an issue with memmove implementation I can't see any issue to > > > disable that options to let it pass from the beginning and solve it > > > separately. > > > > Ack. Could you take care of this? I have next to no idea about microblaze. > > On little endian this is passing. I can add it to my todo list but big > endian is very very old and likely none is using it anymore. If it is not supposed to work maybe mark it as BROKEN or disable the custom memmove() implementation there and instead rely on the generic one from lib/string.c? > > > > > This should be fragment for Little endian. > > > > Thanks, unfortunately this hangs for me with my distros QEMU 11.1.0. > > No output, 100% CPU usage during boot. I am using qemu-system-microblaze > > instead of qemu-system-microblazel, as the latter is not available > > anymore, but the former is documented to also handle little endian > > automatically. > > > > I built the latest qemu like this > > ../qemu/configure --target-list=microblaze-softmmu,microblaze-linux-user,microblazeel-linux-user > --enable-gcrypt --disable-docs > > /mnt/projects/xilinx-new-git/qemu.org/build-microblaze/qemu-system-microblaze > --version > QEMU emulator version 11.1.50 (v11.1.0-779-gd2e570cc0f97) For me it still doesn't work. I am using the same build of QEMU and GCC 13.4.0 (or 16.2.0) from crosstools.kernel.org. > And can't see any issue. (...) > /mnt/projects/xilinx-new-git/qemu.org/build-microblaze/qemu-system-microblaze > -nodefaults -m 1024 -kernel .kunit/arch/microblaze/boot/linux.bin -append > 'kunit.enable=1 kunit_shutdown=poweroff' -no-reboot -nographic -accel kvm > -accel hvf -accel tcg -serial stdio -M petalogix-ml605 > qemu-system-microblaze: -accel kvm: invalid accelerator kvm > qemu-system-microblaze: -accel hvf: invalid accelerator hvf > qemu-system-microblaze: falling back to tcg > qemu-system-microblaze: warning: nic xlnx.axi-ethernet.0 has no peer > random: crng init done > Ramdisk addr 0x00000000, > FDT at 0x5058e528 > Linux version 7.3.0-rc1-00023-g5a713478d535 (monstr@monstr-desktop3) > (microblazeel-amd-linux-gcc.real (GCC) 13.4.0, GNU ld (GNU Binutils) I guess this is a special GCC variant. Could you try with one from https://mirrors.edge.kernel.org/pub/tools/crosstool/ ? (...) Thomas ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration 2026-09-01 18:33 ` Thomas Weißschuh @ 2026-09-02 10:44 ` Michal Simek 0 siblings, 0 replies; 20+ messages in thread From: Michal Simek @ 2026-09-02 10:44 UTC (permalink / raw) To: Thomas Weißschuh Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 9/1/26 20:33, Thomas Weißschuh wrote: > On 2026-09-01 15:33:11+0200, Michal Simek wrote: >> On 8/31/26 17:43, Thomas Weißschuh wrote: >>> On 2026-08-31 12:48:08+0200, Michal Simek wrote: > > (...) > >>>> If there is an issue with memmove implementation I can't see any issue to >>>> disable that options to let it pass from the beginning and solve it >>>> separately. >>> >>> Ack. Could you take care of this? I have next to no idea about microblaze. >> >> On little endian this is passing. I can add it to my todo list but big >> endian is very very old and likely none is using it anymore. > > If it is not supposed to work maybe mark it as BROKEN or disable the > custom memmove() implementation there and instead rely on the generic > one from lib/string.c? This should be enough. Do you want to send a patch for it? diff --git a/arch/microblaze/Kconfig.platform b/arch/microblaze/Kconfig.platform index 9cf9007ed69a..2d7c21767215 100644 --- a/arch/microblaze/Kconfig.platform +++ b/arch/microblaze/Kconfig.platform @@ -10,6 +10,7 @@ menu "Platform options" config OPT_LIB_FUNCTION bool "Optimized lib function" default y + depends on CPU_BIG_ENDIAN help Turns on optimized library functions (memcpy and memmove). They are optimized by using word alignment. This will work @@ -21,7 +22,6 @@ config OPT_LIB_FUNCTION config OPT_LIB_ASM bool "Optimized lib function ASM" depends on OPT_LIB_FUNCTION && (XILINX_MICROBLAZE0_USE_BARREL = 1) - depends on CPU_BIG_ENDIAN default n help Turns on optimized library functions (memcpy and memmove). >>> >>>> This should be fragment for Little endian. >>> >>> Thanks, unfortunately this hangs for me with my distros QEMU 11.1.0. >>> No output, 100% CPU usage during boot. I am using qemu-system-microblaze >>> instead of qemu-system-microblazel, as the latter is not available >>> anymore, but the former is documented to also handle little endian >>> automatically. >>> >> >> I built the latest qemu like this >> >> ../qemu/configure --target-list=microblaze-softmmu,microblaze-linux-user,microblazeel-linux-user >> --enable-gcrypt --disable-docs >> >> /mnt/projects/xilinx-new-git/qemu.org/build-microblaze/qemu-system-microblaze >> --version >> QEMU emulator version 11.1.50 (v11.1.0-779-gd2e570cc0f97) > > For me it still doesn't work. I am using the same build of QEMU and GCC > 13.4.0 (or 16.2.0) from crosstools.kernel.org. I am not a toolchain expert. I do use toolchains from Xilinx design tools and I have also tried toolchains from buildroot. Linux version 7.3.0-rc1-00017-g139833dc9bf4 (monstr@monstr-desktop3) (microblazeel-buildroot-linux-uclibc-gcc.br_real (Buildroot 2026.08-rc3-13-geaf7a45ddfdc) 15.3.0, GNU ld (GNU Binutils) 2.45.1) #1 Wed Sep 2 12:39:02 CEST 2026 But keep in mind that there is a need to have v15.3.0 or 16.2.0 toolchain fixed by this https://lore.kernel.org/all/20260902040121.1583600-1-neal.frager@amd.com/ Thanks, Michal ^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 0/4] microblaze: KUnit support 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh ` (3 preceding siblings ...) 2026-08-04 5:32 ` [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration Thomas Weißschuh @ 2026-08-31 12:57 ` Michal Simek 2026-08-31 15:45 ` Thomas Weißschuh 4 siblings, 1 reply; 20+ messages in thread From: Michal Simek @ 2026-08-31 12:57 UTC (permalink / raw) To: Thomas Weißschuh, Brendan Higgins, David Gow, Rae Moar Cc: linux-kernel, linux-kselftest, kunit-dev Hi, On 8/4/26 07:32, Thomas Weißschuh wrote: > Add the necessary prerequisites and configuration to run KUnit on > microblaze. > > Please note that various KUnit tests will fail with the default > configuration as the memmove() implementation from > arch/microblaze/lib/memmove.c seems to be broken. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > Thomas Weißschuh (4): > microblaze: uaccess: Zero out destination on failed get_user() > microblaze: reset: Call POWER_OFF handlers > microblaze: reset: Provide a power off handler through an unaligned PC > kunit: qemu_configs: Add microblaze configuration > > arch/microblaze/Kconfig | 9 +++++++++ > arch/microblaze/include/asm/uaccess.h | 3 ++- > arch/microblaze/kernel/reset.c | 22 ++++++++++++++++++++++ > tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ > 4 files changed, 50 insertions(+), 1 deletion(-) > --- > base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482 > change-id: 20260802-kunit-microblaze-7a3f6ac88b4d > > Best regards, > -- > Thomas Weißschuh <linux@weissschuh.net> > One more thing. I see that this test is also failing on 32bit riscv. Is this something 32bit architecture related? That was only one test which failed on little endian Microblaze. Thanks, Michal ./tools/testing/kunit/kunit.py run --arch=riscv32 --cross_compile=riscv32-unknown-linux-gnu- "gpu_buddy.gpu_test_buddy_alloc_exceeds_max_order" [14:53:50] Configuring KUnit Kernel ... [14:53:50] Building KUnit Kernel ... Populating config with: $ make ARCH=riscv O=.kunit olddefconfig CROSS_COMPILE=riscv32-unknown-linux-gnu- Building with: $ make all compile_commands.json scripts_gdb ARCH=riscv O=.kunit --jobs=12 CROSS_COMPILE=riscv32-unknown-linux-gnu- [14:53:54] Starting KUnit Kernel (1/1)... [14:53:54] ============================================================ Running tests with: $ qemu-system-riscv32 -nodefaults -m 1024 -kernel .kunit/arch/riscv/boot/Image -append 'kunit.filter_glob=gpu_buddy.gpu_test_buddy_alloc_exceeds_max_order kunit.enable=1 console=ttyS0 kunit_shutdown=reboot' -no-reboot -nographic -accel kvm -accel hvf -accel tcg -serial stdio -machine virt [14:53:56] ================== gpu_buddy (1 subtest) =================== [14:53:56] # gpu_test_buddy_alloc_exceeds_max_order: EXPECTATION FAILED at drivers/gpu/tests/gpu_buddy_test.c:1429 [14:53:56] Expected err == -22, but [14:53:56] err == 0 (0x0) [14:53:56] ------------[ cut here ]------------ [14:53:56] WARNING: drivers/gpu/buddy.c:508 at gpu_buddy_fini+0x26e/0x36c, CPU#0: kunit_try_catch/27 [14:53:56] CPU: 0 UID: 0 PID: 27 Comm: kunit_try_catch Tainted: G N 7.3.0-rc1-00016-g9987f87429e8-dirty #9 PREEMPTLAZY [14:53:56] Tainted: [N]=TEST [14:53:56] Hardware name: riscv-virtio,qemu (DT) [14:53:56] epc : gpu_buddy_fini+0x26e/0x36c [14:53:56] ra : gpu_buddy_fini+0xc0/0x36c [14:53:56] epc : c02adc98 ra : c02adaea sp : c1a8dde0 [14:53:56] gp : c14a13c8 tp : c1880000 t0 : 00000000 [14:53:56] t1 : c1b44630 t2 : 00000000 s0 : c1a8de10 [14:53:56] s1 : 00000015 a0 : fffffff4 a1 : c1b446f0 [14:53:56] a2 : fffffc00 a3 : 00000004 a4 : 00000008 [14:53:56] a5 : 00000400 a6 : 00000000 a7 : 40000812 [14:53:56] s2 : c1a8de40 s3 : 00000000 s4 : 00000c00 [14:53:56] s5 : fffff000 s6 : c14a3000 s7 : 0000001f [14:53:56] s8 : 80000000 s9 : 00000002 s10: 00000000 [14:53:56] s11: 00000000 t3 : c1b445d0 t4 : 00000000 [14:53:56] t5 : 0000000d t6 : 00000001 ssp : 00000000 [14:53:56] status: 00000120 badaddr: 00000000 cause: 00000003 [14:53:56] [<c02adc98>] gpu_buddy_fini+0x26e/0x36c [14:53:56] [<c02b0ece>] gpu_test_buddy_alloc_exceeds_max_order+0x16c/0x2e4 [14:53:56] [<c01e1238>] kunit_try_run_case+0x72/0x1ba [14:53:56] [<c01e2f16>] kunit_generic_run_threadfn_adapter+0x1a/0x32 [14:53:56] [<c003bfdc>] kthread+0xbe/0xd4 [14:53:56] [<c000f6f6>] ret_from_fork_kernel+0x1a/0x110 [14:53:56] [<c035cff2>] ret_from_exception_end+0x16/0x18 [14:53:56] ---[ end trace 0000000000000000 ]--- [14:53:56] # gpu_test_buddy_alloc_exceeds_max_order: drivers/gpu/buddy.c:508: gpu_buddy_assert(gpu_buddy_block_is_free(mm->roots[i])) [14:53:56] ------------[ cut here ]------------ [14:53:56] WARNING: drivers/gpu/buddy.c:516 at gpu_buddy_fini+0x33e/0x36c, CPU#0: kunit_try_catch/27 [14:53:56] CPU: 0 UID: 0 PID: 27 Comm: kunit_try_catch Tainted: G W N 7.3.0-rc1-00016-g9987f87429e8-dirty #9 PREEMPTLAZY [14:53:56] Tainted: [W]=WARN, [N]=TEST [14:53:56] Hardware name: riscv-virtio,qemu (DT) [14:53:56] epc : gpu_buddy_fini+0x33e/0x36c [14:53:56] ra : gpu_buddy_fini+0xe2/0x36c [14:53:56] epc : c02add68 ra : c02adb0c sp : c1a8dde0 [14:53:56] gp : c14a13c8 tp : c1880000 t0 : 00005b73 [14:53:56] t1 : c1b44630 t2 : 5d695b73 s0 : c1a8de10 [14:53:56] s1 : 00000000 a0 : c1b12a00 a1 : 00000000 [14:53:56] a2 : 00000002 a3 : 00000000 a4 : 00001000 [14:53:56] a5 : 40000000 a6 : 0000007b a7 : 40000812 [14:53:56] s2 : c1a8de40 s3 : c0cd84c8 s4 : c1a8de20 [14:53:56] s5 : 00000001 s6 : 00000000 s7 : 00000000 [14:53:56] s8 : 80000000 s9 : 00000002 s10: 00000000 [14:53:56] s11: 00000000 t3 : c14a9b36 t4 : c14a9b36 [14:53:56] t5 : c14a9ab8 t6 : c14a9b34 ssp : 00000000 [14:53:56] status: 00000120 badaddr: 00000000 cause: 00000003 [14:53:56] [<c02add68>] gpu_buddy_fini+0x33e/0x36c [14:53:56] [<c02b0ece>] gpu_test_buddy_alloc_exceeds_max_order+0x16c/0x2e4 [14:53:56] [<c01e1238>] kunit_try_run_case+0x72/0x1ba [14:53:56] [<c01e2f16>] kunit_generic_run_threadfn_adapter+0x1a/0x32 [14:53:56] [<c003bfdc>] kthread+0xbe/0xd4 [14:53:56] [<c000f6f6>] ret_from_fork_kernel+0x1a/0x110 [14:53:56] [<c035cff2>] ret_from_exception_end+0x16/0x18 [14:53:56] ---[ end trace 0000000000000000 ]--- [14:53:56] # gpu_test_buddy_alloc_exceeds_max_order: drivers/gpu/buddy.c:516: gpu_buddy_assert(mm->avail == mm->size) [14:53:56] ------------[ cut here ]------------ [14:53:56] WARNING: drivers/gpu/buddy.c:519 at gpu_buddy_fini+0x240/0x36c, CPU#0: kunit_try_catch/27 [14:53:56] CPU: 0 UID: 0 PID: 27 Comm: kunit_try_catch Tainted: G W N 7.3.0-rc1-00016-g9987f87429e8-dirty #9 PREEMPTLAZY [14:53:56] Tainted: [W]=WARN, [N]=TEST [14:53:56] Hardware name: riscv-virtio,qemu (DT) [14:53:56] epc : gpu_buddy_fini+0x240/0x36c [14:53:56] ra : gpu_buddy_fini+0x36a/0x36c [14:53:56] epc : c02adc6a ra : c02add94 sp : c1a8dde0 [14:53:56] gp : c14a13c8 tp : c1880000 t0 : 0000733e [14:53:56] t1 : 00000029 t2 : 7a69733e s0 : c1a8de10 [14:53:56] s1 : 00000012 a0 : c1803400 a1 : ffaf5490 [14:53:56] a2 : 00000001 a3 : 3f2e0000 a4 : 00000001 [14:53:56] a5 : 00000000 a6 : 0000007b a7 : 00735049 [14:53:56] s2 : c1a8de40 s3 : c0cd84c8 s4 : c1a8de20 [14:53:56] s5 : 00000001 s6 : 00000000 s7 : 00000000 [14:53:56] s8 : 80000000 s9 : 00000002 s10: 00000000 [14:53:56] s11: 00000000 t3 : c14aa17a t4 : c14aa17a [14:53:56] t5 : c14aa10c t6 : c14aa178 ssp : 00000000 [14:53:56] status: 00000120 badaddr: 00000000 cause: 00000003 [14:53:56] [<c02adc6a>] gpu_buddy_fini+0x240/0x36c [14:53:56] [<c02b0ece>] gpu_test_buddy_alloc_exceeds_max_order+0x16c/0x2e4 [14:53:56] [<c01e1238>] kunit_try_run_case+0x72/0x1ba [14:53:56] [<c01e2f16>] kunit_generic_run_threadfn_adapter+0x1a/0x32 [14:53:56] [<c003bfdc>] kthread+0xbe/0xd4 [14:53:56] [<c000f6f6>] ret_from_fork_kernel+0x1a/0x110 [14:53:56] [<c035cff2>] ret_from_exception_end+0x16/0x18 [14:53:56] ---[ end trace 0000000000000000 ]--- [14:53:56] # gpu_test_buddy_alloc_exceeds_max_order: drivers/gpu/buddy.c:519: gpu_buddy_assert(!mm->used_scoreboard[i]) [14:53:56] [FAILED] gpu_test_buddy_alloc_exceeds_max_order [14:53:56] # gpu_buddy: Testing GPU buddy manager, with random_seed=0x11376afa [14:53:56] # module: gpu_buddy_tests [14:53:56] ==================== [FAILED] gpu_buddy ==================== [14:53:56] ============================================================ [14:53:56] Testing complete. Ran 1 tests: failed: 1 [14:53:56] Elapsed time: 6.310s total, 0.001s configuring, 4.289s building, 1.982s running -- 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 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/4] microblaze: KUnit support 2026-08-31 12:57 ` [PATCH 0/4] microblaze: KUnit support Michal Simek @ 2026-08-31 15:45 ` Thomas Weißschuh 0 siblings, 0 replies; 20+ messages in thread From: Thomas Weißschuh @ 2026-08-31 15:45 UTC (permalink / raw) To: Michal Simek Cc: Brendan Higgins, David Gow, Rae Moar, linux-kernel, linux-kselftest, kunit-dev On 2026-08-31 14:57:36+0200, Michal Simek wrote: > Hi, > > On 8/4/26 07:32, Thomas Weißschuh wrote: > > Add the necessary prerequisites and configuration to run KUnit on > > microblaze. > > > > Please note that various KUnit tests will fail with the default > > configuration as the memmove() implementation from > > arch/microblaze/lib/memmove.c seems to be broken. > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > --- > > Thomas Weißschuh (4): > > microblaze: uaccess: Zero out destination on failed get_user() > > microblaze: reset: Call POWER_OFF handlers > > microblaze: reset: Provide a power off handler through an unaligned PC > > kunit: qemu_configs: Add microblaze configuration > > > > arch/microblaze/Kconfig | 9 +++++++++ > > arch/microblaze/include/asm/uaccess.h | 3 ++- > > arch/microblaze/kernel/reset.c | 22 ++++++++++++++++++++++ > > tools/testing/kunit/qemu_configs/microblaze.py | 17 +++++++++++++++++ > > 4 files changed, 50 insertions(+), 1 deletion(-) > > --- > > base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482 > > change-id: 20260802-kunit-microblaze-7a3f6ac88b4d > > > > Best regards, > > -- > > Thomas Weißschuh <linux@weissschuh.net> > > > > One more thing. I see that this test is also failing on 32bit riscv. Is this > something 32bit architecture related? That was only one test which failed on > little endian Microblaze. This is a general issue of this test on 32-bit: https://lore.kernel.org/lkml/20260830103321.2042968-1-david@davidgow.net/ (...) > [14:53:56] # gpu_test_buddy_alloc_exceeds_max_order: > drivers/gpu/buddy.c:519: gpu_buddy_assert(!mm->used_scoreboard[i]) > [14:53:56] [FAILED] gpu_test_buddy_alloc_exceeds_max_order > [14:53:56] # gpu_buddy: Testing GPU buddy manager, with random_seed=0x11376afa > [14:53:56] # module: gpu_buddy_tests > [14:53:56] ==================== [FAILED] gpu_buddy ==================== > [14:53:56] ============================================================ > [14:53:56] Testing complete. Ran 1 tests: failed: 1 > [14:53:56] Elapsed time: 6.310s total, 0.001s configuring, 4.289s building, > 1.982s running ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2026-09-02 10:44 UTC | newest] Thread overview: 20+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-04 5:32 [PATCH 0/4] microblaze: KUnit support Thomas Weißschuh 2026-08-04 5:32 ` [PATCH 1/4] microblaze: uaccess: Zero out destination on failed get_user() Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-04 5:32 ` [PATCH 2/4] microblaze: reset: Call POWER_OFF handlers Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-31 8:13 ` Michal Simek 2026-08-31 15:39 ` Thomas Weißschuh 2026-08-04 5:32 ` [PATCH 3/4] microblaze: reset: Provide a power off handler through an unaligned PC Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-04 5:32 ` [PATCH 4/4] kunit: qemu_configs: Add microblaze configuration Thomas Weißschuh 2026-08-05 13:59 ` David Gow 2026-08-05 19:18 ` Thomas Weißschuh 2026-08-31 8:15 ` Michal Simek 2026-08-31 10:48 ` Michal Simek 2026-08-31 15:43 ` Thomas Weißschuh 2026-09-01 13:33 ` Michal Simek 2026-09-01 18:33 ` Thomas Weißschuh 2026-09-02 10:44 ` Michal Simek 2026-08-31 12:57 ` [PATCH 0/4] microblaze: KUnit support Michal Simek 2026-08-31 15:45 ` Thomas Weißschuh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox