s390x: fixups for 2.11

- missing \r in the BIOS console output
 - CPU type name is now "s390x-cpu"
 - fixup for the host-model on z14 and older machine versions
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZ9uQHAAoJEBF7vIC1phx8E8AP/0aBPGS3FHrAOf/mDQchh+Do
 +wKtEx3pLRnV8UyurmkaRKgUaemhC+JvGxqgvgq/BrhOqVnVtHdRQ3MQt5ThtDbQ
 kI4GXJn5nENujg4PtjTuCs+7xLC/4QXPyiHc59HAaRwXG0jBQn8mdGZj6ATvXLWp
 ePrGRAbbLclXyKLPl4SG9DR52L2OakSTz3m7qSHHS3pHBYrDjY9U0A1luIHOfyFq
 FXNF/NZ2fRvtDhip4PFC8tnns5G61JWrhnha4+wsePaAUgVTUP8jqoyaRLPxHxti
 4SDpVDCzRO+hmAGrgOEZOGjYxQ/zbxsRhT4qVyZ/KfKiNYqrjOsI5n+X3fiPZl3m
 y64TXSK9kW3qWB/ZNTgEYmtZHrmFtcQnL8bPgIJRXySedX+K6UIX384GBSf6NVSz
 2FUl/O/cksiMumHQfVPemRjC58gy3buCMGUTokENOyd5LzwjkLcdiJn6NmH5yo5A
 zNxVaISZjJ5zd5TCp8tQ+LNvXLHk9/Aah9yoirBpYnyoafwZaZtk6qLh/LN7isS/
 F+o58YP+SgEldynfbW9HKcjxut6COFqP9lDhALXwrWQGGjZIfSm9NMhrH/xNpoWW
 HEMpQ24QbqL7CKoMQVatuHDlPaIjxIWTdTepC0MBTmvoTwGJ8PbX0FIs7L0U344V
 Ze7HEhaR8KpQ0uKSBLVh
 =ir9v
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20171030' into staging

s390x: fixups for 2.11

- missing \r in the BIOS console output
- CPU type name is now "s390x-cpu"
- fixup for the host-model on z14 and older machine versions

# gpg: Signature made Mon 30 Oct 2017 08:34:15 GMT
# gpg:                using RSA key 0x117BBC80B5A61C7C
# gpg: Good signature from "Christian Borntraeger (IBM) <borntraeger@de.ibm.com>"
# Primary key fingerprint: F922 9381 A334 08F9 DBAB  FBCA 117B BC80 B5A6 1C7C

* remotes/borntraeger/tags/s390x-20171030:
  s390-*.img: update s390 bios with latest fixes
  s390-ccw: print carriage return with new lines
  s390x/kvm: use cpu model for gscb on compat machines
  target/s390x: change CPU type name to "s390x-cpu"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-10-30 13:02:45 +00:00
commit abf6e752e5
10 changed files with 28 additions and 21 deletions

View File

@ -432,7 +432,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
s390mc->ri_allowed = true; s390mc->ri_allowed = true;
s390mc->cpu_model_allowed = true; s390mc->cpu_model_allowed = true;
s390mc->css_migration_enabled = true; s390mc->css_migration_enabled = true;
s390mc->gs_allowed = true;
mc->init = ccw_init; mc->init = ccw_init;
mc->reset = s390_machine_reset; mc->reset = s390_machine_reset;
mc->hot_add_cpu = s390_hot_add_cpu; mc->hot_add_cpu = s390_hot_add_cpu;
@ -513,12 +512,6 @@ bool cpu_model_allowed(void)
return get_machine_class()->cpu_model_allowed; 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) static char *machine_get_loadparm(Object *obj, Error **errp)
{ {
S390CcwMachineState *ms = S390_CCW_MACHINE(obj); 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); S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
s390mc->gs_allowed = false;
ccw_machine_2_10_class_options(mc); ccw_machine_2_10_class_options(mc);
SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9); SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);
s390mc->css_migration_enabled = false; s390mc->css_migration_enabled = false;

View File

