From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: julien.grall@citrix.com, tim@xen.org,
Ian Campbell <ian.campbell@citrix.com>,
stefano.stabellini@eu.citrix.com
Subject: [PATCH 04/10] xen: arm: refactor create_mappings
Date: Tue, 18 Jun 2013 14:26:51 +0100 [thread overview]
Message-ID: <1371562017-5379-4-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1371562002.22783.25.camel@zakaz.uk.xensource.com>
Allow it to work on contiguous second level tables mapping an arbitrary region
of memory. Rename it to create_32mb_mappings.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/mm.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d57e44e..0698c75 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -511,20 +511,23 @@ void __cpuinit mmu_init_secondary_cpu(void)
}
/* Create Xen's mappings of memory.
- * Base and virt must be 32MB aligned and size a multiple of 32MB. */
-static void __init create_mappings(unsigned long virt,
- unsigned long base_mfn,
- unsigned long nr_mfns)
+ * Base and virt must be 32MB aligned and size a multiple of 32MB.
+ * second must be a contiguous set of second level page tables
+ * covering the region starting at virt_offset. */
+static void __init create_32mb_mappings(lpae_t *second,
+ unsigned long virt_offset,
+ unsigned long base_mfn,
+ unsigned long nr_mfns)
{
unsigned long i, count;
lpae_t pte, *p;
- ASSERT(!((virt >> PAGE_SHIFT) % (16 * LPAE_ENTRIES)));
+ ASSERT(!((virt_offset >> PAGE_SHIFT) % (16 * LPAE_ENTRIES)));
ASSERT(!(base_mfn % (16 * LPAE_ENTRIES)));
ASSERT(!(nr_mfns % (16 * LPAE_ENTRIES)));
count = nr_mfns / LPAE_ENTRIES;
- p = xen_second + second_linear_offset(virt);
+ p = second + second_linear_offset(virt_offset);
pte = mfn_to_xen_entry(base_mfn);
pte.pt.contig = 1; /* These maps are in 16-entry contiguous chunks. */
for ( i = 0; i < count; i++ )
@@ -539,7 +542,7 @@ static void __init create_mappings(unsigned long virt,
void __init setup_xenheap_mappings(unsigned long base_mfn,
unsigned long nr_mfns)
{
- create_mappings(XENHEAP_VIRT_START, base_mfn, nr_mfns);
+ create_32mb_mappings(xen_second, XENHEAP_VIRT_START, base_mfn, nr_mfns);
/* Record where the xenheap is, for translation routines. */
xenheap_virt_end = XENHEAP_VIRT_START + nr_mfns * PAGE_SIZE;
@@ -559,7 +562,7 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
/* Round up to 32M boundary */
frametable_size = (frametable_size + 0x1ffffff) & ~0x1ffffff;
base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 32<<(20-12));
- create_mappings(FRAMETABLE_VIRT_START, base_mfn, frametable_size >> PAGE_SHIFT);
+ create_32mb_mappings(xen_second, FRAMETABLE_VIRT_START, base_mfn, frametable_size >> PAGE_SHIFT);
memset(&frame_table[0], 0, nr_pages * sizeof(struct page_info));
memset(&frame_table[nr_pages], -1,
--
1.7.2.5
next prev parent reply other threads:[~2013-06-18 13:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 13:26 [PATCH 00/10] xen: arm: direct 1:1 map on 64 bit Ian Campbell
2013-06-18 13:26 ` [PATCH 01/10] xen: arm: Use _AC macros in config.h Ian Campbell
2013-06-20 16:29 ` Stefano Stabellini
2013-06-18 13:26 ` [PATCH 02/10] xen: arm: Add zeroeth level page table macros and defines Ian Campbell
2013-06-18 13:26 ` [PATCH 03/10] xen: arm: Rename page table "hint" field to slightly more descriptive "contig" Ian Campbell
2013-06-20 16:29 ` Stefano Stabellini
2013-06-18 13:26 ` Ian Campbell [this message]
2013-06-20 16:40 ` [PATCH 04/10] xen: arm: refactor create_mappings Stefano Stabellini
2013-06-18 13:26 ` [PATCH 05/10] xen: arm: define a macro to get this CPUs page table root Ian Campbell
2013-06-20 16:30 ` Stefano Stabellini
2013-06-25 10:49 ` Ian Campbell
2013-06-18 13:26 ` [PATCH 06/10] xen: arm: Add a pte_of_xenaddr helper Ian Campbell
2013-06-20 16:32 ` Stefano Stabellini
2013-06-25 10:50 ` Ian Campbell
2013-06-26 18:21 ` Stefano Stabellini
2013-06-18 13:26 ` [PATCH 07/10] xen: arm: fix is_xen_fixed_mfn Ian Campbell
2013-06-20 16:33 ` Stefano Stabellini
2013-06-18 13:26 ` [PATCH 08/10] xen: arm: allow virt_to_maddr to take either a pointer or an integer Ian Campbell
2013-06-20 16:34 ` Stefano Stabellini
2013-06-18 13:26 ` [PATCH 09/10] xen: gate split heap code on its own config option rather than !X86 Ian Campbell
2013-06-18 16:01 ` Jan Beulich
2013-06-20 16:35 ` Stefano Stabellini
2013-06-18 13:26 ` [PATCH 10/10] xen: arm: Use a direct mapping of RAM on arm64 Ian Campbell
2013-06-18 14:05 ` Julien Grall
2013-06-18 14:13 ` Ian Campbell
2013-06-20 16:43 ` Stefano Stabellini
2013-07-22 22:23 ` Ian Campbell
2013-06-21 14:10 ` Stefano Stabellini
2013-06-25 11:04 ` Ian Campbell
2013-06-26 18:32 ` Stefano Stabellini
2013-06-27 8:41 ` Ian Campbell
2013-06-25 15:39 ` Julien Grall
2013-06-26 11:22 ` Ian Campbell
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=1371562017-5379-4-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--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).