On 1/27/22 09:08, Like Xu wrote:
Similar to kvm_arch_tsc_{s,g}et_attr(), how about this fix:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8033eca6f..6d4e961d0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4342,7 +4342,7 @@ static int kvm_x86_dev_get_attr(struct
kvm_device_attr *attr)
switch (attr->attr) {
case KVM_X86_XCOMP_GUEST_SUPP:
- if (put_user(supported_xcr0, (u64 __user *)attr->addr))
+ if (put_user(supported_xcr0, (u64 __user *)(unsigned
long)attr->addr))
return -EFAULT;
return 0;
default:
This has to be (at least in the future) 64 bits, so it has to use
copy_to_user.
I'll send a v2 of the patches today.
Paolo