Skip to content

Commit

Permalink
Merge branch 'stable/gntdev' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/konrad/xen

* 'stable/gntdev' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/p2m: Fix module linking error.
  xen p2m: clear the old pte when adding a page to m2p_override
  xen gntdev: use gnttab_map_refs and gnttab_unmap_refs
  xen: introduce gnttab_map_refs and gnttab_unmap_refs
  xen p2m: transparently change the p2m mappings in the m2p override
  xen/gntdev: Fix circular locking dependency
  xen/gntdev: stop using "token" argument
  xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
  xen: add m2p override mechanism
  xen: move p2m handling to separate file
  xen/gntdev: add VM_PFNMAP to vma
  xen/gntdev: allow usermode to map granted pages
  xen: define gnttab_set_map_op/unmap_op

Fix up trivial conflict in drivers/xen/Kconfig
  • Loading branch information
torvalds committed Jan 14, 2011
2 parents 2c0076d + e1b478e commit 9c4bc1c
Show file tree
Hide file tree
Showing 10 changed files with 1,408 additions and 371 deletions.
16 changes: 13 additions & 3 deletions arch/x86/include/asm/xen/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ extern unsigned int machine_to_phys_order;
extern unsigned long get_phys_to_machine(unsigned long pfn);
extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn);

extern int m2p_add_override(unsigned long mfn, struct page *page);
extern int m2p_remove_override(struct page *page);
extern struct page *m2p_find_override(unsigned long mfn);
extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);

static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;
Expand Down Expand Up @@ -72,9 +77,6 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
if (xen_feature(XENFEAT_auto_translated_physmap))
return mfn;

if (unlikely((mfn >> machine_to_phys_order) != 0))
return ~0;

pfn = 0;
/*
* The array access can fail (e.g., device space beyond end of RAM).
Expand All @@ -83,6 +85,14 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
*/
__get_user(pfn, &machine_to_phys_mapping[mfn]);

/*
* If this appears to be a foreign mfn (because the pfn
* doesn't map back to the mfn), then check the local override
* table to see if there's a better pfn to use.
*/
if (get_phys_to_machine(pfn) != mfn)
pfn = m2p_find_override_pfn(mfn, pfn);

return pfn;
}

Expand Down
3 changes: 2 additions & 1 deletion arch/x86/xen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ CFLAGS_mmu.o := $(nostackp)

obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
time.o xen-asm.o xen-asm_$(BITS).o \
grant-table.o suspend.o platform-pci-unplug.o
grant-table.o suspend.o platform-pci-unplug.o \
p2m.o

obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
Expand Down
Loading

0 comments on commit 9c4bc1c

Please sign in to comment.