From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: julien.grall@linaro.org, tim@xen.org,
Ian Campbell <ian.campbell@citrix.com>,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v3 5/6] xen: arm: ensure that the boot code is <4K in size
Date: Mon, 21 Jul 2014 13:59:59 +0100 [thread overview]
Message-ID: <1405947600-26047-5-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1405947600-26047-1-git-send-email-ian.campbell@citrix.com>
This avoids having to deal with the 1:1 boot mapping crossing a
section or page boundary.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
---
v3: Use GLOBAL()
v2: New patch #5/4
---
xen/arch/arm/arm32/head.S | 2 ++
xen/arch/arm/arm64/head.S | 2 ++
xen/arch/arm/xen.lds.S | 6 ++++++
3 files changed, 10 insertions(+)
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index afb4c6d..14b172f 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -457,6 +457,8 @@ fail: PRINT("- Boot failed -\r\n")
1: wfe
b 1b
+GLOBAL(_end_boot)
+
/* Copy Xen to new location and switch TTBR
* r1:r0 ttbr
* r2 source address
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 4e22374..9497ca1 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -487,6 +487,8 @@ fail: PRINT("- Boot failed -\r\n")
1: wfe
b 1b
+GLOBAL(_end_boot)
+
/* Copy Xen to new location and switch TTBR
* x0 ttbr
* x1 source address
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index be55dad..079e085 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -178,3 +178,9 @@ SECTIONS
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
}
+
+/*
+ * We require that Xen is loaded at a 4K boundary, so this ensures that any
+ * code running on the boot time identity map cannot cross a section boundary.
+ */
+ASSERT( _end_boot - start <= PAGE_SIZE, "Boot code is larger than 4K")
--
1.7.10.4
next prev parent reply other threads:[~2014-07-21 12:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-21 12:58 [PATCH v3 0/6] xen: arm: various improvements to boot time page table handling Ian Campbell
2014-07-21 12:59 ` [PATCH v3 1/6] xen: arm: correct whitespace/comments and use #defines in head.S Ian Campbell
2014-07-21 12:59 ` [PATCH v3 2/6] xen: arm: Handle 4K aligned hypervisor load address Ian Campbell
2014-07-21 13:20 ` Tim Deegan
2014-07-21 13:29 ` Ian Campbell
2014-07-21 13:38 ` Tim Deegan
2014-07-21 13:46 ` Ian Campbell
2014-07-21 14:16 ` Julien Grall
2014-07-21 12:59 ` [PATCH v3 3/6] xen: arm: Do not use level 0 section mappings in boot page tables Ian Campbell
2014-07-21 12:59 ` [PATCH v3 4/6] xen: arm: avoid unnecessary additional " Ian Campbell
2014-07-21 12:59 ` Ian Campbell [this message]
2014-07-21 13:00 ` [PATCH v3 6/6] xen: arm: Correctly use GLOBAL/ENTRY in head.S, avoid .global Ian Campbell
2014-07-21 14:18 ` Julien Grall
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=1405947600-26047-5-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=julien.grall@linaro.org \
--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).