From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"David Vrabel" <david.vrabel@citrix.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Ian Campbell" <Ian.Campbell@citrix.com>
Cc: Zoltan Kiss <zoltan.kiss@citrix.com>
Subject: Re: [PATCH v2 1/2] xen/grant-table: Avoid m2p_override during mapping
Date: Sat, 18 Jan 2014 21:01:37 +0000 [thread overview]
Message-ID: <52DAEBB1.2050405@citrix.com> (raw)
In-Reply-To: <1389640119-7936-2-git-send-email-zoltan.kiss@citrix.com>
On 13/01/14 19:08, Zoltan Kiss wrote:
> @@ -284,8 +287,37 @@ static int map_grant_pages(struct grant_map *map)
> }
>
> pr_debug("map %d+%d\n", map->index, map->count);
> - err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL,
> - map->pages, map->count);
> + err = gnttab_map_refs(map->map_ops, NULL, map->pages, map->count);
> + if (err)
> + return err;
> +
> + if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> + arch_enter_lazy_mmu_mode();
> + lazy = true;
> + }
> +
> + for (i = 0; i < map->count; i++) {
> + /* Do not add to override if the map failed. */
> + if (map->map_ops[i].status)
> + continue;
> +
> + if (map->map_ops[i].flags & GNTMAP_contains_pte) {
> + pte = (pte_t *) (mfn_to_virt(PFN_DOWN(map->map_ops[i].host_addr)) +
> + (map->map_ops[i].host_addr & ~PAGE_MASK));
> + mfn = pte_mfn(*pte);
> + } else {
> + mfn = PFN_DOWN(map->map_ops[i].dev_bus_addr);
> + }
> + err = m2p_add_override(mfn,
> + map->pages[i],
> + use_ptemod ? &map->kmap_ops[i] : NULL);
> + if (err)
> + break;
> + }
> +
> + if (lazy)
> + arch_leave_lazy_mmu_mode();
> +
> if (err)
> return err;
>
>
This patch has a fundamental problem here: we change the pfn in
gnttab_map_refs, then fetch it in m2p_override again, but then we have a
different one than we need. This causes Dom0 crash. I will send a new
version to fix that.
Zoli
next prev parent reply other threads:[~2014-01-18 21:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 19:08 [PATCH v2 0/2] xen/grant-table: Avoid m2p_override during mapping Zoltan Kiss
2014-01-13 19:08 ` [PATCH v2 1/2] " Zoltan Kiss
2014-01-13 19:08 ` Zoltan Kiss
2014-01-16 16:18 ` Stefano Stabellini
2014-01-16 16:18 ` [Xen-devel] " Stefano Stabellini
2014-01-18 21:01 ` Zoltan Kiss
2014-01-18 21:01 ` Zoltan Kiss [this message]
2014-01-13 19:08 ` [PATCH v2 2/2] xen/grant-table: Remove kmap_ops Zoltan Kiss
2014-01-13 19:08 ` Zoltan Kiss
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=52DAEBB1.2050405@citrix.com \
--to=zoltan.kiss@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=hpa@zytor.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roger.pau@citrix.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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 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.