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 <[email protected]>
> > ---
> >   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',
>                                                  ],
> )

Reply via email to