[PATCH 0/2] arm: Add collie and sx functional tests

Peter Maydell posted 2 patches 5 days, 4 hours ago
MAINTAINERS                         |  1 +
tests/functional/meson.build        |  3 ++
tests/functional/test_arm_collie.py | 31 +++++++++++++
tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
4 files changed, 107 insertions(+)
create mode 100755 tests/functional/test_arm_collie.py
create mode 100755 tests/functional/test_arm_sx1.py
[PATCH 0/2] arm: Add collie and sx functional tests
Posted by Peter Maydell 5 days, 4 hours ago
This patchset adds new functional tests for the collie and sx1
boards, which are the only remaining ones that survived the
culling of the OMAP/PXA2xx/strongarm machines.

For these tests I'm indebted to Guenter Roeck, who has kindly
built and made available the kernel images, rootfs, etc and
documented the commands needed to boot them. All I've done
here is wrap those up into test cases in our testcase
framework by cribbing from some of our existing test code.

Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
 -- the sd card test for the sx1 board will not pass without
    that bugfix

thanks
-- PMM

Peter Maydell (2):
  tests/functional: Add a functional test for the collie board
  tests/functional: Add a functional test for the sx1 board

 MAINTAINERS                         |  1 +
 tests/functional/meson.build        |  3 ++
 tests/functional/test_arm_collie.py | 31 +++++++++++++
 tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
 4 files changed, 107 insertions(+)
 create mode 100755 tests/functional/test_arm_collie.py
 create mode 100755 tests/functional/test_arm_sx1.py

