[PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device

jrossi@linux.ibm.com posted 15 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260309003601.242634-1-jrossi@linux.ibm.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Jared Rossi <jrossi@linux.ibm.com>, Zhuoying Cai <zycai@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Farhan Ali <alifm@linux.ibm.com>, John Snow <jsnow@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
MAINTAINERS                               |   1 +
hw/pci/pci.c                              |  38 ++
hw/s390x/ipl.c                            |  63 +++-
hw/s390x/ipl.h                            |   8 +-
hw/s390x/s390-pci-bus.c                   |   3 +-
hw/s390x/s390-pci-vfio.c                  |   2 +-
hw/virtio/virtio-blk-pci.c                |   1 +
include/hw/pci/pci.h                      |   1 +
include/hw/pci/pci_device.h               |   3 +
include/hw/s390x/ipl/qipl.h               |  20 +
include/hw/s390x/{ => ipl}/s390-pci-clp.h |   0
include/hw/s390x/s390-pci-bus.h           |   4 +-
pc-bios/s390-ccw/Makefile                 |   3 +-
pc-bios/s390-ccw/bootmap.c                |   2 +-
pc-bios/s390-ccw/clp.c                    |  99 +++++
pc-bios/s390-ccw/clp.h                    |  24 ++
pc-bios/s390-ccw/iplb.h                   |   4 -
pc-bios/s390-ccw/main.c                   |  88 ++++-
pc-bios/s390-ccw/netmain.c                |   2 +-
pc-bios/s390-ccw/pci.c                    | 118 ++++++
pc-bios/s390-ccw/pci.h                    |  42 +++
pc-bios/s390-ccw/s390-ccw.h               |   7 -
pc-bios/s390-ccw/virtio-blkdev.c          |  76 ++--
pc-bios/s390-ccw/virtio-ccw.c             | 241 ++++++++++++
pc-bios/s390-ccw/virtio-ccw.h             |  24 ++
pc-bios/s390-ccw/virtio-net.c             |   5 +-
pc-bios/s390-ccw/virtio-pci.c             | 432 ++++++++++++++++++++++
pc-bios/s390-ccw/virtio-pci.h             |  82 ++++
pc-bios/s390-ccw/virtio-scsi.c            |   8 +-
pc-bios/s390-ccw/virtio-scsi.h            |   2 +-
pc-bios/s390-ccw/virtio.c                 | 293 +++++----------
pc-bios/s390-ccw/virtio.h                 |  19 +-
tests/qtest/cdrom-test.c                  |   7 +
33 files changed, 1449 insertions(+), 273 deletions(-)
rename include/hw/s390x/{ => ipl}/s390-pci-clp.h (100%)
create mode 100644 pc-bios/s390-ccw/clp.c
create mode 100644 pc-bios/s390-ccw/clp.h
create mode 100644 pc-bios/s390-ccw/pci.c
create mode 100644 pc-bios/s390-ccw/pci.h
create mode 100644 pc-bios/s390-ccw/virtio-ccw.c
create mode 100644 pc-bios/s390-ccw/virtio-ccw.h
create mode 100644 pc-bios/s390-ccw/virtio-pci.c
create mode 100644 pc-bios/s390-ccw/virtio-pci.h
[PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by jrossi@linux.ibm.com 1 month ago
From: Jared Rossi <jrossi@linux.ibm.com>

This patch series introduces an IPLB subtype to support PCI devices, which may
be built if a device has been assigned a boot index and is identified as a PCI
device with a corresponding s390 PCI Bus device.

Boot support is only added for virtio-blk-pci at this time and is limited to
devices with an assigned bootindex.

A "loadparm" property is added to virtio-blk-pci boot devices on s390x.

A simple test to check basic functionality is added to the cdrom-tests in qtest.

Changes v4 -> v5:
    - Fix incorrect switch/case for virtio block device ID
    - Use target_s390x() instead of qemu_arch_available(QEMU_ARCH_S390X)
    - Properly denote switch fallthrough
    - Remove reduntant RC checks in PCI read/write

Jared Rossi (15):
  pc-bios/s390-ccw: Fix misattributed function prototypes
  pc-bios/s390-ccw: Remove redundant vring schid attribute
  pc-bios/s390-ccw: Always reset virtio device on failed boot attempt
  s390x: Remove duplicate definitions of IPL types
  pc-bios/s390-ccw: Store device type independent of sense data
  pc-bios/s390-ccw: Split virtio-ccw and generic virtio
  include/hw/s390x: Move CLP definitions for easier BIOS access
  pc-bios/s390-ccw: Introduce CLP Architecture
  s390x: Add definitions for PCI IPL type
  pc-bios/s390-ccw: Introduce PCI device
  pc-bios/s390-ccw: Introduce virtio-pci functions
  pc-bios/s390-ccw: Add support for virtio-blk-pci IPL
  s390x: Build IPLB for virtio-pci devices
  hw: Add "loadparm" property to virtio block PCI devices booting on
    s390x
  tests/qtest: Add s390x PCI boot test to cdrom-test.c

 MAINTAINERS                               |   1 +
 hw/pci/pci.c                              |  38 ++
 hw/s390x/ipl.c                            |  63 +++-
 hw/s390x/ipl.h                            |   8 +-
 hw/s390x/s390-pci-bus.c                   |   3 +-
 hw/s390x/s390-pci-vfio.c                  |   2 +-
 hw/virtio/virtio-blk-pci.c                |   1 +
 include/hw/pci/pci.h                      |   1 +
 include/hw/pci/pci_device.h               |   3 +
 include/hw/s390x/ipl/qipl.h               |  20 +
 include/hw/s390x/{ => ipl}/s390-pci-clp.h |   0
 include/hw/s390x/s390-pci-bus.h           |   4 +-
 pc-bios/s390-ccw/Makefile                 |   3 +-
 pc-bios/s390-ccw/bootmap.c                |   2 +-
 pc-bios/s390-ccw/clp.c                    |  99 +++++
 pc-bios/s390-ccw/clp.h                    |  24 ++
 pc-bios/s390-ccw/iplb.h                   |   4 -
 pc-bios/s390-ccw/main.c                   |  88 ++++-
 pc-bios/s390-ccw/netmain.c                |   2 +-
 pc-bios/s390-ccw/pci.c                    | 118 ++++++
 pc-bios/s390-ccw/pci.h                    |  42 +++
 pc-bios/s390-ccw/s390-ccw.h               |   7 -
 pc-bios/s390-ccw/virtio-blkdev.c          |  76 ++--
 pc-bios/s390-ccw/virtio-ccw.c             | 241 ++++++++++++
 pc-bios/s390-ccw/virtio-ccw.h             |  24 ++
 pc-bios/s390-ccw/virtio-net.c             |   5 +-
 pc-bios/s390-ccw/virtio-pci.c             | 432 ++++++++++++++++++++++
 pc-bios/s390-ccw/virtio-pci.h             |  82 ++++
 pc-bios/s390-ccw/virtio-scsi.c            |   8 +-
 pc-bios/s390-ccw/virtio-scsi.h            |   2 +-
 pc-bios/s390-ccw/virtio.c                 | 293 +++++----------
 pc-bios/s390-ccw/virtio.h                 |  19 +-
 tests/qtest/cdrom-test.c                  |   7 +
 33 files changed, 1449 insertions(+), 273 deletions(-)
 rename include/hw/s390x/{ => ipl}/s390-pci-clp.h (100%)
 create mode 100644 pc-bios/s390-ccw/clp.c
 create mode 100644 pc-bios/s390-ccw/clp.h
 create mode 100644 pc-bios/s390-ccw/pci.c
 create mode 100644 pc-bios/s390-ccw/pci.h
 create mode 100644 pc-bios/s390-ccw/virtio-ccw.c
 create mode 100644 pc-bios/s390-ccw/virtio-ccw.h
 create mode 100644 pc-bios/s390-ccw/virtio-pci.c
 create mode 100644 pc-bios/s390-ccw/virtio-pci.h

-- 
2.52.0
Re: [PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by Thomas Huth 2 weeks, 5 days ago
On 09/03/2026 01.35, jrossi@linux.ibm.com wrote:
> From: Jared Rossi <jrossi@linux.ibm.com>
> 
> This patch series introduces an IPLB subtype to support PCI devices, which may
> be built if a device has been assigned a boot index and is identified as a PCI
> device with a corresponding s390 PCI Bus device.

  Hi Jared,

FYI, today I noticed that in some rare cases (maybe 1 out of 50 boots), the 
loading of the Linux kernel from a PCI device still fails. I filed a ticket 
with a reproducer here:

  https://gitlab.com/qemu-project/qemu/-/work_items/3350

Maybe there is another virtio_reset() missing somewhere?

  Thomas
Re: [PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by Jared Rossi 2 weeks, 4 days ago

On 3/23/26 12:55 PM, Thomas Huth wrote:
> On 09/03/2026 01.35, jrossi@linux.ibm.com wrote:
>> From: Jared Rossi <jrossi@linux.ibm.com>
>>
>> This patch series introduces an IPLB subtype to support PCI devices, 
>> which may
>> be built if a device has been assigned a boot index and is identified 
>> as a PCI
>> device with a corresponding s390 PCI Bus device.
>
>  Hi Jared,
>
> FYI, today I noticed that in some rare cases (maybe 1 out of 50 
> boots), the loading of the Linux kernel from a PCI device still fails. 
> I filed a ticket with a reproducer here:
>
>  https://gitlab.com/qemu-project/qemu/-/work_items/3350
>
> Maybe there is another virtio_reset() missing somewhere?
>
>  Thomas
>

Hi Thomas,

Thanks for identifying this.  I will investigate.

Regards,
Jared Rossi

Re: [PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by Matthew Rosato 1 month ago
On 3/8/26 8:35 PM, jrossi@linux.ibm.com wrote:
> From: Jared Rossi <jrossi@linux.ibm.com>
> 
> This patch series introduces an IPLB subtype to support PCI devices, which may
> be built if a device has been assigned a boot index and is identified as a PCI
> device with a corresponding s390 PCI Bus device.
> 
> Boot support is only added for virtio-blk-pci at this time and is limited to
> devices with an assigned bootindex.
> 
> A "loadparm" property is added to virtio-blk-pci boot devices on s390x.
> 
> A simple test to check basic functionality is added to the cdrom-tests in qtest.
> 
> Changes v4 -> v5:
>     - Fix incorrect switch/case for virtio block device ID
>     - Use target_s390x() instead of qemu_arch_available(QEMU_ARCH_S390X)
>     - Properly denote switch fallthrough
>     - Remove reduntant RC checks in PCI read/write
> 

Rather than reply to individual patches, I noticed new copyright lines with 2025 dates on the following patches that should be updated to 2026:

6: pc-bios/s390-ccw: Split virtio-ccw and generic virtio
8: pc-bios/s390-ccw: Introduce CLP Architecture
10: pc-bios/s390-ccw: Introduce PCI device
11: pc-bios/s390-ccw: Introduce virtio-pci functions

Thomas, if there are no further comments would you still like Jared to respin for that kind of change or would you just fix up when you pick up the series?

Thanks,
Matt
Re: [PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by Thomas Huth 1 month ago
On 09/03/2026 15.00, Matthew Rosato wrote:
> On 3/8/26 8:35 PM, jrossi@linux.ibm.com wrote:
>> From: Jared Rossi <jrossi@linux.ibm.com>
>>
>> This patch series introduces an IPLB subtype to support PCI devices, which may
>> be built if a device has been assigned a boot index and is identified as a PCI
>> device with a corresponding s390 PCI Bus device.
>>
>> Boot support is only added for virtio-blk-pci at this time and is limited to
>> devices with an assigned bootindex.
>>
>> A "loadparm" property is added to virtio-blk-pci boot devices on s390x.
>>
>> A simple test to check basic functionality is added to the cdrom-tests in qtest.
>>
>> Changes v4 -> v5:
>>      - Fix incorrect switch/case for virtio block device ID
>>      - Use target_s390x() instead of qemu_arch_available(QEMU_ARCH_S390X)
>>      - Properly denote switch fallthrough
>>      - Remove reduntant RC checks in PCI read/write
>>
> 
> Rather than reply to individual patches, I noticed new copyright lines with 2025 dates on the following patches that should be updated to 2026:
> 
> 6: pc-bios/s390-ccw: Split virtio-ccw and generic virtio
> 8: pc-bios/s390-ccw: Introduce CLP Architecture
> 10: pc-bios/s390-ccw: Introduce PCI device
> 11: pc-bios/s390-ccw: Introduce virtio-pci functions
> 
> Thomas, if there are no further comments would you still like Jared to respin for that kind of change or would you just fix up when you pick up the series?

I've seen different opinions on the year in copyright statements in the past 
(also from various people from IBM) - some say, it should be the year when 
the code was written/initially posted, some say, it should be the year when 
the code gets merged ... I personally don't mind too much anymore. For me, 
it's also ok if we keep the 2025.

Anyway, tomorrow (Tuesday) is softfreeze, so I'm going to send a pull 
request for this series tomorrow - let me know by then if you want me to fix 
up the year, or if you rather prefer to keep 2025.

  Thomas
Re: [PATCH v5 00/15] s390x: Add support for virtio-blk-pci IPL device
Posted by Matthew Rosato 1 month ago
On 3/9/26 11:40 AM, Thomas Huth wrote:
> On 09/03/2026 15.00, Matthew Rosato wrote:
>> On 3/8/26 8:35 PM, jrossi@linux.ibm.com wrote:
>>> From: Jared Rossi <jrossi@linux.ibm.com>
>>>
>>> This patch series introduces an IPLB subtype to support PCI devices, which may
>>> be built if a device has been assigned a boot index and is identified as a PCI
>>> device with a corresponding s390 PCI Bus device.
>>>
>>> Boot support is only added for virtio-blk-pci at this time and is limited to
>>> devices with an assigned bootindex.
>>>
>>> A "loadparm" property is added to virtio-blk-pci boot devices on s390x.
>>>
>>> A simple test to check basic functionality is added to the cdrom-tests in qtest.
>>>
>>> Changes v4 -> v5:
>>>      - Fix incorrect switch/case for virtio block device ID
>>>      - Use target_s390x() instead of qemu_arch_available(QEMU_ARCH_S390X)
>>>      - Properly denote switch fallthrough
>>>      - Remove reduntant RC checks in PCI read/write
>>>
>>
>> Rather than reply to individual patches, I noticed new copyright lines with 2025 dates on the following patches that should be updated to 2026:
>>
>> 6: pc-bios/s390-ccw: Split virtio-ccw and generic virtio
>> 8: pc-bios/s390-ccw: Introduce CLP Architecture
>> 10: pc-bios/s390-ccw: Introduce PCI device
>> 11: pc-bios/s390-ccw: Introduce virtio-pci functions
>>
>> Thomas, if there are no further comments would you still like Jared to respin for that kind of change or would you just fix up when you pick up the series?
> 
> I've seen different opinions on the year in copyright statements in the past (also from various people from IBM) - some say, it should be the year when the code was written/initially posted, some say, it should be the year when the code gets merged ... I personally don't mind too much anymore. For me, it's also ok if we keep the 2025.
> 
> Anyway, tomorrow (Tuesday) is softfreeze, so I'm going to send a pull request for this series tomorrow - let me know by then if you want me to fix up the year, or if you rather prefer to keep 2025.
> 

I actually wonder why we have the year at all (besides convention)...  But I do not have a strong opinion about it and was checking about a re-spin exactly because of soft freeze.

If you are OK with 2025 then that is also fine by me, leave it as-is.  

Thanks,
Matt