> -----Original Message-----
> From: Roger Pau Monne
> Sent: 07 November 2018 11:49
> To: Paul Durrant <paul.durr...@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Andrew Cooper
> <andrew.coop...@citrix.com>; Jan Beulich <jbeul...@suse.com>
> Subject: Re: [Xen-devel] [PATCH v3 3/5] viridian: define type for the
> 'virtual VP assist page'
> 
> On Wed, Nov 07, 2018 at 10:52:21AM +0000, Paul Durrant wrote:
> > The specification [1] defines a type so we should use it, rather than
> just
> > OR-ing and AND-ing magic bits.
> >
> > No functional change.
> >
> > NOTE: The type defined in the specification does include an anonymous
> >       sub-struct in the page type but, as we currently use only the
> first
> >       element, the struct declaration has been omitted.
> >
> > [1] https://github.com/MicrosoftDocs/Virtualization-
> Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specif
> ication%20v5.0C.pdf
> >
> > Signed-off-by: Paul Durrant <paul.durr...@citrix.com>
> > Reviewed-by: Wei Liu <wei.l...@citrix.com>
> 
> Reviewed-by: Roger Pau Monné <roger....@citrix.com>
> 
> Just one style nit below...
> 
> > ---
> > Cc: Jan Beulich <jbeul...@suse.com>
> > Cc: Andrew Cooper <andrew.coop...@citrix.com>
> >
> > v3:
> >  - Move the typedef of HV_VP_ASSIST_PAGE into viridian.h so that it can
> >    be used in the declaration of struct viridian_vcpu
> > ---
> >  xen/arch/x86/hvm/viridian/synic.c  | 52 +++++++++++++++++++++++--------
> -------
> >  xen/include/asm-x86/hvm/viridian.h |  4 ++-
> >  2 files changed, 35 insertions(+), 21 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/viridian/synic.c
> b/xen/arch/x86/hvm/viridian/synic.c
> > index 366608208f..d8d6f6e1c9 100644
> > --- a/xen/arch/x86/hvm/viridian/synic.c
> > +++ b/xen/arch/x86/hvm/viridian/synic.c
> > @@ -16,6 +16,18 @@
> >
> >  #include "private.h"
> >
> > +typedef struct _HV_VIRTUAL_APIC_ASSIST
> > +{
> > +    uint32_t no_eoi:1;
> > +    uint32_t reserved_zero:31;
> > +} HV_VIRTUAL_APIC_ASSIST;
> > +
> > +union _HV_VP_ASSIST_PAGE
> > +{
> > +    HV_VIRTUAL_APIC_ASSIST ApicAssist;
> > +    uint8_t ReservedZBytePadding[PAGE_SIZE];
> > +};
> 
> One struct uses CamelCase for fields while the other just uses
> underscores. I think it would be better to use a single style.
> 

That is deliberate. There is no struct definition in the spec. only the name. 
Thus the field names are ones I have invented based on the text, rather than 
being 'official'. I reserve CamelCase for the 'official' names :-)

  Paul

> Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to