Re: [PATCH v4 1/5] x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit

Vitaly Kuznetsov
2020-03-10T16:56:08Z

Jon Doron <arilou@gmail.com> writes:

> Signed-off-by: Jon Doron <arilou@gmail.com>
> ---
> include/uapi/linux/kvm.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 4b95f9a31a2f..7acfd6a2569a 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -189,6 +189,7 @@ struct kvm_hyperv_exit {
> #define KVM_EXIT_HYPERV_SYNIC 1
> #define KVM_EXIT_HYPERV_HCALL 2
> __u32 type;
> + __u32 pad;
> union {
> struct {
> __u32 msr;

Sorry if I missed something but I think the suggestion was to pad this
'msr' too (in case we're aiming at making padding explicit for the whole
structure). Or is there any reason to not do that?

Also, I just noticed that we have a copy of this definition in
Documentation/virt/kvm/api.rst - it will need to be updated (and sorry
for not noticing it earlier).

--
Vitaly