lkml.org 
[lkml]   [2016]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/15] hyperv: uapi-fy synic event flags definitions
On Tue, 20 Dec 2016 18:55:49 +0300
Roman Kagan <rkagan@virtuozzo.com> wrote:

> Move definitions related to the Hyper-V SynIC event flags to a header
> where they can be consumed by userspace.
>
> While doing so, also clean up their use by switching to standard bitops
> and struct-based dereferencing. The latter is also done for message
> pages.
>
> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
> ---
> arch/x86/include/uapi/asm/hyperv.h | 13 +++++++++
> drivers/hv/hyperv_vmbus.h | 24 ++--------------
> drivers/hv/channel_mgmt.c | 10 +++----
> drivers/hv/connection.c | 47 ++++++++++---------------------
> drivers/hv/vmbus_drv.c | 57 ++++++++++++++------------------------
> 5 files changed, 54 insertions(+), 97 deletions(-)
>
> diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h
> index 6098ab5..af542a3 100644
> --- a/arch/x86/include/uapi/asm/hyperv.h
> +++ b/arch/x86/include/uapi/asm/hyperv.h
> @@ -363,4 +363,17 @@ struct hv_timer_message_payload {
> #define HV_STIMER_AUTOENABLE (1ULL << 3)
> #define HV_STIMER_SINT(config) (__u8)(((config) >> 16) & 0x0F)
>
> +/* Define synthetic interrupt controller flag constants. */
> +#define HV_EVENT_FLAGS_COUNT (256 * 8)
> +
> +/* Define the synthetic interrupt controller event flags format. */
> +struct hv_synic_event_flags {
> + __u64 flags[HV_EVENT_FLAGS_COUNT / 64];
> +};
> +
> +/* Define the synthetic interrupt flags page layout. */
> +struct hv_synic_event_flags_page {
> + struct hv_synic_event_flags sintevent_flags[HV_SYNIC_SINT_COUNT];
> +};
> +
> #endif

How are these going to be exposed to user space?

They should really be unsigned long since there is no guarantee of atomic operation
on 64 bit values on 32 bit architectures.

\
 
 \ /
  Last update: 2016-12-20 18:26    [W:0.387 / U:1.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site