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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jon Doron <arilou@xxxxxxxxx> writes:

> Signed-off-by: Jon Doron <arilou@xxxxxxxxx>
> ---
>  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..24b7c48ccc6f 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -197,6 +197,7 @@ struct kvm_hyperv_exit {
>  			__u64 msg_page;
>  		} synic;
>  		struct {
> +			__u32 pad;
>  			__u64 input;
>  			__u64 result;
>  			__u64 params[2];

This doesn't seem to be correct, __u64 get aligned at 8 byte boundary so
implicitly you now (pre-patch) have the following:

struct kvm_hyperv_exit {
	__u32 type;
        __u32 pad1;
	union {
		struct {
			__u32 msr;
                        __u32 pad2;
			__u64 control;
			__u64 evt_page;
			__u64 msg_page;
		} synic;
		struct {
			__u64 input;
			__u64 result;
			__u64 params[2];
		} hcall;
	} u;
};

and the suggestion is only to make it explicit. Adding something before
'input' will actually break ABI.

-- 
Vitaly




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux