[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v24 08/21] target/s390x/cpu topology: activate CPU topology
From: |
Nina Schoetterl-Glausch |
Subject: |
[PATCH v24 08/21] target/s390x/cpu topology: activate CPU topology |
Date: |
Tue, 26 Sep 2023 14:15:21 +0200 |
From: Pierre Morel <pmorel@linux.ibm.com>
The KVM capability KVM_CAP_S390_CPU_TOPOLOGY is used to
activate the S390_FEAT_CONFIGURATION_TOPOLOGY feature and
the topology facility in the host CPU model for the guest
in the case the topology is available in QEMU and in KVM.
The feature is disabled by default and fenced for SE
(secure execution).
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/cpu-topology.c | 2 +-
target/s390x/cpu_models.c | 1 +
target/s390x/kvm/kvm.c | 9 +++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/cpu-topology.c b/hw/s390x/cpu-topology.c
index c34581964f..13f404a0d7 100644
--- a/hw/s390x/cpu-topology.c
+++ b/hw/s390x/cpu-topology.c
@@ -69,7 +69,7 @@ static int s390_socket_nb(S390CPU *cpu)
*/
bool s390_has_topology(void)
{
- return false;
+ return s390_has_feat(S390_FEAT_CONFIGURATION_TOPOLOGY);
}
/**
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 98f14c09c2..4dead48650 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -255,6 +255,7 @@ bool s390_has_feat(S390Feat feat)
case S390_FEAT_SIE_CMMA:
case S390_FEAT_SIE_PFMFI:
case S390_FEAT_SIE_IBS:
+ case S390_FEAT_CONFIGURATION_TOPOLOGY:
return false;
break;
default:
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 4d84dcc018..2e43dc746f 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -366,6 +366,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
kvm_vm_enable_cap(s, KVM_CAP_S390_USER_SIGP, 0);
kvm_vm_enable_cap(s, KVM_CAP_S390_VECTOR_REGISTERS, 0);
kvm_vm_enable_cap(s, KVM_CAP_S390_USER_STSI, 0);
+ kvm_vm_enable_cap(s, KVM_CAP_S390_CPU_TOPOLOGY, 0);
if (ri_allowed()) {
if (kvm_vm_enable_cap(s, KVM_CAP_S390_RI, 0) == 0) {
cap_ri = 1;
@@ -2509,6 +2510,14 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,
Error **errp)
set_bit(S390_FEAT_UNPACK, model->features);
}
+ /*
+ * If we have kernel support for CPU Topology indicate the
+ * configuration-topology facility.
+ */
+ if (kvm_check_extension(kvm_state, KVM_CAP_S390_CPU_TOPOLOGY)) {
+ set_bit(S390_FEAT_CONFIGURATION_TOPOLOGY, model->features);
+ }
+
/* We emulate a zPCI bus and AEN, therefore we don't need HW support */
set_bit(S390_FEAT_ZPCI, model->features);
set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features);
--
2.39.2
- [PATCH v24 00/21] s390x: CPU Topology, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 04/21] target/s390x/cpu topology: handle STSI(15) and build the SYSIB, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 14/21] docs/s390x/cpu topology: document s390x cpu topology, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 02/21] CPU topology: extend with s390 specifics, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 15/21] tests/avocado: s390x cpu topology core, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 06/21] s390x/cpu topology: resetting the Topology-Change-Report, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 03/21] s390x/cpu topology: add topology entries on CPU hotplug, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 08/21] target/s390x/cpu topology: activate CPU topology,
Nina Schoetterl-Glausch <=
- [PATCH v24 09/21] qapi/s390x/cpu topology: set-cpu-topology qmp command, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 13/21] qapi/s390x/cpu topology: add query-s390x-cpu-polarization command, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 16/21] tests/avocado: s390x cpu topology polarization, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 01/21] qapi: machine.json: change docs regarding CpuInstanceProperties, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 20/21] tests/avocado: s390x cpu topology dedicated errors, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 21/21] tests/avocado: s390x cpu topology bad move, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 11/21] machine: adding s390 topology to info hotpluggable-cpus, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 07/21] s390x/cpu topology: interception of PTF instruction, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 05/21] s390x/sclp: reporting the maximum nested topology entries, Nina Schoetterl-Glausch, 2023/09/26