All of lore.kernel.org
 help / color / mirror / Atom feed
From: jrossi@linux.ibm.com
To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com
Cc: jjherne@linux.ibm.com, farman@linux.ibm.com,
	mjrosato@linux.ibm.com, jrossi@linux.ibm.com,
	zycai@linux.ibm.com
Subject: [PATCH 1/6] s390x: Rename SCSI IPL type to indicate CCW bus
Date: Mon,  4 May 2026 18:16:08 -0400	[thread overview]
Message-ID: <20260504221613.826825-2-jrossi@linux.ibm.com> (raw)
In-Reply-To: <20260504221613.826825-1-jrossi@linux.ibm.com>

From: Jared Rossi <jrossi@linux.ibm.com>

As IPL support is being added for some PCI devices it is necessary to specify
the bus type of the SCSI controller when booting from a SCSI device.  Therefore
the IPL type S390_IPL_TYPE_QEMU_SCSI is changed to to S390_IPL_TYPE_CCW_SCSI.

Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
---
 hw/s390x/ipl.c                   | 14 +++++++-------
 hw/s390x/ipl.h                   |  2 +-
 include/hw/s390x/ipl/qipl.h      |  8 ++++----
 pc-bios/s390-ccw/jump2ipl.c      |  4 ++--
 pc-bios/s390-ccw/main.c          | 16 ++++++++--------
 pc-bios/s390-ccw/virtio-blkdev.c |  2 +-
 pc-bios/s390-ccw/virtio.c        | 12 ++++++------
 target/s390x/diag.c              |  2 +-
 8 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 1babcd2b7d..402f5dbd7e 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -315,7 +315,7 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl)
             return;
         }
         break;
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
         break;
     default:
         if (current_machine->boot_config.has_menu && current_machine->boot_config.menu) {
@@ -477,12 +477,12 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb)
             iplb->len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN);
             iplb->blk0_len =
                 cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN);
-            iplb->pbt = S390_IPL_TYPE_QEMU_SCSI;
-            iplb->scsi.lun = cpu_to_be32(sd->lun);
-            iplb->scsi.target = cpu_to_be16(sd->id);
-            iplb->scsi.channel = cpu_to_be16(sd->channel);
-            iplb->scsi.devno = cpu_to_be16(ccw_dev->sch->devno);
-            iplb->scsi.ssid = ccw_dev->sch->ssid & 3;
+            iplb->pbt = S390_IPL_TYPE_CCW_SCSI;
+            iplb->ccw_scsi.lun = cpu_to_be32(sd->lun);
+            iplb->ccw_scsi.target = cpu_to_be16(sd->id);
+            iplb->ccw_scsi.channel = cpu_to_be16(sd->channel);
+            iplb->ccw_scsi.devno = cpu_to_be16(ccw_dev->sch->devno);
+            iplb->ccw_scsi.ssid = ccw_dev->sch->ssid & 3;
             break;
         case CCW_DEVTYPE_VFIO:
             iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
index fac30763df..5d4c618ecf 100644
--- a/hw/s390x/ipl.h
+++ b/hw/s390x/ipl.h
@@ -182,7 +182,7 @@ static inline bool iplb_valid(IplParameterBlock *iplb)
         return len >= S390_IPLB_MIN_CCW_LEN;
     case S390_IPL_TYPE_PCI:
         return len >= S390_IPLB_MIN_PCI_LEN;
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     default:
         return false;
     }
diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h
index 8d3c83a80b..67db54c964 100644
--- a/include/hw/s390x/ipl/qipl.h
+++ b/include/hw/s390x/ipl/qipl.h
@@ -25,7 +25,7 @@ enum S390IplType {
     S390_IPL_TYPE_CCW = 0x02,
     S390_IPL_TYPE_PCI = 0x04,
     S390_IPL_TYPE_PV = 0x05,
-    S390_IPL_TYPE_QEMU_SCSI = 0xff
+    S390_IPL_TYPE_CCW_SCSI = 0xff
 };
 typedef enum S390IplType S390IplType;
 