@ -40,15 +40,12 @@ typedef struct S390CcwMachineClass {
bool ri_allowed; bool ri_allowed;
bool cpu_model_allowed; bool cpu_model_allowed;
bool css_migration_enabled; bool css_migration_enabled;
bool gs_allowed;
} S390CcwMachineClass; } S390CcwMachineClass;
/* runtime-instrumentation allowed by the machine */ /* runtime-instrumentation allowed by the machine */
bool ri_allowed(void); bool ri_allowed(void);
/* cpu model allowed by the machine */ /* cpu model allowed by the machine */
bool cpu_model_allowed(void); 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 * Returns true if (vmstate based) migration of the channel subsystem

Binary file not shown.

View File

@ -76,17 +76,35 @@ static int _strlen(const char *str)
long write(int fd, const void *str, size_t len) long write(int fd, const void *str, size_t len)
{ {
WriteEventData *sccb = (void *)_sccb; WriteEventData *sccb = (void *)_sccb;
const char *p = str;
size_t data_len = 0;
size_t i;
if (fd != 1 && fd != 2) { if (fd != 1 && fd != 2) {
return -EIO; 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->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.type = SCLP_EVENT_ASCII_CONSOLE_DATA;
sccb->ebh.flags = 0; sccb->ebh.flags = 0;
memcpy(sccb->data, str, len);
sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb); sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb);

Binary file not shown.

View File

@ -3159,12 +3159,12 @@
# -> { "execute": "query-hotpluggable-cpus" } # -> { "execute": "query-hotpluggable-cpus" }
# <- {"return": [ # <- {"return": [
# { # {
# "type": "qemu-s390-cpu", "vcpus-count": 1, # "type": "qemu-s390x-cpu", "vcpus-count": 1,
# "props": { "core-id": 1 } # "props": { "core-id": 1 }
# }, # },
# { # {
# "qom-path": "/machine/unattached/device[0]", # "qom-path": "/machine/unattached/device[0]",
# "type": "qemu-s390-cpu", "vcpus-count": 1, # "type": "qemu-s390x-cpu", "vcpus-count": 1,
# "props": { "core-id": 0 } # "props": { "core-id": 0 }
# } # }
# ]} # ]}

View File

@ -22,7 +22,7 @@
#include "qom/cpu.h" #include "qom/cpu.h"
#define TYPE_S390_CPU "s390-cpu" #define TYPE_S390_CPU "s390x-cpu"
#define S390_CPU_CLASS(klass) \ #define S390_CPU_CLASS(klass) \
OBJECT_CLASS_CHECK(S390CPUClass, (klass), TYPE_S390_CPU) OBJECT_CLASS_CHECK(S390CPUClass, (klass), TYPE_S390_CPU)

View File

@ -286,7 +286,7 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
details = "(migration-safe)"; details = "(migration-safe)";
} }
/* strip off the -s390-cpu */ /* strip off the -s390x-cpu */
g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
(*s->cpu_fprintf)(s->file, "s390 %-15s %-35s %s\n", name, scc->desc, (*s->cpu_fprintf)(s->file, "s390 %-15s %-35s %s\n", name, scc->desc,
details); details);
@ -390,7 +390,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
char *name = g_strdup(object_class_get_name(klass)); char *name = g_strdup(object_class_get_name(klass));
S390CPUClass *scc = S390_CPU_CLASS(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; g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
info = g_new0(CpuDefinitionInfo, 1); info = g_new0(CpuDefinitionInfo, 1);
info->name = name; info->name = name;

View File

@ -306,7 +306,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
cap_ri = 1; cap_ri = 1;
} }
} }
if (gs_allowed()) { if (cpu_model_allowed()) {
if (kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0) == 0) { if (kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0) == 0) {
cap_gs = 1; cap_gs = 1;
} }

View File

@ -180,7 +180,7 @@ const VMStateDescription vmstate_exval = {
static bool gscb_needed(void *opaque) static bool gscb_needed(void *opaque)
{ {
return kvm_s390_get_gs(); return s390_has_feat(S390_FEAT_GUARDED_STORAGE);
} }
const VMStateDescription vmstate_gscb = { const VMStateDescription vmstate_gscb = {