aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/kvm.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-07-21 11:11:11 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2015-10-21 12:21:30 +0200
commit1cd4e0f6f0a6b1978a5868b41d4faae2071dc4ee (patch)
treea9e43a3179d5c28b91793436f3a3aa5310f06194 /target-s390x/kvm.c
parent4ab729207fe1464b19c6bec609cd545ab717174a (diff)
downloadqemu-1cd4e0f6f0a6b1978a5868b41d4faae2071dc4ee.zip
qemu-1cd4e0f6f0a6b1978a5868b41d4faae2071dc4ee.tar.gz
qemu-1cd4e0f6f0a6b1978a5868b41d4faae2071dc4ee.tar.bz2
s390x/cmma: clean up cmma reset
The cmma reset is per VM, so we don't need a cpu object. We can directly make use of kvm_state, as it is already available when the reset is called. By moving the cmma reset in our machine reset function, we can avoid a manual reset handler. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r--target-s390x/kvm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 84dffe9..c3be180 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -173,16 +173,15 @@ int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit)
return kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);
}
-void kvm_s390_clear_cmma_callback(void *opaque)
+void kvm_s390_cmma_reset(void)
{
int rc;
- KVMState *s = opaque;
struct kvm_device_attr attr = {
.group = KVM_S390_VM_MEM_CTRL,
.attr = KVM_S390_VM_MEM_CLR_CMMA,
};
- rc = kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);
+ rc = kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
trace_kvm_clear_cmma(rc);
}
@@ -200,9 +199,6 @@ static void kvm_s390_enable_cmma(KVMState *s)
}
rc = kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);
- if (!rc) {
- qemu_register_reset(kvm_s390_clear_cmma_callback, s);
- }
trace_kvm_enable_cmma(rc);
}