[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/14] s390x/s390-virtio-ccw: add zpcii-disable machine property
From: |
Thomas Huth |
Subject: |
[PULL 13/14] s390x/s390-virtio-ccw: add zpcii-disable machine property |
Date: |
Mon, 26 Sep 2022 19:08:03 +0200 |
From: Matthew Rosato <mjrosato@linux.ibm.com>
The zpcii-disable machine property can be used to force-disable the use
of zPCI interpretation facilities for a VM. By default, this setting
will be off for machine 7.2 and newer.
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-Id: <20220902172737.170349-9-mjrosato@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Fix contextual conflict in ccw_machine_7_1_instance_options()]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/s390x/s390-virtio-ccw.h | 1 +
hw/s390x/s390-pci-kvm.c | 4 +++-
hw/s390x/s390-virtio-ccw.c | 24 ++++++++++++++++++++++++
util/qemu-config.c | 4 ++++
qemu-options.hx | 8 +++++++-
5 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/include/hw/s390x/s390-virtio-ccw.h
b/include/hw/s390x/s390-virtio-ccw.h
index 3331990e02..8a0090a071 100644
--- a/include/hw/s390x/s390-virtio-ccw.h
+++ b/include/hw/s390x/s390-virtio-ccw.h
@@ -27,6 +27,7 @@ struct S390CcwMachineState {
bool aes_key_wrap;
bool dea_key_wrap;
bool pv;
+ bool zpcii_disable;
uint8_t loadparm[8];
};
diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c
index 9134fe185f..5eb7fd12e2 100644
--- a/hw/s390x/s390-pci-kvm.c
+++ b/hw/s390x/s390-pci-kvm.c
@@ -22,7 +22,9 @@
bool s390_pci_kvm_interp_allowed(void)
{
- return kvm_s390_get_zpci_op() && !s390_is_pv();
+ return (kvm_s390_get_zpci_op() && !s390_is_pv() &&
+ !object_property_get_bool(OBJECT(qdev_get_machine()),
+ "zpcii-disable", NULL));
}
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e18b816aba..03855c7231 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -645,6 +645,21 @@ static inline void machine_set_dea_key_wrap(Object *obj,
bool value,
ms->dea_key_wrap = value;
}
+static inline bool machine_get_zpcii_disable(Object *obj, Error **errp)
+{
+ S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+
+ return ms->zpcii_disable;
+}
+
+static inline void machine_set_zpcii_disable(Object *obj, bool value,
+ Error **errp)
+{
+ S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+
+ ms->zpcii_disable = value;
+}
+
static S390CcwMachineClass *current_mc;
/*
@@ -740,6 +755,13 @@ static inline void s390_machine_initfn(Object *obj)
"Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
" to upper case) to pass to machine loader, boot manager,"
" and guest kernel");
+
+ object_property_add_bool(obj, "zpcii-disable",
+ machine_get_zpcii_disable,
+ machine_set_zpcii_disable);
+ object_property_set_description(obj, "zpcii-disable",
+ "disable zPCI interpretation facilties");
+ object_property_set_bool(obj, "zpcii-disable", false, NULL);
}
static const TypeInfo ccw_machine_info = {
@@ -804,10 +826,12 @@ DEFINE_CCW_MACHINE(7_2, "7.2", true);
static void ccw_machine_7_1_instance_options(MachineState *machine)
{
static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V7_1 };
+ S390CcwMachineState *ms = S390_CCW_MACHINE(machine);
ccw_machine_7_2_instance_options(machine);
s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE);
s390_set_qemu_cpu_model(0x8561, 15, 1, qemu_cpu_feat);
+ ms->zpcii_disable = true;
}
static void ccw_machine_7_1_class_options(MachineClass *mc)
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 433488aa56..5325f6bf80 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -236,6 +236,10 @@ static QemuOptsList machine_opts = {
.help = "Up to 8 chars in set of [A-Za-z0-9. ](lower case chars"
" converted to upper case) to pass to machine"
" loader, boot manager, and guest kernel",
+ },{
+ .name = "zpcii-disable",
+ .type = QEMU_OPT_BOOL,
+ .help = "disable zPCI interpretation facilities",
},
{ /* End of list */ }
}
diff --git a/qemu-options.hx b/qemu-options.hx
index d8b5ce5b43..7c61868b68 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -37,7 +37,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" memory-encryption=@var{} memory encryption object to use
(default=none)\n"
" hmat=on|off controls ACPI HMAT support (default=off)\n"
" memory-backend='backend-id' specifies explicitly provided
backend for main RAM (default=none)\n"
- "
cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n",
+ "
cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n"
+ " zpcii-disable=on|off disables zPCI interpretation
facilities (default=off)\n",
QEMU_ARCH_ALL)
SRST
``-machine [type=]name[,prop=value[,...]]``
@@ -157,6 +158,11 @@ SRST
::
-machine
cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k
+
+ ``zpcii-disable=on|off``
+ Disables zPCI interpretation facilties on s390-ccw hosts.
+ This feature can be used to disable hardware virtual assists
+ related to zPCI devices. The default is off.
ERST
DEF("M", HAS_ARG, QEMU_OPTION_M,
--
2.31.1
- [PULL 00/14] s390x patches and slirp submodule removal, Thomas Huth, 2022/09/26
- [PULL 01/14] s390x/tcg: Fix opcode for lzrf, Thomas Huth, 2022/09/26
- [PULL 05/14] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Thomas Huth, 2022/09/26
- [PULL 02/14] linux-user/host/s390: Add vector instructions to host_signal_write(), Thomas Huth, 2022/09/26
- [PULL 03/14] target/s390x: support SHA-512 extensions, Thomas Huth, 2022/09/26
- [PULL 08/14] s390x/pci: enable for load/store interpretation, Thomas Huth, 2022/09/26
- [PULL 04/14] target/s390x: support PRNO_TRNG instruction, Thomas Huth, 2022/09/26
- [PULL 06/14] Update linux headers to v6.0-rc4, Thomas Huth, 2022/09/26
- [PULL 11/14] s390x/pci: let intercept devices have separate PCI groups, Thomas Huth, 2022/09/26
- [PULL 13/14] s390x/s390-virtio-ccw: add zpcii-disable machine property,
Thomas Huth <=
- [PULL 10/14] s390x/pci: enable adapter event notification for interpreted devices, Thomas Huth, 2022/09/26
- [PULL 14/14] Remove the slirp submodule (i.e. compile only with an external libslirp), Thomas Huth, 2022/09/26
- [PULL 07/14] s390x/pci: add routine to get host function handle from CLP info, Thomas Huth, 2022/09/26
- [PULL 12/14] s390x/pci: reflect proper maxstbl for groups of interpreted devices, Thomas Huth, 2022/09/26
- [PULL 09/14] s390x/pci: don't fence interpreted devices without MSI-X, Thomas Huth, 2022/09/26
- Re: [PULL 00/14] s390x patches and slirp submodule removal, Stefan Hajnoczi, 2022/09/27