xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel <xen-devel@lists.xen.org>,
	"David Vrabel" <david.vrabel@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: RFC: very initial PVH design document
Date: Fri, 12 Sep 2014 14:25:05 -0700	[thread overview]
Message-ID: <20140912142505.0b8a65bc@mantra.us.oracle.com> (raw)
In-Reply-To: <20140912203820.GA25403@laptop.dumpdata.com>

On Fri, 12 Sep 2014 16:38:20 -0400
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

> > ## SMP discover and bring up ##
> > 
> > The process of bringing up secondary CPUs is obviously different
> > from native, since PVH doesn't have a local APIC. The first thing
> > to do is to figure out how many vCPUs the guest has. This is done
> > using the `VCPUOP_is_up` hypercall, using for example this simple
> > loop:
> > 
> >     for (i = 0; i < MAXCPU; i++) {
> >         ret = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
> >         if (ret >= 0)
> >             /* vCPU#i is present */
> >     }
> > 
> > Note than when running as Dom0, the ACPI tables might report a
> > different number of available CPUs. This is because the value on
> > the ACPI tables is the number of physical CPUs the host has, and it
> > might bear no resemblance with the number of vCPUs Dom0 actually
> > has so it should be ignored.
> > 
> > In order to bring up the secondary vCPUs they must be configured
> > first. This is achieved using the `VCPUOP_initialise` hypercall. A
> > valid context has to be passed to the vCPU in order to boot. The
> > relevant fields for PVH guests are the following:
> > 
> >   * `flags`: contains VGCF_* flags (see `arch-x86/xen.h` public
> > header).
> >   * `user_regs`: struct that contains the register values that will
> > be set on the vCPU before booting. The most relevant ones are `rip`
> > and `rsp` in order to set the start address and the stack.
> 
> The OS can use 'rdi' and 'rsi' for their own purpose.
> 
> [Any other ones that are free to be used?]
> 

They are all. So, I would phrase it as:


`user_regs`: struct that contains the register values that will
       be set on the vCPU before booting. All GPRs are available to
       be set, however, the most relevant ones are `rip` and `rsp` in 
       order to set the start address and the stack.  Please note, all 
       selectors must be null.


In retrospect, maybe I should have tried harder to create a union
here, or even a new subcall for pvh, VCPUOP_initialise_pvh with
it's own struct.  Anyways... 

thanks,
Mukesh

      reply	other threads:[~2014-09-12 21:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 14:55 RFC: very initial PVH design document Roger Pau Monné
2014-08-22 15:13 ` Jan Beulich
2014-08-22 15:49   ` Roger Pau Monné
2014-08-27  0:33 ` Mukesh Rathor
2014-08-27 20:45   ` Konrad Rzeszutek Wilk
2014-08-27 22:38     ` Mukesh Rathor
2014-08-29 15:09       ` Konrad Rzeszutek Wilk
2014-09-16  9:36   ` Roger Pau Monné
2014-09-12 20:38 ` Konrad Rzeszutek Wilk
2014-09-12 21:25   ` Mukesh Rathor [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=20140912142505.0b8a65bc@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.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).