s390x/cpu topology: resetting the Topology-Change-Report

During a subsystem reset the Topology-Change-Report is cleared
by the machine.
Let's ask KVM to clear the Modified Topology Change Report (MTCR)
bit of the SCA in the case of a subsystem reset.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Message-ID: <20231016183925.2384704-7-nsg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Pierre Morel 2023-10-16 20:39:10 +02:00 committed by Thomas Huth
parent a67f05b391
commit 3d6e75f4df
7 changed files with 52 additions and 0 deletions

View file

@ -2664,6 +2664,23 @@ int kvm_s390_get_zpci_op(void)
return cap_zpci_op;
}
int kvm_s390_topology_set_mtcr(uint64_t attr)
{
struct kvm_device_attr attribute = {
.group = KVM_S390_VM_CPU_TOPOLOGY,
.attr = attr,
};
if (!s390_has_feat(S390_FEAT_CONFIGURATION_TOPOLOGY)) {
return 0;
}
if (!kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_TOPOLOGY, attr)) {
return -ENOTSUP;
}
return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attribute);
}
void kvm_arch_accel_class_init(ObjectClass *oc)
{
}

View file

@ -47,5 +47,6 @@ void kvm_s390_crypto_reset(void);
void kvm_s390_restart_interrupt(S390CPU *cpu);
void kvm_s390_stop_interrupt(S390CPU *cpu);
void kvm_s390_set_diag318(CPUState *cs, uint64_t diag318_info);
int kvm_s390_topology_set_mtcr(uint64_t attr);
#endif /* KVM_S390X_H */