On 3/9/26 1:11 PM, Thomas Huth wrote:
> On 09/03/2026 17.53, Thomas Huth wrote:
>> On 09/03/2026 17.49, Thomas Huth wrote:
>>> On 09/03/2026 01.36, jrossi@linux.ibm.com wrote:
>>>> From: Jared Rossi <jrossi@linux.ibm.com>
>>>>
>>>> Add a rudimentary test for s390x IPL to verify that a guest may
>>>> boot using
>>>> virtio-blk-pci device.
>>>>
>>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>>> Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
>>>> ---
>>>> tests/qtest/cdrom-test.c | 7 +++++++
>>>> 1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
>>>> index 56e2d283a9..a65854d2bc 100644
>>>> --- a/tests/qtest/cdrom-test.c
>>>> +++ b/tests/qtest/cdrom-test.c
>>>> @@ -246,6 +246,13 @@ static void add_s390x_tests(void)
>>>> "-drive
>>>> if=none,id=d2,media=cdrom,file=",
>>>> test_cdboot);
>>>> }
>>>> + if (qtest_has_device("virtio-blk-pci")) {
>>>> + qtest_add_data_func("cdrom/boot/pci-bus-with-bootindex",
>>>> + "-device virtio-scsi -device
>>>> virtio-serial "
>>>> + "-device
>>>> virtio-blk-pci,drive=d1,bootindex=1 "
>>>> + "-drive if=none,id=d1,media=cdrom,file=",
>>>> + test_cdboot);
>>>> + }
>>>> }
>>>
>>> Hi Jared!
>>>
>>> While testing your series, it seems like the cdrom-test is now
>>> triggering a segmentation fault in QEMU here ... not sure whether I
>>> did something wrong on my side while building the bios, or whether
>>> there is a bug somewhere? Does this qtest work for you with this v5
>>> series?
>>
>> Ah, it's working on my s390x LPAR, but it's failing on my x86 laptop
>> ... maybe there is some endianness issue left somewhere?
>
> Yes, it's a missing swap of endianness data, this patch fixes it:
>
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -524,9 +524,9 @@ static bool s390_build_iplb(DeviceState *dev_st,
> IplParameterBlock *iplb)
>
> switch (devtype) {
> case PCI_DEVTYPE_VIRTIO:
> - iplb->len = S390_IPLB_MIN_PCI_LEN;
> + iplb->len = cpu_to_be32(S390_IPLB_MIN_PCI_LEN);
> iplb->pbt = S390_IPL_TYPE_PCI;
> - iplb->pci.fid = pbdev->fid;
> + iplb->pci.fid = cpu_to_be32(pbdev->fid);
> break;
> default:
> return false;
>
> If you agree, I can squash this into patch 13.
>
Hi Thomas,
Thanks for identifying the problem. Yes, please do squash it into patch 13.
Regards,
Jared Rossi