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: Mon, 24 Sep 2012 15:43:35 -0700 [thread overview]
Message-ID: <20120924154335.097d3fb9@mantra.us.oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1209241257440.29232@kaball.uk.xensource.com>
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:
> > ---
> > arch/x86/xen/enlighten.c | 99
> > ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 79
> > insertions(+), 20 deletions(-)
> >
> > + "with PVH extensions " : "", pv_info.name);
> > printk(KERN_INFO "Xen version: %d.%d%s%s\n",
> > version >> 16, version & 0xffff, extra.extraversion,
> > xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ?
> > " (preserve-AD)" : ""); @@ -271,12 +278,15 @@ static void
> > xen_cpuid(unsigned int *ax, unsigned int *bx, break;
> > }
> >
> > - asm(XEN_EMULATE_PREFIX "cpuid"
> > - : "=a" (*ax),
> > - "=b" (*bx),
> > - "=c" (*cx),
> > - "=d" (*dx)
> > - : "0" (*ax), "2" (*cx));
> > + if (xen_pvh_domain())
> > + native_cpuid(ax, bx, cx, dx);
> > + else
> > + asm(XEN_EMULATE_PREFIX "cpuid"
> > + : "=a" (*ax),
> > + "=b" (*bx),
> > + "=c" (*cx),
> > + "=d" (*dx)
> > + : "0" (*ax), "2" (*cx));
>
> can't we just set the cpuid pvop to native_cpuid?
We had talked about this a bit at code review. There is some massaging
before and after that goes on, and so we thought we should just leave
it like that.
>
> > *bx &= maskebx;
> > *cx &= maskecx;
> > @@ -1034,6 +1044,10 @@ static int xen_write_msr_safe(unsigned int
> > msr, unsigned low, unsigned high)
> > void xen_setup_shared_info(void)
> > {
> > + /* do later in xen_pvh_guest_init() when extend_brk is
> > properly setup*/
>
> Which one is the function that is going to get called later to do the
> initialization? It cannot be this one because it would still return
> immediately.
xen_pvh_guest_init() just like the comment says :).
>
> > + if (xen_pvh_domain() && xen_initial_domain())
> > + 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().
next prev parent reply other threads:[~2012-09-24 22:43 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 [this message]
2012-09-25 10:03 ` Stefano Stabellini
2012-09-26 1:04 ` Mukesh Rathor
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=20120924154335.097d3fb9@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).