Thread (10 messages) 10 messages, 2 authors, 2020-03-09

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

From: Jon Doron <hidden>
Date: 2020-03-09 18:11:30
Also in: kvm

On 09/03/2020, Vitaly Kuznetsov wrote:
Jon Doron [off-list ref] writes:
quoted
Signed-off-by: Jon Doron <redacted>
---
 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
Bah sorry guys :( not sure why this too so many iterations... will fix 
it right in next version.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help