Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-29 Thread Thomas Gleixner
On Thu, 29 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: > >> > >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > >> > >>> Nadav Amit writes: > >>> > On a different note: how come all of the hyper-v structs are not

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-29 Thread Thomas Gleixner
On Thu, 29 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: > >> > >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > >> > >>> Nadav Amit writes: > >>> > On a different note: how come all of the hyper-v structs are not

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-29 Thread Vitaly Kuznetsov
Nadav Amit writes: >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: >> >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: >> >>> Nadav Amit writes: >>> On a different note: how come all of the hyper-v structs are not marked with the “packed" attribute? >>> >>> "packed" should

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-29 Thread Vitaly Kuznetsov
Nadav Amit writes: >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: >> >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: >> >>> Nadav Amit writes: >>> On a different note: how come all of the hyper-v structs are not marked with the “packed" attribute? >>> >>> "packed" should

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Roman Kagan
On Wed, Nov 28, 2018 at 02:07:42PM +0100, Thomas Gleixner wrote: > On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > > > Nadav Amit writes: > > > > > > > > On a different note: how come all of the hyper-v structs are not marked > > > with the “packed" attribute? > > > > "packed" should not be

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Roman Kagan
On Wed, Nov 28, 2018 at 02:07:42PM +0100, Thomas Gleixner wrote: > On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > > > Nadav Amit writes: > > > > > > > > On a different note: how come all of the hyper-v structs are not marked > > > with the “packed" attribute? > > > > "packed" should not be

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Nadav Amit
> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: > > On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > >> Nadav Amit writes: >> >>> On a different note: how come all of the hyper-v structs are not marked >>> with the “packed" attribute? >> >> "packed" should not be needed with proper

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Nadav Amit
> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: > > On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > >> Nadav Amit writes: >> >>> On a different note: how come all of the hyper-v structs are not marked >>> with the “packed" attribute? >> >> "packed" should not be needed with proper

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Thomas Gleixner
On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > > > > On a different note: how come all of the hyper-v structs are not marked > > with the “packed" attribute? > > "packed" should not be needed with proper padding; I vaguely remember > someone (from x86@?) arguing

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Thomas Gleixner
On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > > > > On a different note: how come all of the hyper-v structs are not marked > > with the “packed" attribute? > > "packed" should not be needed with proper padding; I vaguely remember > someone (from x86@?) arguing

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Vitaly Kuznetsov
Nadav Amit writes: > > On a different note: how come all of the hyper-v structs are not marked > with the “packed" attribute? "packed" should not be needed with proper padding; I vaguely remember someone (from x86@?) arguing _against_ "packed". -- Vitaly

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Vitaly Kuznetsov
Nadav Amit writes: > > On a different note: how come all of the hyper-v structs are not marked > with the “packed" attribute? "packed" should not be needed with proper padding; I vaguely remember someone (from x86@?) arguing _against_ "packed". -- Vitaly

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Paolo Bonzini
On 27/11/18 19:48, Roman Kagan wrote: > On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: >> Roman Kagan writes: >>> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >>> I personally tend to prefer masks over bitfields, so I'd rather do the >>> consolidation in

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Paolo Bonzini
On 27/11/18 19:48, Roman Kagan wrote: > On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: >> Roman Kagan writes: >>> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >>> I personally tend to prefer masks over bitfields, so I'd rather do the >>> consolidation in

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Nadav Amit
> On Nov 27, 2018, at 10:48 AM, Roman Kagan wrote: > > On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: >> Roman Kagan writes: >>> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >>> I personally tend to prefer masks over bitfields, so I'd rather do the >>>

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Nadav Amit
> On Nov 27, 2018, at 10:48 AM, Roman Kagan wrote: > > On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: >> Roman Kagan writes: >>> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >>> I personally tend to prefer masks over bitfields, so I'd rather do the >>>

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Roman Kagan
On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: > > I personally tend to prefer masks over bitfields, so I'd rather do the > > consolidation in the opposite direction: use the definitions

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Roman Kagan
On Tue, Nov 27, 2018 at 02:10:49PM +0100, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: > > I personally tend to prefer masks over bitfields, so I'd rather do the > > consolidation in the opposite direction: use the definitions

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Vitaly Kuznetsov
Out of pure curiosity I decided to check what 'gcc -O3' produces when we use bitfields and masks. As of 'gcc version 8.2.1 20181105 (Red Hat 8.2.1-5) (GCC)' 1) bitfields: struct abc { int enabled:1; int _pad:7; int vec:8; }; int is_good(struct abc *s) { if

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Vitaly Kuznetsov
Out of pure curiosity I decided to check what 'gcc -O3' produces when we use bitfields and masks. As of 'gcc version 8.2.1 20181105 (Red Hat 8.2.1-5) (GCC)' 1) bitfields: struct abc { int enabled:1; int _pad:7; int vec:8; }; int is_good(struct abc *s) { if

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Michael Kelley
From: Vitaly Kuznetsov Tuesday, November 27, 2018 5:11 AM > > I personally tend to prefer masks over bitfields, so I'd rather do the > > consolidation in the opposite direction: use the definitions in > > hyperv-tlfs.h and replace those unions/bitfields elsewhere. (I vaguely > > remember

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Michael Kelley
From: Vitaly Kuznetsov Tuesday, November 27, 2018 5:11 AM > > I personally tend to prefer masks over bitfields, so I'd rather do the > > consolidation in the opposite direction: use the definitions in > > hyperv-tlfs.h and replace those unions/bitfields elsewhere. (I vaguely > > remember

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Vitaly Kuznetsov
Roman Kagan writes: > [ Sorry for having missed v1 ] > > On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >> We implement Hyper-V SynIC and synthetic timers in KVM too so there's some >> room for code sharing. >> >> Signed-off-by: Vitaly Kuznetsov >> --- >>

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-27 Thread Vitaly Kuznetsov
Roman Kagan writes: > [ Sorry for having missed v1 ] > > On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: >> We implement Hyper-V SynIC and synthetic timers in KVM too so there's some >> room for code sharing. >> >> Signed-off-by: Vitaly Kuznetsov >> --- >>

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Roman Kagan
[ Sorry for having missed v1 ] On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: > We implement Hyper-V SynIC and synthetic timers in KVM too so there's some > room for code sharing. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/include/asm/hyperv-tlfs.h | 69

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Roman Kagan
[ Sorry for having missed v1 ] On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote: > We implement Hyper-V SynIC and synthetic timers in KVM too so there's some > room for code sharing. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/include/asm/hyperv-tlfs.h | 69

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Michael Kelley
From: Vitaly Kuznetsov Sent: Monday, November 26, 2018 7:47 AM > > We implement Hyper-V SynIC and synthetic timers in KVM too so there's some > room for code sharing. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/include/asm/hyperv-tlfs.h | 69 ++ >

RE: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Michael Kelley
From: Vitaly Kuznetsov Sent: Monday, November 26, 2018 7:47 AM > > We implement Hyper-V SynIC and synthetic timers in KVM too so there's some > room for code sharing. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/include/asm/hyperv-tlfs.h | 69 ++ >

[PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Vitaly Kuznetsov
We implement Hyper-V SynIC and synthetic timers in KVM too so there's some room for code sharing. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/hyperv-tlfs.h | 69 ++ drivers/hv/hv.c| 2 +- drivers/hv/hyperv_vmbus.h | 68

[PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-26 Thread Vitaly Kuznetsov
We implement Hyper-V SynIC and synthetic timers in KVM too so there's some room for code sharing. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/hyperv-tlfs.h | 69 ++ drivers/hv/hv.c| 2 +- drivers/hv/hyperv_vmbus.h | 68