@@ -99,7 +99,7 @@ struct IplBlockFcp {
 } QEMU_PACKED;
 typedef struct IplBlockFcp IplBlockFcp;
 
-struct IplBlockQemuScsi {
+struct IplBlockCcwScsi {
     uint32_t lun;
     uint16_t target;
     uint16_t channel;
@@ -107,7 +107,7 @@ struct IplBlockQemuScsi {
     uint8_t  ssid;
     uint16_t devno;
 } QEMU_PACKED;
-typedef struct IplBlockQemuScsi IplBlockQemuScsi;
+typedef struct IplBlockCcwScsi IplBlockCcwScsi;
 
 struct IplBlockPci {
     uint32_t reserved0[76];
@@ -131,7 +131,7 @@ union IplParameterBlock {
             IplBlockCcw ccw;
             IplBlockFcp fcp;
             IPLBlockPV pv;
-            IplBlockQemuScsi scsi;
+            IplBlockCcwScsi ccw_scsi;
             IplBlockPci pci;
         };
     } QEMU_PACKED;
diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c
index 86321d0f46..f8f6b21327 100644
--- a/pc-bios/s390-ccw/jump2ipl.c
+++ b/pc-bios/s390-ccw/jump2ipl.c
@@ -40,10 +40,10 @@ int jump_to_IPL_code(uint64_t address)
     write_iplb_location();
 
     /*
-     * The IPLB for QEMU SCSI type devices must be rebuilt during re-ipl. The
+     * The IPLB for SCSI type devices must be rebuilt during re-ipl. The
      * iplb.devno is set to the boot position of the target SCSI device.
      */
-    if (iplb.pbt == S390_IPL_TYPE_QEMU_SCSI) {
+    if (iplb.pbt == S390_IPL_TYPE_CCW_SCSI) {
         iplb.devno = qipl.index;
     }
 
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 26287cfd81..1a9579beab 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -183,7 +183,7 @@ static void menu_setup(VDev *vdev)
 
     switch (vdev->ipl_type) {
     case S390_IPL_TYPE_CCW:
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
         menu_set_parms(qipl.qipl_flags & BOOT_MENU_FLAG_MASK,
                        qipl.boot_menu_timeout);
         /* fall through */
@@ -249,13 +249,13 @@ static bool find_boot_device(void)
         debug_print_int("ssid ", blk_schid.ssid);
         found = find_subch(iplb.ccw.devno);
         break;
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
         vdev->scsi_device_selected = true;
-        vdev->selected_scsi_device.channel = iplb.scsi.channel;
-        vdev->selected_scsi_device.target = iplb.scsi.target;
-        vdev->selected_scsi_device.lun = iplb.scsi.lun;
-        blk_schid.ssid = iplb.scsi.ssid & 0x3;
-        found = find_subch(iplb.scsi.devno);
+        vdev->selected_scsi_device.channel = iplb.ccw_scsi.channel;
+        vdev->selected_scsi_device.target = iplb.ccw_scsi.target;
+        vdev->selected_scsi_device.lun = iplb.ccw_scsi.lun;
+        blk_schid.ssid = iplb.ccw_scsi.ssid & 0x3;
+        found = find_subch(iplb.ccw_scsi.devno);
         break;
      case S390_IPL_TYPE_PCI:
         found = find_fid(iplb.pci.fid);
@@ -339,7 +339,7 @@ static void ipl_pci_device(void)
 static void ipl_boot_device(void)
 {
     switch (virtio_get_device()->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         ipl_ccw_device();
         break;
diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c
index 98b6cec3a0..40631e0c0f 100644
--- a/pc-bios/s390-ccw/virtio-blkdev.c
+++ b/pc-bios/s390-ccw/virtio-blkdev.c
@@ -253,7 +253,7 @@ int virtio_blk_setup_device(VDev *vdev)
     puts("Using virtio-blk.");
 
     switch (vdev->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return virtio_ccw_setup(vdev);
     case S390_IPL_TYPE_PCI:
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 390b55c7b9..30e6b2bc16 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -61,7 +61,7 @@ char *virtio_get_ring_area(int ring_num)
 int drain_irqs(void)
 {
     switch (vdev.ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return drain_irqs_ccw(vdev.schid);
     default:
@@ -72,7 +72,7 @@ int drain_irqs(void)
 int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd)
 {
     switch (vdev->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return virtio_ccw_run(vdev, vqid, cmd);
     default:
@@ -109,7 +109,7 @@ void vring_init(VRing *vr, VqInfo *info)
 bool vring_notify(VRing *vr)
 {
     switch (vdev.ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         vr->cookie = virtio_ccw_notify(vdev.schid, vr->id, vr->cookie);
         break;
@@ -129,7 +129,7 @@ bool vring_notify(VRing *vr)
 bool be_ipl(void)
 {
     switch (virtio_get_device()->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return true;
     case S390_IPL_TYPE_PCI:
@@ -230,7 +230,7 @@ int vring_wait_reply(void)
 int virtio_reset(VDev *vdev)
 {
     switch (vdev->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return virtio_ccw_reset(vdev);
     case S390_IPL_TYPE_PCI:
@@ -243,7 +243,7 @@ int virtio_reset(VDev *vdev)
 bool virtio_is_supported(VDev *vdev)
 {
     switch (vdev->ipl_type) {
-    case S390_IPL_TYPE_QEMU_SCSI:
+    case S390_IPL_TYPE_CCW_SCSI:
     case S390_IPL_TYPE_CCW:
         return virtio_ccw_is_supported(vdev);
     default:
diff --git a/target/s390x/diag.c b/target/s390x/diag.c
index da44b0133e..06bdb2bbc8 100644
--- a/target/s390x/diag.c
+++ b/target/s390x/diag.c
@@ -133,7 +133,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
 
         valid = subcode == DIAG308_PV_SET ? iplb_valid_pv(iplb) : iplb_valid(iplb);
         if (!valid) {
-            if (subcode == DIAG308_SET && iplb->pbt == S390_IPL_TYPE_QEMU_SCSI) {
+            if (subcode == DIAG308_SET && iplb->pbt == S390_IPL_TYPE_CCW_SCSI) {
                 s390_rebuild_iplb(iplb->devno, iplb);
                 s390_ipl_update_diag308(iplb);
                 env->regs[r1 + 1] = DIAG_308_RC_OK;
-- 
2.52.0



  reply	other threads:[~2026-05-04 22:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 22:16 [PATCH 0/6] s390x: Add support for virtio-scsi-pci boot device jrossi
2026-05-04 22:16 ` jrossi [this message]
2026-05-08 16:53   ` [PATCH 1/6] s390x: Rename SCSI IPL type to indicate CCW bus Eric Farman
2026-05-04 22:16 ` [PATCH 2/5] pc-bios/s390-ccw: Add per-queue notification offset for multi-queue virtio configurations jrossi
2026-05-06 18:20   ` Zhuoying Cai
2026-05-07 13:26     ` Jared Rossi
2026-05-08 17:23   ` Eric Farman
2026-05-12 16:21     ` Jared Rossi
2026-05-04 22:16 ` [PATCH 3/6] pc-bios/s390-ccw: Rename Virtio CCW run function for generic use jrossi
2026-05-08 17:26   ` Eric Farman
2026-05-04 22:16 ` [PATCH 4/6] s390x: Introduce PCI SCSI IPLB and boot type jrossi
2026-05-09  1:16   ` Eric Farman
2026-05-12 16:13     ` Jared Rossi
2026-05-04 22:16 ` [PATCH 5/6] s390x: Enable IPL from Virtio PCI SCSI devices jrossi
2026-05-04 22:16 ` [PATCH 6/6] tests/qtest: Add s390x PCI SCSI fallback test to cdrom-test.c jrossi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260504221613.826825-2-jrossi@linux.ibm.com \
    --to=jrossi@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=zycai@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.