From: David Vrabel <david.vrabel@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>,
"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: linux PVH broken in 3.16.0-rc7 (arch_gnttab_map_shared)
Date: Tue, 5 Aug 2014 12:00:12 +0100 [thread overview]
Message-ID: <53E0B93C.9080103@citrix.com> (raw)
In-Reply-To: <20140801164619.1a586561@mantra.us.oracle.com>
On 02/08/14 00:46, Mukesh Rathor wrote:
> Hi,
>
> Not sure if this already got reported, but it appears
>
> commit b7dd0e3
> Author: David Vrabel <david.vrabel@citrix.com>
> Date: Fri Jul 11 16:42:34 2014 +0100
>
> x86/xen: safely map and unmap grant frames when in atomic context
>
> has broken boot of domU PVH. The reason being arch_gnttab_map_shared
> is getting called before gnttab_shared_vm_area gets initialized by
> arch_gnttab_init(). As the comment says,
>
> --->
> /* Call it _before_ __gnttab_init as we need to initialize the
> * * xen_auto_xlat_grant_frames first. */
> core_initcall(xen_pvh_gnttab_setup);
> <---
>
> we can't wait till arch_gnttab_init is called by __gnttab_init().
Does this fix it? I can't test it because the only box I have easily
available for testing is AMD.
David
8<--------------------------------
x86/xen: use vmap() to map grant table pages in PVH guests
Commit b7dd0e350e0b (x86/xen: safely map and unmap grant frames when
in atomic context) causes PVH guests to crash in
arch_gnttab_map_shared() when they attempted to map the pages for the
grant table.
This use of a PV-specific function during the PVH grant table setup is
non-obvious and not needed. The standard vmap() function does the
right thing.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reported-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
arch/x86/xen/grant-table.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c
index ebfa9b2..767c9cb 100644
--- a/arch/x86/xen/grant-table.c
+++ b/arch/x86/xen/grant-table.c
@@ -168,6 +168,7 @@ static int __init xlated_setup_gnttab_pages(void)
{
struct page **pages;
xen_pfn_t *pfns;
+ void *vaddr;
int rc;
unsigned int i;
unsigned long nr_grant_frames = gnttab_max_grant_frames();
@@ -193,21 +194,20 @@ static int __init xlated_setup_gnttab_pages(void)
for (i = 0; i < nr_grant_frames; i++)
pfns[i] = page_to_pfn(pages[i]);
- rc = arch_gnttab_map_shared(pfns, nr_grant_frames, nr_grant_frames,
- &xen_auto_xlat_grant_frames.vaddr);
-
- if (rc) {
+ vaddr = vmap(pages, nr_grant_frames, 0, PAGE_KERNEL);
+ if (!vaddr) {
pr_warn("%s Couldn't map %ld pfns rc:%d\n", __func__,
nr_grant_frames, rc);
free_xenballooned_pages(nr_grant_frames, pages);
kfree(pages);
kfree(pfns);
- return rc;
+ return -ENOMEM;
}
kfree(pages);
xen_auto_xlat_grant_frames.pfn = pfns;
xen_auto_xlat_grant_frames.count = nr_grant_frames;
+ xen_auto_xlat_grant_frames.vaddr = vaddr;
return 0;
}
--
1.7.10.4
next prev parent reply other threads:[~2014-08-05 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 23:46 linux PVH broken in 3.16.0-rc7 (arch_gnttab_map_shared) Mukesh Rathor
2014-08-04 10:33 ` David Vrabel
2014-08-04 14:46 ` Konrad Rzeszutek Wilk
2014-08-05 11:00 ` David Vrabel [this message]
2014-08-06 21:23 ` Mukesh Rathor
2014-08-07 1:44 ` Konrad Rzeszutek Wilk
2014-08-07 9:44 ` David Vrabel
2014-08-07 23:45 ` 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=53E0B93C.9080103@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=boris.ostrovsky@oracle.com \
--cc=mukesh.rathor@oracle.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 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.