pc-bios/s390-ccw: store proper subsystem information word
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 1 Jul 2014 10:17:41 +0000 (12:17 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Tue, 8 Jul 2014 13:08:03 +0000 (15:08 +0200)
POP chapter 17 requires to store a subsystem information word at 184
during IPL. Furthermore bytes 188-191 should be zero. The bootmap might
contain data blocks that are written to the first page. We have to
write these values after we processed the bootmap and before the final
IPL.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
pc-bios/s390-ccw/bootmap.c
pc-bios/s390-ccw/main.c
pc-bios/s390-ccw/s390-ccw.h

index fa54abb..f175679 100644 (file)
@@ -51,6 +51,8 @@ static void jump_to_IPL_2(void)
 
 static void jump_to_IPL_code(uint64_t address)
 {
+    /* store the subsystem information _after_ the bootmap was loaded */
+    write_subsystem_identification();
     /*
      * The IPL PSW is at address 0. We also must not overwrite the
      * content of non-BIOS memory after we loaded the guest, so we
index dbfb40e..f9ec215 100644 (file)
 
 char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
 uint64_t boot_value;
+struct subchannel_id blk_schid = { .one = 1 };
+
+/*
+ * Priniciples of Operations (SA22-7832-09) chapter 17 requires that
+ * a subsystem-identification is at 184-187 and bytes 188-191 are zero
+ * after list-directed-IPL and ccw-IPL.
+ */
+void write_subsystem_identification(void)
+{
+    struct subchannel_id *schid = (struct subchannel_id *) 184;
+    uint32_t *zeroes = (uint32_t *) 188;
+
+    *schid = blk_schid;
+    *zeroes = 0;
+}
+
 
 void virtio_panic(const char *string)
 {
@@ -23,7 +39,6 @@ void virtio_panic(const char *string)
 
 static void virtio_setup(uint64_t dev_info)
 {
-    struct subchannel_id blk_schid = { .one = 1 };
     struct schib schib;
     int i;
     int r;
index 959aed0..2b773de 100644 (file)
@@ -50,6 +50,7 @@ void disabled_wait(void);
 
 /* main.c */
 void virtio_panic(const char *string);
+void write_subsystem_identification(void);
 
 /* sclp-ascii.c */
 void sclp_print(const char *string);