@@ -688,6 +688,7 @@ struct s390_io_adapter {
struct kvm_s390_cpu_model {
/* facility mask supported by kvm & hosting machine */
__u64 fac_mask[S390_ARCH_FAC_LIST_SIZE_U64];
+ struct kvm_s390_vm_cpu_subfunc subfuncs;
/* facility list requested by guest (in dma page) */
__u64 *fac_list;
u64 cpuid;
@@ -1218,51 +1218,6 @@ static int kvm_s390_set_processor_subfunc(struct kvm *kvm,
}
mutex_unlock(&kvm->lock);
- VM_EVENT(kvm, 3, "SET: guest PLO subfunc 0x%16.16lx.%16.16lx.%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[1],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[2],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[3]);
- VM_EVENT(kvm, 3, "SET: guest PTFF subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.ptff)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.ptff)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMAC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmac)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmac)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmc)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmc)[1]);
- VM_EVENT(kvm, 3, "SET: guest KM subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.km)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.km)[1]);
- VM_EVENT(kvm, 3, "SET: guest KIMD subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kimd)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kimd)[1]);
- VM_EVENT(kvm, 3, "SET: guest KLMD subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.klmd)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.klmd)[1]);
- VM_EVENT(kvm, 3, "SET: guest PCKMO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.pckmo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.pckmo)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMCTR subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmctr)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmctr)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMF subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmf)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmf)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmo)[1]);
- VM_EVENT(kvm, 3, "SET: guest PCC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.pcc)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.pcc)[1]);
- VM_EVENT(kvm, 3, "SET: guest PPNO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.ppno)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.ppno)[1]);
- VM_EVENT(kvm, 3, "SET: guest KMA subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kma)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kma)[1]);
-
return 0;
}
@@ -1378,51 +1333,6 @@ static int kvm_s390_get_processor_subfunc(struct kvm *kvm,
sizeof(struct kvm_s390_vm_cpu_subfunc)))
return -EFAULT;
- VM_EVENT(kvm, 3, "GET: guest PLO subfunc 0x%16.16lx.%16.16lx.%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[1],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[2],
- ((unsigned long *) &kvm->arch.model.subfuncs.plo)[3]);
- VM_EVENT(kvm, 3, "GET: guest PTFF subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.ptff)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.ptff)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMAC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmac)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmac)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmc)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmc)[1]);
- VM_EVENT(kvm, 3, "GET: guest KM subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.km)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.km)[1]);
- VM_EVENT(kvm, 3, "GET: guest KIMD subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kimd)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kimd)[1]);
- VM_EVENT(kvm, 3, "GET: guest KLMD subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.klmd)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.klmd)[1]);
- VM_EVENT(kvm, 3, "GET: guest PCKMO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.pckmo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.pckmo)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMCTR subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmctr)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmctr)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMF subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmf)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmf)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kmo)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kmo)[1]);
- VM_EVENT(kvm, 3, "GET: guest PCC subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.pcc)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.pcc)[1]);
- VM_EVENT(kvm, 3, "GET: guest PPNO subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.ppno)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.ppno)[1]);
- VM_EVENT(kvm, 3, "GET: guest KMA subfunc 0x%16.16lx.%16.16lx",
- ((unsigned long *) &kvm->arch.model.subfuncs.kma)[0],
- ((unsigned long *) &kvm->arch.model.subfuncs.kma)[1]);
-
return 0;
}
@@ -1480,6 +1390,7 @@ static int kvm_s390_get_machine_subfunc(struct kvm *kvm,
return 0;
}
+
static int kvm_s390_get_cpu_model(struct kvm *kvm, struct kvm_device_attr *attr)
{
int ret = -ENXIO;
@@ -1597,10 +1508,9 @@ static int kvm_s390_vm_has_attr(struct kvm *kvm, struct kvm_device_attr *attr)
case KVM_S390_VM_CPU_PROCESSOR_FEAT:
case KVM_S390_VM_CPU_MACHINE_FEAT:
case KVM_S390_VM_CPU_MACHINE_SUBFUNC:
+ case KVM_S390_VM_CPU_PROCESSOR_SUBFUNC:
ret = 0;
break;
- /* configuring subfunctions is not supported yet */
- case KVM_S390_VM_CPU_PROCESSOR_SUBFUNC:
default:
ret = -ENXIO;
break;
@@ -2214,6 +2124,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
kvm->arch.model.fac_list[i] = S390_lowcore.stfle_fac_list[i] &
kvm_s390_fac_base[i];
}
+ kvm->arch.model.subfuncs = kvm_s390_available_subfunc;
/* we are always in czam mode - even on pre z14 machines */
set_kvm_facility(kvm->arch.model.fac_mask, 138);