From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] ARM: cache: introduce weak arm_setup_identity_mapping
Date: Mon, 19 Nov 2012 15:48:53 -0500 [thread overview]
Message-ID: <20121119204853.GF9467@oliver-linux> (raw)
In-Reply-To: <1353337174-9858-2-git-send-email-v-stehle@ti.com>
On Mon, Nov 19, 2012 at 03:59:33PM +0100, Vincent Stehl? wrote:
> Separate the MMU identity mapping for ARM in a weak function, to allow
> redefinition with platform specific function.
>
> This is motivated by the need to unmap the region near address zero on HS OMAP
> devices, to avoid speculative accesses. Accessing this region causes security
> violations, which we want to avoid.
>
> Signed-off-by: Vincent Stehl? <v-stehle@ti.com>
> ---
> arch/arm/lib/cache-cp15.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
> index 939de10..886fe5c 100644
> --- a/arch/arm/lib/cache-cp15.c
> +++ b/arch/arm/lib/cache-cp15.c
> @@ -40,6 +40,17 @@ void __arm_init_before_mmu(void)
> void arm_init_before_mmu(void)
> __attribute__((weak, alias("__arm_init_before_mmu")));
>
> +void __arm_setup_identity_mapping(u32 *page_table)
> +{
> + int i;
> +
> + /* Set up an identity-mapping for all 4GB, rw for everyone */
> + for (i = 0; i < 4096; i++)
> + page_table[i] = i << 20 | (3 << 10) | 0x12;
> +}
> +void arm_setup_identity_mapping(u32 *page_table)
> + __attribute__((weak, alias("__arm_setup_identity_mapping")));
Please use __weak as found in <linux/compiler.h>, thanks.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121119/e348272a/attachment.pgp>
next prev parent reply other threads:[~2012-11-19 20:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 13:36 [U-Boot] [RFC, PATCH] omap: Invalidate first page to avoid speculation Vincent Stehlé
2012-11-16 20:52 ` Albert ARIBAUD
2012-11-19 14:59 ` [U-Boot] [RFC, PATCH v2] " Vincent Stehlé
2012-11-19 14:59 ` [U-Boot] [PATCH 1/2] ARM: cache: introduce weak arm_setup_identity_mapping Vincent Stehlé
2012-11-19 20:48 ` Tom Rini [this message]
2012-11-19 14:59 ` [U-Boot] [PATCH 2/2] ARM: OMAP5: redefine arm_setup_identity_mapping Vincent Stehlé
2012-11-19 20:49 ` Tom Rini
2012-11-20 11:01 ` [U-Boot] [RFC, PATCH v3] omap: Invalidate first page to avoid speculation Vincent Stehlé
2012-11-20 11:01 ` [U-Boot] [PATCH 1/2] ARM: cache: introduce weak arm_setup_identity_mapping Vincent Stehlé
2012-11-20 11:01 ` [U-Boot] [PATCH 2/2] ARM: OMAP5: redefine arm_setup_identity_mapping Vincent Stehlé
2012-12-11 15:35 ` [U-Boot] [PATCH v2] " Vincent Stehlé
2012-12-11 15:43 ` Tom Rini
2012-12-11 16:06 ` Vincent Stehlé
2012-12-11 16:06 ` [U-Boot] [PATCH v3 1/2] ARM: cache: introduce weak arm_setup_identity_mapping Vincent Stehlé
2012-12-11 16:06 ` [U-Boot] [PATCH v3 2/2] ARM: OMAP5: redefine arm_setup_identity_mapping Vincent Stehlé
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=20121119204853.GF9467@oliver-linux \
--to=trini@ti.com \
--cc=u-boot@lists.denx.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 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.