summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--hw/s390x/s390-virtio-ccw.c8
-rw-r--r--include/hw/s390x/s390-virtio-ccw.h3
-rw-r--r--pc-bios/s390-ccw.imgbin26416 -> 30520 bytes
-rw-r--r--pc-bios/s390-ccw/sclp.c24
-rwxr-xr-xpc-bios/s390-netboot.imgbin83864 -> 83864 bytes
-rw-r--r--qapi-schema.json4
-rw-r--r--target/s390x/cpu-qom.h2
-rw-r--r--target/s390x/cpu_models.c4
-rw-r--r--target/s390x/kvm.c2
-rw-r--r--target/s390x/machine.c2
10 files changed, 28 insertions, 21 deletions
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index baeafdcb1c..6a57f94197 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -432,7 +432,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
     s390mc->ri_allowed = true;
     s390mc->cpu_model_allowed = true;
     s390mc->css_migration_enabled = true;
-    s390mc->gs_allowed = true;
     mc->init = ccw_init;
     mc->reset = s390_machine_reset;
     mc->hot_add_cpu = s390_hot_add_cpu;
@@ -513,12 +512,6 @@ bool cpu_model_allowed(void)
     return get_machine_class()->cpu_model_allowed;
 }
 
-bool gs_allowed(void)
-{
-    /* for "none" machine this results in true */
-    return get_machine_class()->gs_allowed;
-}
-
 static char *machine_get_loadparm(Object *obj, Error **errp)
 {
     S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
@@ -758,7 +751,6 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)
 {
     S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
 
-    s390mc->gs_allowed = false;
     ccw_machine_2_10_class_options(mc);
     SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);
     s390mc->css_migration_enabled = false;
diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h
index a9a90c2022..ac896e31ea 100644
--- a/include/hw/s390x/s390-virtio-ccw.h
+++ b/include/hw/s390x/s390-virtio-ccw.h
@@ -40,15 +40,12 @@ typedef struct S390CcwMachineClass {
     bool ri_allowed;
     bool cpu_model_allowed;
     bool css_migration_enabled;
-    bool gs_allowed;
 } S390CcwMachineClass;
 
 /* runtime-instrumentation allowed by the machine */
 bool ri_allowed(void);
 /* cpu model allowed by the machine */
 bool cpu_model_allowed(void);
-/* guarded-storage allowed by the machine */
-bool gs_allowed(void);
 
 /**
  * Returns true if (vmstate based) migration of the channel subsystem
diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
index 0b039291a5..75b604e3ce 100644
--- a/pc-bios/s390-ccw.img
+++ b/pc-bios/s390-ccw.img
Binary files differdiff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c
index b1fc8ff44b..90d1bc3147 100644
--- a/pc-bios/s390-ccw/sclp.c
+++ b/pc-bios/s390-ccw/sclp.c
@@ -76,17 +76,35 @@ static int _strlen(const char *str)
 long write(int fd, const void *str, size_t len)
 {
     WriteEventData *sccb = (void *)_sccb;
+    const char *p = str;
+    size_t data_len = 0;
+    size_t i;
 
     if (fd != 1 && fd != 2) {
         return -EIO;
     }
 
-    sccb->h.length = sizeof(WriteEventData) + len;
+    for (i = 0; i < len; i++) {
+        if ((data_len + 1) >= SCCB_DATA_LEN) {
+            /* We would overflow the sccb buffer, abort early */
+            len = i;
+            break;
+        }
+
+        if (*p == '\n') {
+            /* Terminal emulators might need \r\n, so generate it */
+            sccb->data[data_len++] = '\r';
+        }
+
+        sccb->data[data_len++] = *p;
+        p++;
+    }
+
+    sccb->h.length = sizeof(WriteEventData) + data_len;
     sccb->h.function_code = SCLP_FC_NORMAL_WRITE;
-    sccb->ebh.length = sizeof(EventBufferHeader) + len;
+    sccb->ebh.length = sizeof(EventBufferHeader) + data_len;
     sccb->ebh.type = SCLP_EVENT_ASCII_CONSOLE_DATA;
     sccb->ebh.flags = 0;
-    memcpy(sccb->data, str, len);
 
     sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb);
 
diff --git a/pc-bios/s390-netboot.img b/pc-bios/s390-netboot.img
index 295ddfcf6a..24f40feae6 100755
--- a/pc-bios/s390-netboot.img
+++ b/pc-bios/s390-netboot.img
Binary files differdiff --git a/qapi-schema.json b/qapi-schema.json
index a9dd043f65..18457954a8 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3159,12 +3159,12 @@
 # -> { "execute": "query-hotpluggable-cpus" }
 # <- {"return": [
 #      {
-#         "type": "qemu-s390-cpu", "vcpus-count": 1,
+#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
 #         "props": { "core-id": 1 }
 #      },
 #      {
 #         "qom-path": "/machine/unattached/device[0]",
-#         "type": "qemu-s390-cpu", "vcpus-count": 1,
+#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
 #         "props": { "core-id": 0 }
 #      }
 #    ]}
diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h
index 0510c49e07..b46217dc31 100644
--- a/target/s390x/cpu-qom.h
+++ b/target/s390x/cpu-qom.h
@@ -22,7 +22,7 @@
 
 #include "qom/cpu.h"
 
-#define TYPE_S390_CPU "s390-cpu"
+#define TYPE_S390_CPU "s390x-cpu"
 
 #define S390_CPU_CLASS(klass) \
     OBJECT_CLASS_CHECK(S390CPUClass, (klass), TYPE_S390_CPU)
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 9554f19eb4..c4c37b3b15 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -286,7 +286,7 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
         details = "(migration-safe)";
     }
 
-    /* strip off the -s390-cpu */
+    /* strip off the -s390x-cpu */
     g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
     (*s->cpu_fprintf)(s->file, "s390 %-15s %-35s %s\n", name, scc->desc,
                       details);
@@ -390,7 +390,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
     char *name = g_strdup(object_class_get_name(klass));
     S390CPUClass *scc = S390_CPU_CLASS(klass);
 
-    /* strip off the -s390-cpu */
+    /* strip off the -s390x-cpu */
     g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
     info = g_new0(CpuDefinitionInfo, 1);
     info->name = name;
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 88f27d75b9..b03f583032 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -306,7 +306,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
             cap_ri = 1;
         }
     }
-    if (gs_allowed()) {
+    if (cpu_model_allowed()) {
         if (kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0) == 0) {
             cap_gs = 1;
         }
diff --git a/target/s390x/machine.c b/target/s390x/machine.c
index e1b7015d20..b78f326d3a 100644
--- a/target/s390x/machine.c
+++ b/target/s390x/machine.c
@@ -180,7 +180,7 @@ const VMStateDescription vmstate_exval = {
 
 static bool gscb_needed(void *opaque)
 {
-    return kvm_s390_get_gs();
+    return s390_has_feat(S390_FEAT_GUARDED_STORAGE);
 }
 
 const VMStateDescription vmstate_gscb = {