Commit 94422ee8 authored by Michael Mueller's avatar Michael Mueller Committed by Christian Borntraeger

KVM: s390: fix in memory copy of facility lists

The facility lists were not fully copied.
Signed-off-by: default avatarMichael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 86044c8c
...@@ -579,7 +579,7 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr) ...@@ -579,7 +579,7 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr)
memcpy(&mach->fac_mask, kvm_s390_fac_list_mask, memcpy(&mach->fac_mask, kvm_s390_fac_list_mask,
kvm_s390_fac_list_mask_size() * sizeof(u64)); kvm_s390_fac_list_mask_size() * sizeof(u64));
memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list, memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list,
S390_ARCH_FAC_LIST_SIZE_U64); S390_ARCH_FAC_LIST_SIZE_BYTE);
if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach))) if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach)))
ret = -EFAULT; ret = -EFAULT;
kfree(mach); kfree(mach);
...@@ -903,7 +903,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) ...@@ -903,7 +903,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
goto out_nofac; goto out_nofac;
memcpy(kvm->arch.model.fac->kvm, S390_lowcore.stfle_fac_list, memcpy(kvm->arch.model.fac->kvm, S390_lowcore.stfle_fac_list,
S390_ARCH_FAC_LIST_SIZE_U64); S390_ARCH_FAC_LIST_SIZE_BYTE);
/* /*
* If this KVM host runs *not* in a LPAR, relax the facility bits * If this KVM host runs *not* in a LPAR, relax the facility bits
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment