From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v3 1/5] xen/arm32: Move MM specific registers to enable_mmu
Date: Sun, 30 Mar 2025 19:03:04 +0100 [thread overview]
Message-ID: <20250330180308.2551195-2-ayan.kumar.halder@amd.com> (raw)
In-Reply-To: <20250330180308.2551195-1-ayan.kumar.halder@amd.com>
All the memory management specific registers are initialized in enable_mmu.
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes from -
v1 - HTCR and HMAIR{0,1} are not set together with the other memory management
registers in enable_mmu()
Similar changes are to be done in arm64 as well. I prefer to do that in a
separate patch so that all the arm32 changes are kept together in this series.
v2 - Added Michal's R-b.
xen/arch/arm/arm32/head.S | 14 --------------
xen/arch/arm/arm32/mmu/head.S | 15 +++++++++++++++
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 4ff5c220bc..50da179f81 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -218,20 +218,6 @@ cpu_init:
add pc, r1, r10 /* Call paddr(init func) */
cpu_init_done:
- /* Set up memory attribute type tables */
- mov_w r0, MAIR0VAL
- mov_w r1, MAIR1VAL
- mcr CP32(r0, HMAIR0)
- mcr CP32(r1, HMAIR1)
-
- /*
- * Set up the HTCR:
- * PT walks use Inner-Shareable accesses,
- * PT walks are write-back, write-allocate in both cache levels,
- * Full 32-bit address space goes through this table.
- */
- mov_w r0, (TCR_RES1|TCR_SH0_IS|TCR_ORGN0_WBWA|TCR_IRGN0_WBWA|TCR_T0SZ(0))
- mcr CP32(r0, HTCR)
mov_w r0, HSCTLR_SET
mcr CP32(r0, HSCTLR)
diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
index 1e2bbf0c82..8fa74bd556 100644
--- a/xen/arch/arm/arm32/mmu/head.S
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -279,6 +279,21 @@ ENDPROC(create_page_tables)
enable_mmu:
PRINT("- Turning on paging -\r\n")
+ /* Set up memory attribute type tables */
+ mov_w r0, MAIR0VAL
+ mov_w r1, MAIR1VAL
+ mcr CP32(r0, HMAIR0)
+ mcr CP32(r1, HMAIR1)
+
+ /*
+ * Set up the HTCR:
+ * PT walks use Inner-Shareable accesses,
+ * PT walks are write-back, write-allocate in both cache levels,
+ * Full 32-bit address space goes through this table.
+ */
+ mov_w r0, (TCR_RES1|TCR_SH0_IS|TCR_ORGN0_WBWA|TCR_IRGN0_WBWA|TCR_T0SZ(0))
+ mcr CP32(r0, HTCR)
+
/*
* The state of the TLBs is unknown before turning on the MMU.
* Flush them to avoid stale one.
--
2.25.1
next prev parent reply other threads:[~2025-03-30 18:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-30 18:03 [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Ayan Kumar Halder
2025-03-30 18:03 ` Ayan Kumar Halder [this message]
2025-03-30 18:03 ` [PATCH v3 2/5] xen/arm: Move some of the functions to common file Ayan Kumar Halder
2025-03-30 21:06 ` Julien Grall
2025-03-31 8:28 ` Orzel, Michal
2025-03-31 12:38 ` Ayan Kumar Halder
2025-03-31 13:04 ` Julien Grall
2025-03-30 18:03 ` [PATCH v3 3/5] xen/arm32: Create the same boot-time MPU regions as arm64 Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 4/5] xen/arm32: Allow ARM_PA_BITS_40 only if !MPU Ayan Kumar Halder
2025-03-30 21:07 ` Julien Grall
2025-03-30 18:03 ` [PATCH v3 5/5] xen/arm32: mpu: Stubs to build MPU for arm32 Ayan Kumar Halder
2025-03-30 21:11 ` Julien Grall
2025-04-03 16:35 ` Ayan Kumar Halder
2025-03-31 10:13 ` [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Orzel, Michal
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=20250330180308.2551195-2-ayan.kumar.halder@amd.com \
--to=ayan.kumar.halder@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.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.