-- 
2.34.1
Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Thomas Huth 1 day, 13 hours ago
On 17/10/2024 18.32, Peter Maydell wrote:
> This patchset adds new functional tests for the collie and sx1
> boards, which are the only remaining ones that survived the
> culling of the OMAP/PXA2xx/strongarm machines.
> 
> For these tests I'm indebted to Guenter Roeck, who has kindly
> built and made available the kernel images, rootfs, etc and
> documented the commands needed to boot them. All I've done
> here is wrap those up into test cases in our testcase
> framework by cribbing from some of our existing test code.
> 
> Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
> ("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
>   -- the sd card test for the sx1 board will not pass without
>      that bugfix
> 
> thanks
> -- PMM
> 
> Peter Maydell (2):
>    tests/functional: Add a functional test for the collie board
>    tests/functional: Add a functional test for the sx1 board
> 
>   MAINTAINERS                         |  1 +
>   tests/functional/meson.build        |  3 ++
>   tests/functional/test_arm_collie.py | 31 +++++++++++++
>   tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
>   4 files changed, 107 insertions(+)
>   create mode 100755 tests/functional/test_arm_collie.py
>   create mode 100755 tests/functional/test_arm_sx1.py

Thanks, I'll queue the patches with this little fix squashed into the second 
patch:

diff --git a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1948,6 +1948,7 @@ S: Maintained
  F: hw/*/omap*
  F: include/hw/arm/omap.h
  F: docs/system/arm/sx1.rst
+F: tests/functional/test_arm_sx1.py

  IPack
  M: Alberto Garcia <berto@igalia.com>

  Thomas
Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Thomas Huth 1 day, 12 hours ago
On 21/10/2024 09.15, Thomas Huth wrote:
> On 17/10/2024 18.32, Peter Maydell wrote:
>> This patchset adds new functional tests for the collie and sx1
>> boards, which are the only remaining ones that survived the
>> culling of the OMAP/PXA2xx/strongarm machines.
>>
>> For these tests I'm indebted to Guenter Roeck, who has kindly
>> built and made available the kernel images, rootfs, etc and
>> documented the commands needed to boot them. All I've done
>> here is wrap those up into test cases in our testcase
>> framework by cribbing from some of our existing test code.
>>
>> Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
>> ("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
>>   -- the sd card test for the sx1 board will not pass without
>>      that bugfix
>>
>> thanks
>> -- PMM
>>
>> Peter Maydell (2):
>>    tests/functional: Add a functional test for the collie board
>>    tests/functional: Add a functional test for the sx1 board
>>
>>   MAINTAINERS                         |  1 +
>>   tests/functional/meson.build        |  3 ++
>>   tests/functional/test_arm_collie.py | 31 +++++++++++++
>>   tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
>>   4 files changed, 107 insertions(+)
>>   create mode 100755 tests/functional/test_arm_collie.py
>>   create mode 100755 tests/functional/test_arm_sx1.py
> 
> Thanks, I'll queue the patches [...]

Unfortunately, the test_arm_sx1.SX1Test.test_arm_sx1_sd test is not working 
for me, it seems to fail the shutdown of the QEMU binary:

ok 1 test_arm_sx1.SX1Test.test_arm_sx1_flash
ok 2 test_arm_sx1.SX1Test.test_arm_sx1_initrd
qemu received signal 9; command: "/home/thuth/tmp/qemu-build/qemu-system-arm 
-display none -vga none -chardev socket,id=mon,fd=5 -mon 
chardev=mon,mode=control -machine sx1 -chardev socket,id=console,fd=10 
-serial chardev:console -append kunit.enable=0 root=/dev/mmcblk0 rootwait 
console=ttyS0,115200 earlycon=uart8250,mmio32,0xfffb0000,115200n8 -no-reboot 
-snapshot -drive 
format=raw,if=sd,file=/home/thuth/.cache/qemu/download/c1db7f43ef92469ebc8605013728c8950e7608439f01d13678994f0ce101c3a8 
-kernel 
/home/thuth/.cache/qemu/download/a0271899a8dc2165f9e0adb2d0a57fc839ae3a469722ffc56c77e108a8887615"
Traceback (most recent call last):
   File "/home/thuth/devel/qemu/python/qemu/machine/machine.py", line 611, 
in _do_shutdown
     self._soft_shutdown(timeout)
   File "/home/thuth/devel/qemu/python/qemu/machine/machine.py", line 596, 
in _soft_shutdown
     self._subp.wait(timeout=timeout)
   File "/usr/lib64/python3.12/subprocess.py", line 1264, in wait
     return self._wait(timeout=timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib64/python3.12/subprocess.py", line 2045, in _wait
     raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command 
'('/home/thuth/tmp/qemu-build/qemu-system-arm', '-display', 'none', '-vga', 
'none', '-chardev', 'socket,id=mon,fd=5', '-mon', 
'chardev=mon,mode=control', '-machine', 'sx1', '-chardev', 
'socket,id=console,fd=10', '-serial', 'chardev:console', '-append', 
'kunit.enable=0 root=/dev/mmcblk0 rootwait console=ttyS0,115200 
earlycon=uart8250,mmio32,0xfffb0000,115200n8', '-no-reboot', '-snapshot', 
'-drive', 
'format=raw,if=sd,file=/home/thuth/.cache/qemu/download/c1db7f43ef92469ebc8605013728c8950e7608439f01d13678994f0ce101c3a8', 
'-kernel', 
'/home/thuth/.cache/qemu/download/a0271899a8dc2165f9e0adb2d0a57fc839ae3a469722ffc56c77e108a8887615')' 
timed out after 30 seconds

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
   File "/home/thuth/devel/qemu/tests/functional/test_arm_sx1.py", line 58, 
in test_arm_sx1_sd
     self.vm.wait()
   File "/home/thuth/devel/qemu/python/qemu/machine/machine.py", line 666, 
in wait
     self.shutdown(timeout=timeout)
   File "/home/thuth/devel/qemu/python/qemu/machine/machine.py", line 648, 
in shutdown
     self._do_shutdown(timeout)
   File "/home/thuth/devel/qemu/python/qemu/machine/machine.py", line 618, 
in _do_shutdown
     raise AbnormalShutdown("Could not perform graceful shutdown") \
qemu.machine.machine.AbnormalShutdown: Could not perform graceful shutdown

not ok 3 test_arm_sx1.SX1Test.test_arm_sx1_sd

Could you please have a look?

  Thomas


Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Peter Maydell 1 day, 11 hours ago
On Mon, 21 Oct 2024 at 09:01, Thomas Huth <thuth@redhat.com> wrote:
>
> On 21/10/2024 09.15, Thomas Huth wrote:
> > On 17/10/2024 18.32, Peter Maydell wrote:
> >> This patchset adds new functional tests for the collie and sx1
> >> boards, which are the only remaining ones that survived the
> >> culling of the OMAP/PXA2xx/strongarm machines.
> >>
> >> For these tests I'm indebted to Guenter Roeck, who has kindly
> >> built and made available the kernel images, rootfs, etc and
> >> documented the commands needed to boot them. All I've done
> >> here is wrap those up into test cases in our testcase
> >> framework by cribbing from some of our existing test code.
> >>
> >> Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
> >> ("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
> >>   -- the sd card test for the sx1 board will not pass without
> >>      that bugfix
> >>
> >> thanks
> >> -- PMM
> >>
> >> Peter Maydell (2):
> >>    tests/functional: Add a functional test for the collie board
> >>    tests/functional: Add a functional test for the sx1 board
> >>
> >>   MAINTAINERS                         |  1 +
> >>   tests/functional/meson.build        |  3 ++
> >>   tests/functional/test_arm_collie.py | 31 +++++++++++++
> >>   tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
> >>   4 files changed, 107 insertions(+)
> >>   create mode 100755 tests/functional/test_arm_collie.py
> >>   create mode 100755 tests/functional/test_arm_sx1.py
> >
> > Thanks, I'll queue the patches [...]
>
> Unfortunately, the test_arm_sx1.SX1Test.test_arm_sx1_sd test is not working
> for me, it seems to fail the shutdown of the QEMU binary:

The interesting information will be in the guest console
log, which seems to not be in this log. But the first
question is "did you include the omap_mmc fix that the
cover letter and patch description says is a prerequisite"? :-)

thanks
-- PMM
Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Guenter Roeck 1 day, 6 hours ago
On 10/21/24 02:17, Peter Maydell wrote:
> On Mon, 21 Oct 2024 at 09:01, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 21/10/2024 09.15, Thomas Huth wrote:
>>> On 17/10/2024 18.32, Peter Maydell wrote:
>>>> This patchset adds new functional tests for the collie and sx1
>>>> boards, which are the only remaining ones that survived the
>>>> culling of the OMAP/PXA2xx/strongarm machines.
>>>>
>>>> For these tests I'm indebted to Guenter Roeck, who has kindly
>>>> built and made available the kernel images, rootfs, etc and
>>>> documented the commands needed to boot them. All I've done
>>>> here is wrap those up into test cases in our testcase
>>>> framework by cribbing from some of our existing test code.
>>>>
>>>> Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
>>>> ("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
>>>>    -- the sd card test for the sx1 board will not pass without
>>>>       that bugfix
>>>>
>>>> thanks
>>>> -- PMM
>>>>
>>>> Peter Maydell (2):
>>>>     tests/functional: Add a functional test for the collie board
>>>>     tests/functional: Add a functional test for the sx1 board
>>>>
>>>>    MAINTAINERS                         |  1 +
>>>>    tests/functional/meson.build        |  3 ++
>>>>    tests/functional/test_arm_collie.py | 31 +++++++++++++
>>>>    tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
>>>>    4 files changed, 107 insertions(+)
>>>>    create mode 100755 tests/functional/test_arm_collie.py
>>>>    create mode 100755 tests/functional/test_arm_sx1.py
>>>
>>> Thanks, I'll queue the patches [...]
>>
>> Unfortunately, the test_arm_sx1.SX1Test.test_arm_sx1_sd test is not working
>> for me, it seems to fail the shutdown of the QEMU binary:
> 
> The interesting information will be in the guest console
> log, which seems to not be in this log. But the first
> question is "did you include the omap_mmc fix that the
> cover letter and patch description says is a prerequisite"? :-)
> 

Unrelated to this, but I found that the sd emulation in 9.1 is also broken
for loongarch and sifive_u, and partially for ast2600-evb (it has two
controllers, with one of them no longer working). That is too much for me
to track down quickly, so this is just a heads-up.

Guenter
Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Philippe Mathieu-Daudé 16 hours ago
Hi Guenter,

On 21/10/24 11:02, Guenter Roeck wrote:

> Unrelated to this, but I found that the sd emulation in 9.1 is also broken
> for loongarch and sifive_u, and partially for ast2600-evb (it has two
> controllers, with one of them no longer working). That is too much for me
> to track down quickly, so this is just a heads-up.

Please Cc me with reproducer or assign Gitlab issues to me,
I'll have a look.

Regards,

Phil.
Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Guenter Roeck 5 hours ago
On 10/21/24 21:09, Philippe Mathieu-Daudé wrote:
> Hi Guenter,
> 
> On 21/10/24 11:02, Guenter Roeck wrote:
> 
>> Unrelated to this, but I found that the sd emulation in 9.1 is also broken
>> for loongarch and sifive_u, and partially for ast2600-evb (it has two
>> controllers, with one of them no longer working). That is too much for me
>> to track down quickly, so this is just a heads-up.
> 
> Please Cc me with reproducer or assign Gitlab issues to me,
> I'll have a look.
> 

If it wasn't funny, it would be sad.

hw/sd/sd.c:sd_reset() calls sd_bootpart_offset() t determine the boot partition
offset. That function needs to have sd->ext_csd[EXT_CSD_PART_CONFIG] configured.
However, the value is only set later in sd_reset() with the call to sc->set_csd().
One of the parameters of that function is the previously calculated size.

So in other words there is a circular dependency. The call to sd_bootpart_offset()
returns 0 because sd->ext_csd[EXT_CSD_PART_CONFIG] isn't set, then
the call to sc->set_csd() sets it ... too late. Subsequent calls to
sd_bootpart_offset() will then return the expected offset.

I have no idea how this is supposed to work, and I don't think it works
as implemented. I'll revert commit e32ac563b83 in my local copy of qemu.

Guenter


Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Guenter Roeck 15 hours ago
On 10/21/24 21:09, Philippe Mathieu-Daudé wrote:
> Hi Guenter,
> 
> On 21/10/24 11:02, Guenter Roeck wrote:
> 
>> Unrelated to this, but I found that the sd emulation in 9.1 is also broken
>> for loongarch and sifive_u, and partially for ast2600-evb (it has two
>> controllers, with one of them no longer working). That is too much for me
>> to track down quickly, so this is just a heads-up.
> 
> Please Cc me with reproducer or assign Gitlab issues to me,
> I'll have a look.
> 

The problem is caused by commit e32ac563b8 ("hw/sd/sdcard: Fix handling of disabled
boot partitions"). Reverting it fixes the problem.

The problem only affects the sd card with index 2, or in other words it is only seen
with "-drive file=<rootfs>,format=raw,if=sd,index=2".

The Linux boot log says

[   11.201043] List of all partitions:
[   11.201364] b300           14336 mmcblk0
[   11.201414]  driver: mmcblk
[   11.201649] b308            1024 mmcblk0boot0
[   11.201678]  (driver?)
[   11.202100] b310            1024 mmcblk0boot1
[   11.202129]  (driver?)

and I am trying to boot from b300 (i.e., I have "root=b300" in the Linux command line).

This happens with both ast2600-evb and fuji-bmc machines.

Given that the patch is supposed to fix a problem, I am not sure what I would have
to change to get it back to working. All I can say is that it used to work but doesn't
anymore.

Guenter


Re: [PATCH 0/2] arm: Add collie and sx functional tests
Posted by Thomas Huth 1 day, 11 hours ago
On 21/10/2024 11.17, Peter Maydell wrote:
> On Mon, 21 Oct 2024 at 09:01, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 21/10/2024 09.15, Thomas Huth wrote:
>>> On 17/10/2024 18.32, Peter Maydell wrote:
>>>> This patchset adds new functional tests for the collie and sx1
>>>> boards, which are the only remaining ones that survived the
>>>> culling of the OMAP/PXA2xx/strongarm machines.
>>>>
>>>> For these tests I'm indebted to Guenter Roeck, who has kindly
>>>> built and made available the kernel images, rootfs, etc and
>>>> documented the commands needed to boot them. All I've done
>>>> here is wrap those up into test cases in our testcase
>>>> framework by cribbing from some of our existing test code.
>>>>
>>>> Based-on: 20241017162755.710698-1-peter.maydell@linaro.org
>>>> ("hw/sd/omap_mmc: Don't use sd_cmd_type_t")
>>>>    -- the sd card test for the sx1 board will not pass without
>>>>       that bugfix
>>>>
>>>> thanks
>>>> -- PMM
>>>>
>>>> Peter Maydell (2):
>>>>     tests/functional: Add a functional test for the collie board
>>>>     tests/functional: Add a functional test for the sx1 board
>>>>
>>>>    MAINTAINERS                         |  1 +
>>>>    tests/functional/meson.build        |  3 ++
>>>>    tests/functional/test_arm_collie.py | 31 +++++++++++++
>>>>    tests/functional/test_arm_sx1.py    | 72 +++++++++++++++++++++++++++++
>>>>    4 files changed, 107 insertions(+)
>>>>    create mode 100755 tests/functional/test_arm_collie.py
>>>>    create mode 100755 tests/functional/test_arm_sx1.py
>>>
>>> Thanks, I'll queue the patches [...]
>>
>> Unfortunately, the test_arm_sx1.SX1Test.test_arm_sx1_sd test is not working
>> for me, it seems to fail the shutdown of the QEMU binary:
> 
> The interesting information will be in the guest console
> log, which seems to not be in this log. But the first
> question is "did you include the omap_mmc fix that the
> cover letter and patch description says is a prerequisite"? :-)

Of course I did not. It's Monday morning, apparently I'm still too tired to 
read properly ;-) - sorry for that!

/me goes to the kitchen to grab another coffee

Ok, I'll just ignore the patches for my upcoming "test/functional" pull 
request, maybe best if you simply merge them via your arm tree instead.

  Thomas