lkml.org 
[lkml]   [2014]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] xen/grant-table: Avoid m2p_override during mapping
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


\
 
 \ /
  Last update: 2014-01-18 22:21    [W:0.084 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site