From: Julien Grall <julien.grall@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: <ian.campbell@citrix.com>, <stefano.stabellini@eu.citrix.com>,
<linux-kernel@vger.kernel.org>,
Julien Grall <julien.grall@citrix.com>,
Russell King <linux@arm.linux.org.uk>,
<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH v3 1/9] arm/xen: Remove helpers which are PV specific
Date: Fri, 7 Aug 2015 17:34:34 +0100 [thread overview]
Message-ID: <1438965282-19103-2-git-send-email-julien.grall@citrix.com> (raw)
In-Reply-To: <1438965282-19103-1-git-send-email-julien.grall@citrix.com>
ARM guests are always HVM. The current implementation is assuming a 1:1
mapping which is only true for DOM0 and may not be at all in the future.
Furthermore, all the helpers but arbitrary_virt_to_machine are used in
x86 specific code (or only compiled for).
The helper arbitrary_virt_to_machine is only used in PV specific code.
Therefore we should never call the function.
Add a BUG() in this helper and drop all the others.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Changes in v2:
- Typoes
- Add Stefano's acked-by
---
arch/arm/include/asm/xen/page.h | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index 1bee8ca..98b1084 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -54,26 +54,14 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
#define mfn_to_local_pfn(mfn) mfn_to_pfn(mfn)
-static inline xmaddr_t phys_to_machine(xpaddr_t phys)
-{
- unsigned offset = phys.paddr & ~PAGE_MASK;
- return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
-}
-
-static inline xpaddr_t machine_to_phys(xmaddr_t machine)
-{
- unsigned offset = machine.maddr & ~PAGE_MASK;
- return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
-}
/* VIRT <-> MACHINE conversion */
-#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
+/* Only used in PV code. But ARM guests are always HVM. */
static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
{
- /* TODO: assuming it is mapped in the kernel 1:1 */
- return virt_to_machine(vaddr);
+ BUG();
}
/* TODO: this shouldn't be here but it is because the frontend drivers
--
2.1.4
next prev parent reply other threads:[~2015-08-07 16:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 16:34 [PATCH v3 0/9] Use correctly the Xen memory terminologies Julien Grall
2015-08-07 16:34 ` Julien Grall [this message]
2015-08-07 16:34 ` [PATCH v3 2/9] xen: Make clear that swiotlb and biomerge are dealing with DMA address Julien Grall
2015-08-07 16:34 ` [PATCH v3 3/9] arm/xen: implement correctly pfn_to_mfn Julien Grall
2015-08-07 16:34 ` [PATCH v3 4/9] xen: Use correctly the Xen memory terminologies Julien Grall
2015-08-07 16:34 ` [PATCH v3 5/9] xen/tmem: Use xen_page_to_gfn rather than pfn_to_gfn Julien Grall
2015-08-07 16:34 ` [PATCH v3 6/9] video/xen-fbfront: Further s/MFN/GFN clean-up Julien Grall
2015-08-07 16:34 ` [PATCH v3 7/9] hvc/xen: " Julien Grall
2015-08-07 16:34 ` [PATCH v3 8/9] xen/privcmd: Further s/MFN/GFN/ clean-up Julien Grall
2015-08-07 16:34 ` [PATCH v3 9/9] xen/xenbus: Rename the variable xen_store_mfn to xen_store_gfn Julien Grall
2015-08-07 21:33 ` Boris Ostrovsky
2015-08-10 9:59 ` [Xen-devel] " Julien Grall
2015-08-10 10:06 ` Stefano Stabellini
2015-08-11 17:37 ` [Xen-devel] [PATCH v3 0/9] Use correctly the Xen memory terminologies David Vrabel
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=1438965282-19103-2-git-send-email-julien.grall@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.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).