[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/21] s390x/css: add s390-squash-mcss machine option
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 10/21] s390x/css: add s390-squash-mcss machine option |
Date: |
Tue, 23 May 2017 13:12:55 +0200 |
From: Xiao Feng Ren <address@hidden>
We want to support real (i.e. not virtual) channel devices
even for guests that do not support MCSS-E (where guests may
see devices from any channel subsystem image at once). As all
virtio-ccw devices are in css 0xfe (and show up in the default
css 0 for guests not activating MCSS-E), we need an option to
squash both the virtio subchannels and e.g. passed-through
subchannels from their real css (0-3, or 0 for hosts not
activating MCSS-E) into the default css. This will be
exploited in a later patch.
Signed-off-by: Xiao Feng Ren <address@hidden>
Signed-off-by: Dong Jia Shi <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-virtio-ccw.c | 21 +++++++++++++++++++++
include/hw/s390x/s390-virtio-ccw.h | 1 +
qemu-options.hx | 6 +++++-
target/s390x/cpu.h | 10 ++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index fdd4384ff0..cd007ca8cf 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -303,6 +303,20 @@ static void machine_set_loadparm(Object *obj, const char
*val, Error **errp)
ms->loadparm[i] = ' '; /* pad right with spaces */
}
}
+static inline bool machine_get_squash_mcss(Object *obj, Error **errp)
+{
+ S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+
+ return ms->s390_squash_mcss;
+}
+
+static inline void machine_set_squash_mcss(Object *obj, bool value,
+ Error **errp)
+{
+ S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+
+ ms->s390_squash_mcss = value;
+}
static inline void s390_machine_initfn(Object *obj)
{
@@ -328,6 +342,13 @@ static inline void s390_machine_initfn(Object *obj)
" to upper case) to pass to machine loader, boot manager,"
" and guest kernel",
NULL);
+ object_property_add_bool(obj, "s390-squash-mcss",
+ machine_get_squash_mcss,
+ machine_set_squash_mcss, NULL);
+ object_property_set_description(obj, "s390-squash-mcss",
+ "enable/disable squashing subchannels into the default css",
+ NULL);
+ object_property_set_bool(obj, false, "s390-squash-mcss", NULL);
}
static const TypeInfo ccw_machine_info = {
diff --git a/include/hw/s390x/s390-virtio-ccw.h
b/include/hw/s390x/s390-virtio-ccw.h
index 7b8a3e4d74..3027555f6d 100644
--- a/include/hw/s390x/s390-virtio-ccw.h
+++ b/include/hw/s390x/s390-virtio-ccw.h
@@ -29,6 +29,7 @@ typedef struct S390CcwMachineState {
bool aes_key_wrap;
bool dea_key_wrap;
uint8_t loadparm[8];
+ bool s390_squash_mcss;
} S390CcwMachineState;
typedef struct S390CcwMachineClass {
diff --git a/qemu-options.hx b/qemu-options.hx
index f07a310eb1..1e5382c1e1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -42,7 +42,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" dea-key-wrap=on|off controls support for DEA key wrapping
(default=on)\n"
" suppress-vmdesc=on|off disables self-describing migration
(default=off)\n"
" nvdimm=on|off controls NVDIMM support (default=off)\n"
- " enforce-config-section=on|off enforce configuration
section migration (default=off)\n",
+ " enforce-config-section=on|off enforce configuration
section migration (default=off)\n"
+ " s390-squash-mcss=on|off controls support for squashing
into default css (default=off)\n",
QEMU_ARCH_ALL)
STEXI
@item -machine address@hidden,address@hidden,...]]
@@ -81,6 +82,9 @@ controls whether DEA wrapping keys will be created to allow
execution of DEA cryptographic functions. The default is on.
@item nvdimm=on|off
Enables or disables NVDIMM support. The default is off.
address@hidden s390-squash-mcss=on|off
+Enables or disables squashing subchannels into the default css.
+The default is off.
@end table
ETEXI
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 240b8a5c22..e27d9d874a 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -1256,6 +1256,16 @@ static inline void s390_crypto_reset(void)
}
}
+static inline bool s390_get_squash_mcss(void)
+{
+ if (object_property_get_bool(OBJECT(qdev_get_machine()),
"s390-squash-mcss",
+ NULL)) {
+ return true;
+ }
+
+ return false;
+}
+
/* machine check interruption code */
/* subclasses */
--
2.13.0
- [Qemu-devel] [PULL 00/21] s390x patches, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 01/21] pc-bios/s390-ccw: Remove duplicate blk_factor adjustment, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 02/21] pc-bios/s390-ccw: Move SCSI block factor to outer read, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 04/21] pc-bios/s390-ccw: Refactor scsi_inquiry function, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 05/21] pc-bios/s390-ccw: Get list of supported VPD pages, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 06/21] pc-bios/s390-ccw: Get Block Limits VPD device data, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 07/21] pc-bios/s390-ccw: Build a reasonable max_sectors limit, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 03/21] pc-bios/s390-ccw: Break up virtio-scsi read into multiples, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 08/21] pc-bios/s390-ccw.img: rebuild image, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 09/21] linux-headers: update, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 10/21] s390x/css: add s390-squash-mcss machine option,
Cornelia Huck <=
- [Qemu-devel] [PULL 13/21] s390x/css: device support for s390-ccw passthrough, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 12/21] s390x/css: realize css_create_sch, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 14/21] vfio/ccw: vfio based subchannel passthrough driver, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 11/21] s390x/css: realize css_sch_build_schib, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 20/21] MAINTAINERS: Add vfio-ccw maintainer, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 16/21] vfio/ccw: get irqs info and set the eventfd fd, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 18/21] s390x/css: ccw translation infrastructure, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 15/21] vfio/ccw: get io region info, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 17/21] s390x/css: introduce and realize ccw-request callback, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 19/21] vfio/ccw: update sense data if a unit check is pending, Cornelia Huck, 2017/05/23