[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 8/9] s390x/cpu_topology: activating CPU topology
From: |
Pierre Morel |
Subject: |
[PATCH v10 8/9] s390x/cpu_topology: activating CPU topology |
Date: |
Wed, 12 Oct 2022 18:21:06 +0200 |
The KVM capability, KVM_CAP_S390_CPU_TOPOLOGY is used to
activate the S390_FEAT_CONFIGURATION_TOPOLOGY feature and
the topology facility for the guest in the case the topology
is available in QEMU and in KVM.
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
target/s390x/kvm/kvm.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 49a99931a4..1c4e24c9a7 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -2464,6 +2464,22 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,
Error **errp)
set_bit(S390_FEAT_UNPACK, model->features);
}
+ /*
+ * If we have the CPU Topology allowed in QEMU and
+ * implemented in KVM, activate the CPU TOPOLOGY feature.
+ */
+ if (s390_has_topology()) {
+ if (!kvm_check_extension(kvm_state, KVM_CAP_S390_CPU_TOPOLOGY)) {
+ error_setg(errp, "KVM: S390 topology not present in kernel");
+ return;
+ }
+ if (kvm_vm_enable_cap(kvm_state, KVM_CAP_S390_CPU_TOPOLOGY, 0) < 0) {
+ error_setg(errp, "KVM: Error enabling KVM_CAP_S390_CPU_TOPOLOGY");
+ return;
+ }
+ 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
- Re: [PATCH v10 3/9] s390x/cpu_topology: resetting the Topology-Change-Report, (continued)
[PATCH v10 5/9] target/s390x: interception of PTF instruction, Pierre Morel, 2022/10/12
[PATCH v10 7/9] s390x/cpu topology: add max_threads machine class attribute, Pierre Morel, 2022/10/12
[PATCH v10 9/9] docs/s390x: document s390x cpu topology, Pierre Morel, 2022/10/12
[PATCH v10 8/9] s390x/cpu_topology: activating CPU topology,
Pierre Morel <=