Skip to content

Commit

Permalink
Merge branch 'stable/bug-fixes-rc1' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/konrad/xen

* 'stable/bug-fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: Use new irq_move functions
  xen: Convert genirq namespace
  xen: fix p2m section mismatches
  xen/p2m: Allocate p2m tracking pages on override
  xen-gntdev: unlock on error path in gntdev_mmap()
  xen-gntdev: return -EFAULT on copy_to_user failure
  • Loading branch information
torvalds committed Mar 29, 2011
2 parents d6ae0c6 + e240ae4 commit 90f1e74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static bool alloc_p2m(unsigned long pfn)
return true;
}

bool __early_alloc_p2m(unsigned long pfn)
static bool __init __early_alloc_p2m(unsigned long pfn)
{
unsigned topidx, mididx, idx;

Expand Down Expand Up @@ -530,7 +530,7 @@ bool __early_alloc_p2m(unsigned long pfn)
}
return idx != 0;
}
unsigned long set_phys_range_identity(unsigned long pfn_s,
unsigned long __init set_phys_range_identity(unsigned long pfn_s,
unsigned long pfn_e)
{
unsigned long pfn;
Expand Down Expand Up @@ -671,7 +671,9 @@ int m2p_add_override(unsigned long mfn, struct page *page)
page->private = mfn;
page->index = pfn_to_mfn(pfn);

__set_phys_to_machine(pfn, FOREIGN_FRAME(mfn));
if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
return -ENOMEM;

if (!PageHighMem(page))
/* Just zap old mapping for now */
pte_clear(&init_mm, address, ptep);
Expand Down Expand Up @@ -709,7 +711,7 @@ int m2p_remove_override(struct page *page)
spin_lock_irqsave(&m2p_override_lock, flags);
list_del(&page->lru);
spin_unlock_irqrestore(&m2p_override_lock, flags);
__set_phys_to_machine(pfn, page->index);
set_phys_to_machine(pfn, page->index);

if (!PageHighMem(page))
set_pte_at(&init_mm, address, ptep,
Expand Down
6 changes: 4 additions & 2 deletions drivers/xen/gntdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages)
map->vma->vm_start + map->notify.addr;
err = copy_to_user(tmp, &err, 1);
if (err)
return err;
return -EFAULT;
map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
} else if (pgno >= offset && pgno < offset + pages) {
uint8_t *tmp = kmap(map->pages[pgno]);
Expand Down Expand Up @@ -662,7 +662,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
if (map->flags) {
if ((vma->vm_flags & VM_WRITE) &&
(map->flags & GNTMAP_readonly))
return -EINVAL;
goto out_unlock_put;
} else {
map->flags = GNTMAP_host_map;
if (!(vma->vm_flags & VM_WRITE))
Expand Down Expand Up @@ -700,6 +700,8 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
spin_unlock(&priv->lock);
return err;

out_unlock_put:
spin_unlock(&priv->lock);
out_put_map:
if (use_ptemod)
map->vma = NULL;
Expand Down

0 comments on commit 90f1e74

Please sign in to comment.