From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xen: point xen_start_info to a dummy struct for PV on HVM guests
Date: Wed, 3 Oct 2012 09:43:23 -0400 [thread overview]
Message-ID: <20121003134323.GA31270@phenom.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1210031431080.29232@kaball.uk.xensource.com>
On Wed, Oct 03, 2012 at 02:37:53PM +0100, Stefano Stabellini wrote:
> PV on HVM guests don't have a start_info page mapped by Xen, so
> xen_start_info is just NULL for them.
> That is problem because other parts of the code expect xen_start_info to
> point to something valid, for example xen_initial_domain() is defined as
> follow:
>
> #define xen_initial_domain() (xen_domain() && \
> xen_start_info->flags & SIF_INITDOMAIN)
>
.. introduced by commit 4c071ee5268f7234c3d084b6093bebccc28cdcba
("arm: initial Xen support)
>
> Allocate a dummy start_info struct and point xen_start_info to it, as we
> do on ARM.
> This is not going to change things for PV guests because
> xen_start_info is set by arch/x86/xen/xen-head.S:startup_xen.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index bf788d3..5f242cb 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -96,7 +96,8 @@ EXPORT_SYMBOL(machine_to_phys_mapping);
> unsigned long machine_to_phys_nr;
> EXPORT_SYMBOL(machine_to_phys_nr);
>
> -struct start_info *xen_start_info;
> +static struct start_info _xen_start_info;
And lets change that to
'xen_dummy_start_info' to keep in sync with the other dummy one.
And also add a commnt:
/*
* Since 'xen_initial_domain' dereferences the xen_start_info we need
* a dummy structure filled with zeros (for PVHVM guests which initialize
* this late). For PV guests we do not have to worry about this as the first
* few instructions (startup_xen) set it properly.
*/
> +struct start_info *xen_start_info = &_xen_start_info;
> EXPORT_SYMBOL_GPL(xen_start_info);
>
> struct shared_info xen_dummy_shared_info;
next prev parent reply other threads:[~2012-10-03 13:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 13:37 [PATCH] xen: point xen_start_info to a dummy struct for PV on HVM guests Stefano Stabellini
2012-10-03 13:43 ` Konrad Rzeszutek Wilk [this message]
2012-10-03 15:48 ` Stefano Stabellini
2012-10-03 13:49 ` [Xen-devel] " Ian Campbell
2012-10-03 13:51 ` Stefano Stabellini
2012-10-03 13:54 ` Ian Campbell
2012-10-03 14:11 ` Konrad Rzeszutek Wilk
2012-10-03 15:00 ` Ian Campbell
2012-10-03 15:48 ` Stefano Stabellini
2012-10-03 15:57 ` Ian Campbell
2012-10-03 16:05 ` Stefano Stabellini
2012-10-03 16:13 ` Ian Campbell
2012-10-03 16:41 ` Ian Campbell
2012-10-03 17:06 ` Stefano Stabellini
2012-10-03 17:08 ` [PATCH] xen/xen_initial_domain: check that xen_start_info is initialized Stefano Stabellini
2012-10-04 7:43 ` [Xen-devel] " Jan Beulich
2012-10-04 10:07 ` Stefano Stabellini
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=20121003134323.GA31270@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.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