aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-10-17 04:39:17 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-19 15:17:57 -0400
commitee7b5958e2494619ee3ff52de68580feed6906a2 (patch)
tree03cd4017f59c48d2d33577d1d3ea60ad02518e7d /arch/arm
parentee678518eb386f513ac7fd374f7e8b8792ee79f8 (diff)
xen: arm: make p2m operations NOPs
This makes common code less ifdef-y and is consistent with PVHVM on x86. Also note that phys_to_machine_mapping_valid should take a pfn argument and make it do so. Add __set_phys_to_machine, make set_phys_to_machine a simple wrapper (on systems with non-nop implementations the outer one can allocate new p2m pages). Make __set_phys_to_machine check for identity mapping or invalid only. Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/xen/page.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index 174202318dff..c6b9096cef95 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -10,7 +10,7 @@
10#include <xen/interface/grant_table.h> 10#include <xen/interface/grant_table.h>
11 11
12#define pfn_to_mfn(pfn) (pfn) 12#define pfn_to_mfn(pfn) (pfn)
13#define phys_to_machine_mapping_valid (1) 13#define phys_to_machine_mapping_valid(pfn) (1)
14#define mfn_to_pfn(mfn) (mfn) 14#define mfn_to_pfn(mfn) (mfn)
15#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) 15#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
16 16
@@ -30,6 +30,8 @@ typedef struct xpaddr {
30#define XMADDR(x) ((xmaddr_t) { .maddr = (x) }) 30#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
31#define XPADDR(x) ((xpaddr_t) { .paddr = (x) }) 31#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
32 32
33#define INVALID_P2M_ENTRY (~0UL)
34
33static inline xmaddr_t phys_to_machine(xpaddr_t phys) 35static inline xmaddr_t phys_to_machine(xpaddr_t phys)
34{ 36{
35 unsigned offset = phys.paddr & ~PAGE_MASK; 37 unsigned offset = phys.paddr & ~PAGE_MASK;
@@ -74,9 +76,14 @@ static inline int m2p_remove_override(struct page *page, bool clear_pte)
74 return 0; 76 return 0;
75} 77}
76 78
79static inline bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
80{
81 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
82 return true;
83}
84
77static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn) 85static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
78{ 86{
79 BUG(); 87 return __set_phys_to_machine(pfn, mfn);
80 return false;
81} 88}
82#endif /* _ASM_ARM_XEN_PAGE_H */ 89#endif /* _ASM_ARM_XEN_PAGE_H */