From: Lucas Stach <l.stach@pengutronix.de>
To: Rouven Czerwinski <r.czerwinski@pengutronix.de>,
barebox@lists.infradead.org
Subject: Re: [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached
Date: Tue, 20 Apr 2021 11:00:54 +0200 [thread overview]
Message-ID: <0f9c752a785ba605dece06a454b983538d3c6d2c.camel@pengutronix.de> (raw)
In-Reply-To: <20210420075700.246124-7-r.czerwinski@pengutronix.de>
Am Dienstag, dem 20.04.2021 um 09:57 +0200 schrieb Rouven Czerwinski:
> Ensure that reserved map entries with the no-map flag are marked as
> uncached and non-execute during the early MMU initialization.
>
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
> arch/arm/cpu/mmu-early.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
> index b985aa455f..63cf61b2aa 100644
> --- a/arch/arm/cpu/mmu-early.c
> +++ b/arch/arm/cpu/mmu-early.c
> @@ -3,9 +3,11 @@
> #include <errno.h>
> #include <linux/sizes.h>
> #include <asm/memory.h>
> +#include <asm-generic/memory_layout.h>
> #include <asm/system.h>
> #include <asm/cache.h>
> #include <asm-generic/sections.h>
> +#include <pbl.h>
>
>
>
>
> #include "mmu.h"
>
>
>
>
> @@ -24,6 +26,8 @@ static inline void map_region(unsigned long start, unsigned long size,
> void mmu_early_enable(unsigned long membase, unsigned long memsize,
> unsigned long _ttb)
> {
> + struct pbl_reserved_memory* res_mem = get_pbl_reserved_memory();
> + int i;
> ttb = (uint32_t *)_ttb;
>
>
>
>
> arm_set_cache_functions();
> @@ -58,6 +62,14 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize,
> /* maps main memory as cachable */
> map_region(membase, memsize, PMD_SECT_DEF_CACHED);
>
>
>
>
> + for(i=0; i < get_pbl_reserved_memory_num(); i++) {
> + if(res_mem->flag & FDT_RES_MEM_FLAG_NOMAP)
Quite a bit of missing whitespace in the two lines above.
Also the variables at the top of the function don't form a reverse
christmas tree, but that isn't part of the coding style, so I don't
complain about that. ;)
Regards,
Lucas
> + map_region(res_mem->base, res_mem->size,
> + PMD_SECT_DEF_UNCACHED | PMD_SECT_XN);
> + res_mem++;
> + }
> +
> +
> /*
> * With HAB enabled we call into the ROM code later in imx6_hab_get_status().
> * Map the ROM cached which has the effect that the XN bit is not set.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-04-20 9:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
2021-04-20 7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
2021-04-20 8:47 ` Ahmad Fatoum
2021-04-20 7:56 ` [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps Rouven Czerwinski
2021-04-20 9:09 ` Ahmad Fatoum
2021-04-20 7:56 ` [PATCH 4/8] of: add flag to not create resmem DT entries Rouven Czerwinski
2021-04-20 9:22 ` Ahmad Fatoum
2021-04-20 7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
2021-04-20 9:23 ` Ahmad Fatoum
2021-04-20 10:36 ` Ahmad Fatoum
2021-04-20 7:56 ` [PATCH 6/8] pbl: fdt: add support to parse reserved mem Rouven Czerwinski
2021-04-20 10:29 ` Ahmad Fatoum
2021-04-20 7:57 ` [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached Rouven Czerwinski
2021-04-20 9:00 ` Lucas Stach [this message]
2021-04-20 7:57 ` [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading Rouven Czerwinski
2021-04-20 10:33 ` Ahmad Fatoum
2021-04-20 8:45 ` [PATCH 1/8] of: reserve: add xn flag mem entries Ahmad Fatoum
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=0f9c752a785ba605dece06a454b983538d3c6d2c.camel@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=r.czerwinski@pengutronix.de \
/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