xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Jan Beulich' <JBeulich@suse.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@citrix.com>
Subject: Re: [PATCH v2 9/9] viridian: introduce struct viridian_page
Date: Mon, 5 Nov 2018 13:18:01 +0000	[thread overview]
Message-ID: <ab6bf7186cda4a069ff61587c170021c@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5BE0402602000078001F8040@prv1-mh.provo.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 05 November 2018 13:06
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; Wei Liu
> <wei.liu2@citrix.com>; Ian Jackson <Ian.Jackson@citrix.com>; xen-devel
> <xen-devel@lists.xenproject.org>
> Subject: Re: [PATCH v2 9/9] viridian: introduce struct viridian_page
> 
> >>> On 31.10.18 at 13:43, <paul.durrant@citrix.com> wrote:
> > The 'vp_assist' page is currently an example of a guest page which needs
> to
> > be kept mapped throughout the life-time of a guest, but there are other
> > such examples in the specifiction [1]. This patch therefore introduces a
> > generic 'viridian_page' type and converts the current
> vp_assist/apic_assist
> > related code to use it. Subsequent patches implementing other
> enlightments
> > can then also make use of it.
> 
> This sounds generic (as in "not synic specific), yet ...
> 

Actually Microsoft lump pretty much all the interrupt enlightenments under the synic section in the spec. so I thought it better to put them all together.

> > --- a/xen/arch/x86/hvm/viridian/synic.c
> > +++ b/xen/arch/x86/hvm/viridian/synic.c
> > @@ -37,14 +37,13 @@ static void dump_vp_assist(const struct vcpu *v)
> >             v, (unsigned long)va->fields.pfn);
> >  }
> >
> > -static void initialize_vp_assist(struct vcpu *v)
> > +static void initialize_guest_page(struct vcpu *v, struct viridian_page
> *vp)
> >  {
> >      struct domain *d = v->domain;
> > -    unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
> > +    unsigned long gmfn = vp->msr.fields.pfn;
> >      struct page_info *page = get_page_from_gfn(d, gmfn, NULL,
> P2M_ALLOC);
> > -    HV_VP_ASSIST_PAGE *ptr;
> >
> > -    ASSERT(!v->arch.hvm.viridian.vp_assist.ptr);
> > +    ASSERT(!vp->ptr);
> >
> >      if ( !page )
> >          goto fail;
> 
> ... you retain the implementation here, when it would now perhaps
> more logically live in viridian.c (again). Is this intentional?
> 

Not really, it's down the patch ordering. I agree it makes more sense to put it under viridian.c now. I'll move it.

> > @@ -221,9 +218,9 @@ void viridian_synic_load_vcpu_ctxt(
> >  {
> >      v->arch.hvm.viridian.vp_assist.msr.raw = ctxt->vp_assist_msr;
> >      if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
> > -        initialize_vp_assist(v);
> > +        initialize_guest_page(v, &v->arch.hvm.viridian.vp_assist);
> >
> > -    v->arch.hvm.viridian.vp_assist.pending = !!ctxt->vp_assist_pending;
> > +    v->arch.hvm.viridian.apic_assist_pending = !!ctxt-
> >apic_assist_pending;
> 
> No need for !! anymore with ...
> 
> > --- a/xen/include/asm-x86/hvm/viridian.h
> > +++ b/xen/include/asm-x86/hvm/viridian.h
> > @@ -88,13 +88,16 @@ union viridian_page_msr
> >      } fields;
> >  };
> >
> > +struct viridian_page
> > +{
> > +    union viridian_page_msr msr;
> > +    void *ptr;
> > +};
> > +
> >  struct viridian_vcpu
> >  {
> > -    struct {
> > -        union viridian_page_msr msr;
> > -        void *ptr;
> > -        bool pending;
> > -    } vp_assist;
> > +    struct viridian_page vp_assist;
> > +    bool apic_assist_pending;
> 
> ... this being (and having been) bool.
> 

True, I'll get rid of that.

  Paul

> Jan
> 


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

      reply	other threads:[~2018-11-05 13:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 12:43 [PATCH v2 0/9] viridian cleanup Paul Durrant
2018-10-31 12:43 ` [PATCH v2 1/9] viridian: move the code into its own sub-directory Paul Durrant
2018-10-31 12:43 ` [PATCH v2 2/9] viridian: remove MSR perf counters Paul Durrant
2018-10-31 12:43 ` [PATCH v2 3/9] viridian: remove comments referencing section number in the spec Paul Durrant
2018-10-31 12:43 ` [PATCH v2 4/9] viridian: remove duplicate union types Paul Durrant
2018-10-31 12:43 ` [PATCH v2 5/9] viridian: separate interrupt related enlightenment implementations Paul Durrant
2018-10-31 15:40   ` Wei Liu
2018-11-05 12:51   ` Jan Beulich
2018-11-05 13:22     ` Paul Durrant
2018-10-31 12:43 ` [PATCH v2 6/9] viridian: separate time " Paul Durrant
2018-10-31 15:43   ` Wei Liu
2018-11-05 12:56   ` Jan Beulich
2018-11-05 13:26     ` Paul Durrant
2018-11-05 13:36       ` Jan Beulich
2018-11-05 13:54         ` Paul Durrant
2018-11-05 14:56           ` Jan Beulich
2018-10-31 12:43 ` [PATCH v2 7/9] viridian: define type for the 'virtual VP assist page' Paul Durrant
2018-10-31 15:45   ` Wei Liu
2018-11-05 12:59   ` Jan Beulich
2018-11-05 13:19     ` Paul Durrant
2018-10-31 12:43 ` [PATCH v2 8/9] tools/misc: fix hard tabs in xen-hvmctx.c Paul Durrant
2018-10-31 14:00   ` Wei Liu
2018-10-31 12:43 ` [PATCH v2 9/9] viridian: introduce struct viridian_page Paul Durrant
2018-10-31 15:50   ` Wei Liu
2018-11-05 13:05   ` Jan Beulich
2018-11-05 13:18     ` Paul Durrant [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab6bf7186cda4a069ff61587c170021c@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).