All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen
Date: Fri, 19 Jan 2018 15:18:07 +0000	[thread overview]
Message-ID: <20180119151807.duni7w2vgzmmmvho@citrix.com> (raw)
In-Reply-To: <20180119111838.ib45r6zsenom5xrv@MacBook-Pro-de-Roger.local>

On Fri, Jan 19, 2018 at 11:18:38AM +0000, Roger Pau Monné wrote:
> On Thu, Jan 18, 2018 at 06:16:52PM +0000, Wei Liu wrote:
> > diff --git a/xen/common/domain.c b/xen/common/domain.c
> > index 558318e852..189ffac9b1 100644
> > --- a/xen/common/domain.c
> > +++ b/xen/common/domain.c
> > @@ -45,6 +45,7 @@
> >  
> >  #ifdef CONFIG_X86
> >  #include <asm/guest.h>
> > +#include <asm/guest/hypercall.h>
> >  #endif
> >  
> >  /* Linux config option: propageted to domain0 */
> > @@ -1425,6 +1426,15 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
> >          if ( !guest_handle_okay(area.addr.h, 1) )
> >              break;
> >  
> > +#if CONFIG_X86
> > +        if ( pv_shim )
> > +        {
> > +            rc = xen_hypercall_vcpu_op(VCPUOP_register_runstate_memory_area,
> > +                                       vcpuid, &area);
> > +            break;
> > +        }
> > +#endif
> 
> This only fixes VCPUOP_register_runstate_memory_area, but
> VCPUOP_get_runstate_info will still report wrong information. I've

Yes, it appears that we should passthrough that call as well.

> also wondered whether simply returning L0 information is correct. To
> get the exact information the shim should actually return the L0
> information plus whatever time it steals from the guest.
> 

I think that should be mostly correct. The error margin in the shim
should be very small.

> Also, before adding more hooks to do_vcpu_op I would attempt to add a
> pv_shim_do_vcpu_op helper and patch the hypercall table, in order to
> avoid modifying more common code. AFAICT this doesn't require adding
> much compat code to the shim implementation.
> 

Good idea.

I'm going to revisit this idea next week when I have more time. In the
mean time I will repost the fixes patches I have.

Wei.

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

      reply	other threads:[~2018-01-19 15:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 18:16 [PATCH 0/9] Fix and improvements to pvshim Wei Liu
2018-01-18 18:16 ` [PATCH 1/9] Update shim.config Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-18 18:28     ` Wei Liu
2018-01-18 18:30       ` Andrew Cooper
2018-01-19 10:16         ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 2/9] libxl: remove whitespaces introduced in 62982da926 Wei Liu
2018-01-19 10:18   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 3/9] x86/guest: clean up guest/xen.h Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-19 10:21   ` Roger Pau Monné
2018-01-19 12:22     ` Wei Liu
2018-01-19 12:29       ` Roger Pau Monné
2018-01-19 12:34         ` Wei Liu
2018-01-18 18:16 ` [PATCH 4/9] Remove sched=null from shim cmdline and doc Wei Liu
2018-01-18 18:27   ` Andrew Cooper
2018-01-19 10:28   ` Roger Pau Monné
2018-01-19 11:40     ` Wei Liu
2018-01-18 18:16 ` [PATCH 5/9] x86: relocate pvh_info Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-19 10:10   ` Andrew Cooper
2018-01-19 10:20     ` Jan Beulich
2018-01-19 10:53   ` Roger Pau Monné
2018-01-19 11:48     ` Jan Beulich
2018-01-18 18:16 ` [PATCH 6/9] Revert "x86/boot: Map more than the first 16MB" Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-18 18:16 ` [PATCH 7/9] libxl: lower shim related message to level info Wei Liu
2018-01-19 10:57   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 8/9] xen/consoled: discard NUL from guest Wei Liu
2018-01-19 11:03   ` Roger Pau Monné
2018-01-19 15:25     ` Wei Liu
2018-01-18 18:16 ` [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen Wei Liu
2018-01-19 11:18   ` Roger Pau Monné
2018-01-19 15:18     ` Wei Liu [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=20180119151807.duni7w2vgzmmmvho@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony@codemonkey.ws \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.