x86/HVM: __hvm_copy()'s size parameter is an unsigned quantity
authorJan Beulich <jbeulich@suse.com>
Wed, 8 Apr 2020 11:11:24 +0000 (13:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Apr 2020 11:11:24 +0000 (13:11 +0200)
commitd3ff3e48db4a59d1972bcdeb08cac22048d14b27
treef81bcf026b2e5b42baaf0d1ba8d6e72f1f0689aa
parentc8dbdb32cef8e8ef796c925e91e347ea83735790
x86/HVM: __hvm_copy()'s size parameter is an unsigned quantity

There are no negative sizes. Make the function's parameter as well as
that of its derivates "unsigned int". Similarly make its local "count"
variable "unsigned int", and drop "todo" altogether. Don't use min_t()
anymore to calculate "count". Restrict its scope as well as that of
other local variables of the function.

While at it I've also noticed that {copy_{from,to},clear}_user_hvm()
have been returning "unsigned long" for no apparent reason, as their
respective "size" parameters have already been "unsigned int". Adjust
this as well as a slightly wrong comment there at the same time.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <pdurrant@amzn.com>
xen/arch/x86/hvm/hvm.c
xen/include/asm-x86/hvm/guest_access.h
xen/include/asm-x86/hvm/support.h