From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Subject: [PATCH 11/15] hyperv: uapi-fy monitored notification structures Date: Tue, 20 Dec 2016 18:55:58 +0300 Message-ID: <20161220155602.6298-12-rkagan@virtuozzo.com> References: <20161220155602.6298-1-rkagan@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, "Denis V . Lunev" , Haiyang Zhang , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Roman Kagan , "H. Peter Anvin" , devel@linuxdriverproject.org, Thomas Gleixner To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , "K. Y. Srinivasan" , Vitaly Kuznetsov Return-path: In-Reply-To: <20161220155602.6298-1-rkagan@virtuozzo.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: kvm.vger.kernel.org Move structures for monitored notifications to the uapi header for userspace to be able to consume. Also observe that hv_monitor_parameter is by definition the same as hv_input_signal_event so use the latter and nuke the former. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h | 23 +++++++++++++++ drivers/hv/hyperv_vmbus.h | 60 -------------------------------------- 2 files changed, 23 insertions(+), 60 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index eb8d42a..e081615 100644 --- a/arch/x86/include/uapi/asm/hyperv.h +++ b/arch/x86/include/uapi/asm/hyperv.h @@ -396,4 +396,27 @@ struct hv_input_signal_event { __u16 rsvdz; } __attribute__((aligned(HV_HYPERCALL_PARAM_ALIGN))); +/* Definitions for the monitored notification facility */ +struct hv_monitor_trigger_group { + __u32 pending; + __u32 armed; +}; + +struct hv_monitor_page { + __u32 trigger_state; + __u32 rsvdz1; + + struct hv_monitor_trigger_group trigger_group[4]; + __u64 rsvdz2[3]; + + __s32 next_checktime[4][32]; + + __u16 latency[4][32]; + __u64 rsvdz3[32]; + + struct hv_input_signal_event parameter[4][32]; + + __u8 rsvdz4[1984]; +}; + #endif diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index a96f021..7f247f2 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -94,66 +94,6 @@ struct hv_connection_info { }; }; -/* Definitions for the monitored notification facility */ -union hv_monitor_trigger_group { - u64 as_uint64; - struct { - u32 pending; - u32 armed; - }; -}; - -struct hv_monitor_parameter { - u32 connectionid; - u16 flagnumber; - u16 rsvdz; -}; - -union hv_monitor_trigger_state { - u32 asu32; - - struct { - u32 group_enable:4; - u32 rsvdz:28; - }; -}; - -/* struct hv_monitor_page Layout */ -/* ------------------------------------------------------ */ -/* | 0 | TriggerState (4 bytes) | Rsvd1 (4 bytes) | */ -/* | 8 | TriggerGroup[0] | */ -/* | 10 | TriggerGroup[1] | */ -/* | 18 | TriggerGroup[2] | */ -/* | 20 | TriggerGroup[3] | */ -/* | 28 | Rsvd2[0] | */ -/* | 30 | Rsvd2[1] | */ -/* | 38 | Rsvd2[2] | */ -/* | 40 | NextCheckTime[0][0] | NextCheckTime[0][1] | */ -/* | ... | */ -/* | 240 | Latency[0][0..3] | */ -/* | 340 | Rsvz3[0] | */ -/* | 440 | Parameter[0][0] | */ -/* | 448 | Parameter[0][1] | */ -/* | ... | */ -/* | 840 | Rsvd4[0] | */ -/* ------------------------------------------------------ */ -struct hv_monitor_page { - union hv_monitor_trigger_state trigger_state; - u32 rsvdz1; - - union hv_monitor_trigger_group trigger_group[4]; - u64 rsvdz2[3]; - - s32 next_checktime[4][32]; - - u16 latency[4][32]; - u64 rsvdz3[32]; - - struct hv_monitor_parameter parameter[4][32]; - - u8 rsvdz4[1984]; -}; - /* * Versioning definitions used for guests reporting themselves to the * hypervisor, and visa versa. -- 2.9.3