Skip to contentSkip to conversation

pc-bios/s390x: Initialize machine loadparm before probing IPL devices

PATCH In review [email protected] 2 participants 2 messages Nov 14, 2024 – Nov 15, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc-bios/s390x: Initialize machine loadparm before probing IPL devices

From: Jared Rossi <[email protected]>

Commit bb185de423 ("s390x: Add individual loadparm assignment to CCW device") allowed boot devices to be assigned a loadparm value independent of the machine value, however, when no boot devices are defined, the machine loadparm becomes ignored. Therefore, let's check the machine loadparm prior to probing the devices.

---
 pc-bios/s390-ccw/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
pc-bios/s390-ccw/main.c +2 -1
index a4d1c05aac..a6cc6d7906 100644
@@ -191,7 +191,7 @@ static void boot_setup(void)
 {
     char lpmsg[] = "LOADPARM=[________]\n";
 
-    if (memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) {
+    if (have_iplb && memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) {
         ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN);
     } else {
         sclp_get_loadparm_ascii(loadparm_str);
@@ -315,6 +315,7 @@ void main(void)
     css_setup();
     have_iplb = store_iplb(&iplb);
     if (!have_iplb) {
+        boot_setup();
         probe_boot_device();
     }
 
Signature · 1 line
2.45.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · On 14/11/2024 17.19, [email protected] wrote:

From: Jared Rossi <[email protected]>

Commit bb185de423 ("s390x: Add individual loadparm assignment to CCW device") allowed boot devices to be assigned a loadparm value independent of the machine value, however, when no boot devices are defined, the machine loadparm becomes ignored. Therefore, let's check the machine loadparm prior to probing the devices.

---
  pc-bios/s390-ccw/main.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
pc-bios/s390-ccw/main.c +1 -1
index a4d1c05aac..a6cc6d7906 100644
@@ -191,7 +191,7 @@ static void boot_setup(void)
  {
      char lpmsg[] = "LOADPARM=[________]\n";
 
-    if (memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) {
+    if (have_iplb && memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) {
          ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN);
      } else {
          sclp_get_loadparm_ascii(loadparm_str);

pc-bios/s390-ccw/main.c void main(void) · line 321

Quoted 7 lines
pc-bios/s390-ccw/main.c +1 -0
@@ -315,6 +315,7 @@ void main(void)
      css_setup();
      have_iplb = store_iplb(&iplb);
      if (!have_iplb) {
+        boot_setup();
          probe_boot_device();
      }