int vq, bool assign);
int kvm_s390_cpu_restart(S390CPU *cpu);
int kvm_s390_get_memslot_count(KVMState *s);
+int kvm_s390_cmma_active(void);
void kvm_s390_cmma_reset(void);
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
void kvm_s390_reset_vcpu(S390CPU *cpu);
static int cap_s390_irq;
static int cap_ri;
+static int active_cmma;
+
static void *legacy_s390_alloc(size_t size, uint64_t *align);
static int kvm_s390_query_mem_limit(KVMState *s, uint64_t *memory_limit)
return kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);
}
+int kvm_s390_cmma_active(void)
+{
+ return active_cmma;
+}
+
static bool kvm_s390_cmma_available(void)
{
static bool initialized, value;
.attr = KVM_S390_VM_MEM_CLR_CMMA,
};
- if (mem_path || !kvm_s390_cmma_available()) {
+ if (!kvm_s390_cmma_active()) {
return;
}
.attr = KVM_S390_VM_MEM_ENABLE_CMMA,
};
+ if (mem_path) {
+ error_report("Warning: CMM will not be enabled because it is not "
+ "compatible to hugetlbfs.");
+ return;
+ }
rc = kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
+ active_cmma = !rc;
trace_kvm_enable_cmma(rc);
}
if (!model) {
/* compatibility handling if cpu models are disabled */
- if (kvm_s390_cmma_available() && !mem_path) {
+ if (kvm_s390_cmma_available()) {
kvm_s390_enable_cmma();
}
return;
error_setg(errp, "KVM: Error configuring CPU subfunctions: %d", rc);
return;
}
- /* enable CMM via CMMA - disable on hugetlbfs */
+ /* enable CMM via CMMA */
if (test_bit(S390_FEAT_CMM, model->features)) {
- if (mem_path) {
- error_report("Warning: CMM will not be enabled because it is not "
- "compatible to hugetlbfs.");
- } else {
- kvm_s390_enable_cmma();
- }
+ kvm_s390_enable_cmma();
}
}