Re: [GIT PULL] KVM patches for Linux 6.1-rc2

From: Paolo Bonzini
Date: Tue Oct 25 2022 - 05:42:53 EST


On 10/24/22 00:15, Linus Torvalds wrote:

compat_ptr() also happens to get the address space right (ie it
returns a "void __user *" pointer). But since the non-compat 'struct
kvm_msr_filter_range' bitmap member doesn't get that right either
(because it uses the same type for kernel pointers as for user
pointers - ugly uglt), that isn't such a big deal. The kvm code
clearly doesn't do proper user pointer typing, and just uses random
casts instead.
In general KVM ioctl arguments very rarely have __user pointers in them, so there's not much need for compat ioctls at all. KVM_GET_DIRTY_LOG and KVM_CLEAR_DIRTY_LOG get it right, but this one indeed can be improved with compat_ptr(). Will do for 6.2, thanks for the review.

Paolo