From: Ian Campbell <ian.campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel@lists.xen.org
Subject: [PATCH 10/10] xen: arm: make p2m operations NOPs
Date: Wed, 17 Oct 2012 09:39:17 +0100 [thread overview]
Message-ID: <1350463157-5068-10-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1350463138.2460.19.camel@zakaz.uk.xensource.com>
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.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
arch/arm/include/asm/xen/page.h | 13 ++++++++++---
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 1742023..c6b9096 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -10,7 +10,7 @@
#include <xen/interface/grant_table.h>
#define pfn_to_mfn(pfn) (pfn)
-#define phys_to_machine_mapping_valid (1)
+#define phys_to_machine_mapping_valid(pfn) (1)
#define mfn_to_pfn(mfn) (mfn)
#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
@@ -30,6 +30,8 @@ typedef struct xpaddr {
#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
+#define INVALID_P2M_ENTRY (~0UL)
+
static inline xmaddr_t phys_to_machine(xpaddr_t phys)
{
unsigned offset = phys.paddr & ~PAGE_MASK;
@@ -74,9 +76,14 @@ static inline int m2p_remove_override(struct page *page, bool clear_pte)
return 0;
}
+static inline bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
+{
+ BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
+ return true;
+}
+
static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
{
- BUG();
- return false;
+ return __set_phys_to_machine(pfn, mfn);
}
#endif /* _ASM_ARM_XEN_PAGE_H */
--
1.7.2.5
next prev parent reply other threads:[~2012-10-17 8:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1350463138.2460.19.camel@zakaz.uk.xensource.com>
2012-10-17 8:39 ` [PATCH 01/10] xen: xenbus: quirk uses x86 specific cpuid Ian Campbell
2012-10-17 8:41 ` Ian Campbell
2012-10-17 9:09 ` Jan Beulich
2012-10-17 14:56 ` Konrad Rzeszutek Wilk
2012-10-17 8:39 ` [PATCH 02/10] xen: sysfs: include err.h for PTR_ERR etc Ian Campbell
2012-10-17 16:59 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 03/10] xen: sysfs: fix build warning Ian Campbell
2012-10-17 17:02 ` Stefano Stabellini
2012-10-18 7:32 ` Ian Campbell
2012-10-17 8:39 ` [PATCH 04/10] xen: dbgp: Fix warning when CONFIG_PCI is not enabled Ian Campbell
2012-10-17 9:10 ` Jan Beulich
2012-10-17 17:08 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 05/10] xen: events: pirq_check_eoi_map is X86 specific Ian Campbell
2012-10-17 17:06 ` Stefano Stabellini
2012-10-18 7:29 ` Ian Campbell
2012-10-17 8:39 ` [PATCH 06/10] xen: XENMEM_translate_gpfn_list was remove ages ago and is unused Ian Campbell
2012-10-17 8:39 ` [PATCH 07/10] xen: grant: use xen_pfn_t type for frame_list Ian Campbell
2012-10-17 17:10 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 08/10] xen: balloon: don't include e820.h Ian Campbell
2012-10-17 17:35 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 09/10] xen: balloon: use correct type for frame_list Ian Campbell
2012-10-17 17:28 ` Stefano Stabellini
2012-10-17 17:32 ` Konrad Rzeszutek Wilk
2012-10-18 7:26 ` Ian Campbell
2012-10-17 8:39 ` Ian Campbell [this message]
2012-10-17 17:13 ` [PATCH 10/10] xen: arm: make p2m operations NOPs Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350463157-5068-10-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=stefano.stabellini@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).