From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [Xen-devel] [PATCH v4 4/8] xen/arm32: head: Rework and document setup_fixmap()
Date: Tue, 17 Sep 2019 19:12:40 +0100 [thread overview]
Message-ID: <20190917181244.30027-5-julien.grall@arm.com> (raw)
In-Reply-To: <20190917181244.30027-1-julien.grall@arm.com>
At the moment, the fixmap table is only hooked when earlyprintk is used.
This is fine today because in C land, the fixmap is not used by anyone
until the the boot CPU is switching to the runtime page-tables.
In the future, the boot CPU will not switch between page-tables to
avoid TLB incoherency. Thus, the fixmap table will need to be always
hooked beofre any use. Let's start doing it now in setup_fixmap().
Lastly, document the behavior and the main registers usage within the
function.
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- The unused label is now removed in the previous patch
- Add Stefano's reviewed-by
Changes in v2:
- Patch added
---
xen/arch/arm/arm32/head.S | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 65b7e0d711..f58d0fcb80 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -546,8 +546,21 @@ identity_mapping_removed:
mov pc, lr
ENDPROC(remove_identity_mapping)
+/*
+ * Map the UART in the fixmap (when earlyprintk is used) and hook the
+ * fixmap table in the page tables.
+ *
+ * The fixmap cannot be mapped in create_page_tables because it may
+ * clash with the 1:1 mapping.
+ *
+ * Inputs:
+ * r10: Physical offset
+ * r11: Early UART base physical address
+ *
+ * Clobbers r1 - r4
+ */
setup_fixmap:
-#if defined(CONFIG_EARLY_PRINTK) /* Fixmap is only used by early printk */
+#if defined(CONFIG_EARLY_PRINTK)
/* Add UART to the fixmap table */
ldr r1, =xen_fixmap /* r1 := vaddr (xen_fixmap) */
lsr r2, r11, #THIRD_SHIFT
@@ -556,6 +569,7 @@ setup_fixmap:
orr r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
mov r3, #0x0
strd r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+#endif
/* Map fixmap into boot_second */
ldr r1, =boot_second /* r1 := vaddr (boot_second) */
@@ -570,7 +584,7 @@ setup_fixmap:
/* Ensure any page table updates made above have occurred. */
dsb nshst
-#endif
+
mov pc, lr
ENDPROC(setup_fixmap)
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-09-17 18:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-17 18:12 [Xen-devel] [PATCH v4 0/8] xen/arm: Rework head.S to make it more compliant with the Arm Arm Julien Grall
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 1/8] xen/arm64: head: Remove 1:1 mapping as soon as it is not used Julien Grall
2019-09-25 20:28 ` Stefano Stabellini
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 2/8] xen/arm64: head: Rework and document setup_fixmap() Julien Grall
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 3/8] xen/arm32: head: Remove 1:1 mapping as soon as it is not used Julien Grall
2019-09-25 20:33 ` Stefano Stabellini
2019-09-25 21:29 ` Julien Grall
2019-09-17 18:12 ` Julien Grall [this message]
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 5/8] xen/arm64: head: Introduce macros to create table and mapping entry Julien Grall
2019-09-25 20:14 ` Stefano Stabellini
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 6/8] xen/arm64: head: Use a page mapping for the 1:1 mapping in create_page_tables() Julien Grall
2019-09-26 4:13 ` Stefano Stabellini
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 7/8] xen/arm32: head: Introduce macros to create table and mapping entry Julien Grall
2019-09-25 20:22 ` Stefano Stabellini
2019-09-17 18:12 ` [Xen-devel] [PATCH v4 8/8] xen/arm32: head: Use a page mapping for the 1:1 mapping in create_page_tables() Julien Grall
2019-09-26 4:24 ` Stefano Stabellini
2019-09-26 15:02 ` 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=20190917181244.30027-5-julien.grall@arm.com \
--to=julien.grall@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=sstabellini@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.