Skip to content

Commit fd58c03

Browse files
committed
hw/s390x: Remove the cpu_model_allowed flag and related code
Now that the last machine type that disabled cpu_model_allowed has been removed, we can also remove the cpu_model_allowed flag itself and all the related conditional code. Reviewed-by: Cornelia Huck <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Message-ID: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 3199c7e commit fd58c03

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

hw/s390x/s390-virtio-ccw.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,7 @@ static S390CcwMachineClass *current_mc;
727727
*
728728
* Attention! Do *not* add additional new wrappers for CPU features via this
729729
* mechanism anymore. CPU features should be handled via the CPU models,
730-
* i.e. checking with cpu_model_allowed() during CPU initialization and
731-
* s390_has_feat() later should be sufficient.
730+
* i.e. checking with s390_has_feat() should be sufficient.
732731
*/
733732
static S390CcwMachineClass *get_machine_class(void)
734733
{
@@ -744,11 +743,6 @@ static S390CcwMachineClass *get_machine_class(void)
744743
return current_mc;
745744
}
746745

747-
bool cpu_model_allowed(void)
748-
{
749-
return get_machine_class()->cpu_model_allowed;
750-
}
751-
752746
bool hpage_1m_allowed(void)
753747
{
754748
return get_machine_class()->hpage_1m_allowed;
@@ -786,7 +780,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
786780
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
787781
S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc);
788782

789-
s390mc->cpu_model_allowed = true;
790783
s390mc->hpage_1m_allowed = true;
791784
s390mc->max_threads = 1;
792785
mc->init = ccw_init;

include/hw/s390x/s390-virtio-ccw.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,10 @@ struct S390CcwMachineClass {
5353
MachineClass parent_class;
5454

5555
/*< public >*/
56-
bool cpu_model_allowed;
5756
bool hpage_1m_allowed;
5857
int max_threads;
5958
};
6059

61-
/* cpu model allowed by the machine */
62-
bool cpu_model_allowed(void);
6360
/* 1M huge page mappings allowed by the machine */
6461
bool hpage_1m_allowed(void);
6562

target/s390x/kvm/kvm.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,20 +374,18 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
374374
kvm_vm_enable_cap(s, KVM_CAP_S390_VECTOR_REGISTERS, 0);
375375
kvm_vm_enable_cap(s, KVM_CAP_S390_USER_STSI, 0);
376376
kvm_vm_enable_cap(s, KVM_CAP_S390_CPU_TOPOLOGY, 0);
377+
kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0);
377378
if (kvm_vm_enable_cap(s, KVM_CAP_S390_RI, 0) == 0) {
378379
cap_ri = 1;
379380
}
380-
if (cpu_model_allowed()) {
381-
kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0);
382-
}
383381

384382
/*
385383
* The migration interface for ais was introduced with kernel 4.13
386384
* but the capability itself had been active since 4.12. As migration
387385
* support is considered necessary, we only try to enable this for
388386
* newer machine types if KVM_CAP_S390_AIS_MIGRATION is available.
389387
*/
390-
if (cpu_model_allowed() && kvm_kernel_irqchip_allowed() &&
388+
if (kvm_kernel_irqchip_allowed() &&
391389
kvm_check_extension(s, KVM_CAP_S390_AIS_MIGRATION)) {
392390
kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0);
393391
}
@@ -2352,10 +2350,6 @@ static int configure_cpu_feat(const S390FeatBitmap features)
23522350

23532351
bool kvm_s390_cpu_models_supported(void)
23542352
{
2355-
if (!cpu_model_allowed()) {
2356-
/* compatibility machines interfere with the cpu model */
2357-
return false;
2358-
}
23592353
return kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,
23602354
KVM_S390_VM_CPU_MACHINE) &&
23612355
kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,

0 commit comments

Comments
 (0)