On 1/9/26 6:32 AM, Thomas Huth wrote:
On 07/01/2026 19.32, Jared Rossi wrote:


On 1/7/26 9:44 AM, Thomas Huth wrote:
On 10/12/2025 21.54, [email protected] wrote:
From: Jared Rossi <[email protected]>

Enable virt-queue PCI configuration and add routines for virtio-blk-pci devices.

Signed-off-by: Jared Rossi <[email protected]>
---
  include/hw/s390x/ipl/qipl.h      |  10 +
  pc-bios/s390-ccw/virtio-pci.h    |  79 +++++++
  pc-bios/s390-ccw/virtio.h        |   1 +
  pc-bios/s390-ccw/main.c          |  60 +++++-
  pc-bios/s390-ccw/virtio-blkdev.c |   3 +
  pc-bios/s390-ccw/virtio-pci.c    | 360 +++++++++++++++++++++++++++++++
  pc-bios/s390-ccw/virtio.c        |   5 +
  pc-bios/s390-ccw/Makefile        |   2 +-
  8 files changed, 517 insertions(+), 3 deletions(-)
  create mode 100644 pc-bios/s390-ccw/virtio-pci.h
  create mode 100644 pc-bios/s390-ccw/virtio-pci.c

diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h
index 8199b839f0..5c7779a1c3 100644
--- a/include/hw/s390x/ipl/qipl.h
+++ b/include/hw/s390x/ipl/qipl.h
@@ -22,6 +22,7 @@
    #define S390_IPL_TYPE_FCP 0x00
  #define S390_IPL_TYPE_CCW 0x02
+#define S390_IPL_TYPE_PCI 0x04
  #define S390_IPL_TYPE_PV 0x05
  #define S390_IPL_TYPE_QEMU_SCSI 0xff
  @@ -105,6 +106,14 @@ struct IplBlockQemuScsi {
  } QEMU_PACKED;
  typedef struct IplBlockQemuScsi IplBlockQemuScsi;
  +struct IplBlockPci {
+    uint32_t reserved0[80];
+    uint8_t  opt;
+    uint8_t  reserved1[3];
+    uint32_t fid;
+} QEMU_PACKED;
+typedef struct IplBlockPci IplBlockPci;

Is this supposed to have the same positions for "fid" and "opt" as in the ipl_pb0_nvme structure in the kernel (arch/s390/include/uapi/asm/ipl.h)?

Yes, I think.  That was my intention anyway. Are you suggesting it shouldn't?

Having the same positions sound like a good idea. But if I'm counting right, it currently does not match:

In the code above, there are 80 * 4 = 320 bytes between the end of the loadparm[] array and the "opt" field.

In the kernel, there is the reserved2 field with 304 bytes between the end of the loadparm[] array and the "opt" field.

So either I'm counting wrong, or your reserved0 field should be decreased in size?

 Thomas

Ah, now I see.  Your are correct.  I will fix it.  Thanks for catching that!

Regards,
Jared Rossi

Reply via email to