From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v1 3/8]: PVH startup changes (enlighten.c)
Date: Tue, 25 Sep 2012 18:04:16 -0700 [thread overview]
Message-ID: <20120925180416.0137d61a@mantra.us.oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1209251054140.29232@kaball.uk.xensource.com>
On Tue, 25 Sep 2012 11:03:13 +0100
Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:
> On Mon, 24 Sep 2012, Mukesh Rathor wrote:
> > On Mon, 24 Sep 2012 13:07:19 +0100
> > Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:
> >
> > > On Fri, 21 Sep 2012, Mukesh Rathor wrote:
> > > > + return;
> > > > +
> > > > if (!xen_feature(XENFEAT_auto_translated_physmap)) {
> > > > set_fixmap(FIX_PARAVIRT_BOOTMAP,
> > > > xen_start_info->shared_info);
> > > >
> > > > @@ -1044,6 +1058,10 @@ void xen_setup_shared_info(void)
> > > > HYPERVISOR_shared_info =
> > > > (struct shared_info
> > > > *)__va(xen_start_info->shared_info);
> > > > + /* PVH TBD/FIXME: vcpu info placement in phase 2 */
> > > > + if (xen_pvh_domain())
> > > > + return;
> > >
> > > It seems that if xen_initial_domain we always skip the
> > > initialization while if !xen_initial_domain we only initialize
> > > HYPERVISOR_shared_info. I don't understand why we have this
> > > difference.
> >
> > The comment in xen_pvh_guest_init() explains it. For domU the
> > library maps the pfn at shared_info, ie, shared_info is pfn. For
> > dom0, it's the mfn. Dom0 then allocates a pfn via extend_brk, and
> > maps the mfn to it. This happens in the commond hvm code,
> > xen_hvm_init_shared_info().
>
> This difference is really subtle, it would be nice to get rid of it.
> Could Xen allocate a pfn for dom0?
Not easily.
> Otherwise could we have the tools allocate an mfn instead of a pfn?
> In fact looking at xc_dom_x86.c, alloc_magic_pages is explicitly
> having a different behavior for xc_dom_feature_translated guests and
> allocates pfn instead of an mfn. Maybe we could get rid of that
> special case: less code in libxc, a common way of allocating the
> shared_info page for domU and dom0 => win.
Wish it was simple. But for PV and PVH, domU, it's already setup the
shared page. All we need to do is __va(shared_info). But for HVM domUs
and PVH dom0, we need to hcall with pfn to get it remapped. Changing the
tool to map pfn, would result in unnecessary hcall for all PV and PVH
domUs. It's only two lines of code, so lets just leave it. I'll make the
comment better.
thx,
Mukesh
next prev parent reply other threads:[~2012-09-26 1:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 19:16 [PATCH v1 3/8]: PVH startup changes (enlighten.c) Mukesh Rathor
2012-09-24 12:07 ` Stefano Stabellini
2012-09-24 22:43 ` Mukesh Rathor
2012-09-25 10:03 ` Stefano Stabellini
2012-09-26 1:04 ` Mukesh Rathor [this message]
2012-09-26 11:33 ` Stefano Stabellini
2012-09-26 11:44 ` Ian Campbell
2012-10-03 1:36 ` Mukesh Rathor
2012-10-03 2:03 ` Mukesh Rathor
2012-10-03 11:58 ` Stefano Stabellini
2012-10-03 12:05 ` Ian Campbell
2012-10-03 12:36 ` Stefano Stabellini
2012-10-05 1:35 ` Mukesh Rathor
2012-10-05 9:23 ` Ian Campbell
2012-10-08 12:41 ` Konrad Rzeszutek Wilk
2012-10-09 1:07 ` Mukesh Rathor
2012-10-03 22:37 ` Mukesh Rathor
2012-10-04 8:38 ` Ian Campbell
2012-10-05 1:25 ` Mukesh Rathor
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=20120925180416.0137d61a@mantra.us.oracle.com \
--to=mukesh.rathor@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=konrad.wilk@oracle.com \
--cc=stefano.stabellini@eu.citrix.com \
/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).