[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v18 07/17] target/s390x/cpu topology: activate CPU topology
From: |
Pierre Morel |
Subject: |
[PATCH v18 07/17] target/s390x/cpu topology: activate CPU topology |
Date: |
Wed, 15 Mar 2023 15:34:52 +0100 |
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 2cce866fc7..5f8ca904bf 100644
--- a/hw/s390x/cpu-topology.c
+++ b/hw/s390x/cpu-topology.c
@@ -57,7 +57,7 @@ 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 065ec6d66c..aca2c5c96b 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -254,6 +254,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 fb63be41b7..e6f5b65dbe 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -371,6 +371,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;
@@ -2470,6 +2471,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.31.1
- [PATCH v18 00/17] s390x: CPU Topology, Pierre Morel, 2023/03/15
- [PATCH v18 05/17] s390x/cpu topology: resetting the Topology-Change-Report, Pierre Morel, 2023/03/15
- [PATCH v18 01/17] s390x/cpu topology: add s390 specifics to CPU topology, Pierre Morel, 2023/03/15
- [PATCH v18 06/17] s390x/cpu topology: interception of PTF instruction, Pierre Morel, 2023/03/15
- [PATCH v18 03/17] target/s390x/cpu topology: handle STSI(15) and build the SYSIB, Pierre Morel, 2023/03/15
- [PATCH v18 02/17] s390x/cpu topology: add topology entries on CPU hotplug, Pierre Morel, 2023/03/15
- [PATCH v18 04/17] s390x/sclp: reporting the maximum nested topology entries, Pierre Morel, 2023/03/15
- [PATCH v18 07/17] target/s390x/cpu topology: activate CPU topology,
Pierre Morel <=
- [PATCH v18 08/17] qapi/s390x/cpu topology: set-cpu-topology qmp command, Pierre Morel, 2023/03/15
- [PATCH v18 09/17] machine: adding s390 topology to query-cpu-fast, Pierre Morel, 2023/03/15
- [PATCH v18 10/17] machine: adding s390 topology to info hotpluggable-cpus, Pierre Morel, 2023/03/15
- [PATCH v18 11/17] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event, Pierre Morel, 2023/03/15
- [PATCH v18 13/17] tests/avocado: s390x cpu topology core, Pierre Morel, 2023/03/15
- [PATCH v18 17/17] tests/avocado: s390x cpu topology test socket full, Pierre Morel, 2023/03/15
- [PATCH v18 12/17] docs/s390x/cpu topology: document s390x cpu topology, Pierre Morel, 2023/03/15
- [PATCH v18 15/17] tests/avocado: s390x cpu topology entitlement tests, Pierre Morel, 2023/03/15
- [PATCH v18 14/17] tests/avocado: s390x cpu topology polarisation, Pierre Morel, 2023/03/15
- [PATCH v18 16/17] tests/avocado: s390x cpu topology test dedicated CPU, Pierre Morel, 2023/03/15