From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
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: Re: [PATCH v2 1/2] xen/mpu: Map early uart when earlyprintk on
Date: Tue, 3 Dec 2024 15:54:05 +0000 [thread overview]
Message-ID: <433175CF-550A-4AF8-9422-5411D0107653@arm.com> (raw)
In-Reply-To: <20241127183906.485824-2-ayan.kumar.halder@amd.com>
Hi Ayan,
sorry for the separate message, I've spotted another thing where I’m in doubt
> On 27 Nov 2024, at 18:39, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
>
> CONFIG_EARLY_UART_SIZE is introduced to let user provide physical size of
> early UART. Unlike MMU where we map a page in the virtual address space,
> here we need to know the exact physical size to be mapped.
> As VA == PA in case of MPU, the memory layout follows exactly the hardware
> configuration. As a consequence, we set EARLY_UART_VIRTUAL_ADDRESS as physical
> address.
>
> EARLY_UART_BASE_ADDRESS and EARLY_UART_SIZE should be aligned to the minimum
> size of MPU region (ie 64 bits) as per the hardware restrictions. Refer ARM
> DDI 0600A.d ID120821 A1.3 "A minimum protection region size of 64 bytes.".
>
> UART is mapped as nGnRE region (as specified by ATTR=100 , refer G1.3.13,
> MAIR_EL2, "---0100 Device memory nGnRE") and Doc ID - 102670_0101_02_en
> Table 4-3, Armv8 architecture memory types (nGnRE - Corresponds to Device in
> Armv7 architecture). Also, it is mapped as outer shareable, RW at EL2 only
> and execution of instructions from the region is not permitted.
>
[...]
> diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
> index f692fc7443..86e4019a0c 100644
> --- a/xen/arch/arm/arm64/mpu/head.S
> +++ b/xen/arch/arm/arm64/mpu/head.S
> @@ -11,8 +11,10 @@
> #define REGION_TEXT_PRBAR 0x38 /* SH=11 AP=10 XN=00 */
> #define REGION_RO_PRBAR 0x3A /* SH=11 AP=10 XN=10 */
> #define REGION_DATA_PRBAR 0x32 /* SH=11 AP=00 XN=10 */
> +#define REGION_DEVICE_PRBAR 0x22 /* SH=10 AP=00 XN=10 */
>
> #define REGION_NORMAL_PRLAR 0x0f /* NS=0 ATTR=111 EN=1 */
> +#define REGION_DEVICE_PRLAR 0x09 /* NS=0 ATTR=100 EN=1 */
Should this point to ATTR=0 instead? From what I see on Zephyr, the pl011 is
mapped with nGnRnE, on R82 this works fine because it will treat all device memory as
nGnRnE, but I’m not sure that this will work well on other Armv8-R aarch64 platforms.
I was trying to check how Linux maps pl011 but I’m kind of lost, so maybe if anyone has
more experience is more than welcome to contribute to the discussion.
Cheers,
Luca
next prev parent reply other threads:[~2024-12-03 15:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 18:39 [PATCH v2 0/2] Enable early bootup of AArch64 MPU systems (Part 2) Ayan Kumar Halder
2024-11-27 18:39 ` [PATCH v2 1/2] xen/mpu: Map early uart when earlyprintk on Ayan Kumar Halder
2024-12-02 20:53 ` Julien Grall
2024-12-03 13:34 ` Ayan Kumar Halder
2024-12-03 13:50 ` Julien Grall
2024-12-03 19:02 ` Ayan Kumar Halder
2024-12-03 10:26 ` Luca Fancellu
2024-12-03 15:54 ` Luca Fancellu [this message]
2024-12-03 16:49 ` Luca Fancellu
2024-11-27 18:39 ` [PATCH v2 2/2] xen/mmu: enable SMMU subsystem only in MMU Ayan Kumar Halder
2024-12-02 20:54 ` 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=433175CF-550A-4AF8-9422-5411D0107653@arm.com \
--to=luca.fancellu@arm.com \
--cc=Bertrand.Marquis@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=ayan.kumar.halder@amd.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.