[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161221063305.GC15917@rkaganb.sw.ru>
Date: Wed, 21 Dec 2016 09:33:05 +0300
From: Roman Kagan <rkagan@...tuozzo.com>
To: Stephen Hemminger <stephen@...workplumber.org>
CC: Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
"Vitaly Kuznetsov" <vkuznets@...hat.com>, <kvm@...r.kernel.org>,
"Denis V . Lunev" <den@...nvz.org>,
Haiyang Zhang <haiyangz@...rosoft.com>, <x86@...nel.org>,
<linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, <devel@...uxdriverproject.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 02/15] hyperv: uapi-fy synic event flags definitions
On Tue, Dec 20, 2016 at 09:24:53AM -0800, Stephen Hemminger wrote:
> On Tue, 20 Dec 2016 18:55:49 +0300
> Roman Kagan <rkagan@...tuozzo.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@...tuozzo.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.
Indeed, absolutely. These are bitmaps and should be unsigned long[], of
course. I'll fix it in the next iteration.
Thanks,
Roman.
Powered by blists - more mailing lists