Skip to content

Commit

Permalink
arm/xen: implement correctly pfn_to_mfn
Browse files Browse the repository at this point in the history
After the commit introducing convertion between DMA and guest addresses,
all the callers of pfn_to_mfn are expecting to get a GFN (Guest Frame
Number). On ARM, all the guests are auto-translated so the GFN is equal
to the Linux PFN (Pseudo-physical Frame Number).

The current implementation may return an MFN if the caller is passing a
PFN associated to a mapped foreign grant. In pratice, I haven't seen
the problem on running guest but we should fix it for the sake of
correctness.

Correct the implementation by always returning the pfn passed in parameter.

A follow-up patch will take care to rename pfn_to_mfn to a suitable
name.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
Julien Grall committed Sep 8, 2015
1 parent 32e0987 commit 5192b35
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions arch/arm/include/asm/xen/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ extern struct rb_root phys_to_mach;

static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;

if (phys_to_mach.rb_node != NULL) {
mfn = __pfn_to_mfn(pfn);
if (mfn != INVALID_P2M_ENTRY)
return mfn;
}

return pfn;
}

Expand Down

0 comments on commit 5192b35

Please sign in to comment.