Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: silvano.dininno@nxp.com (Silvano di Ninno)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: decompressor: Make RAM sections Outer non-cacheable
Date: Wed, 3 Jan 2018 17:32:50 +0100	[thread overview]
Message-ID: <1514997170-31906-2-git-send-email-silvano.dininno@nxp.com> (raw)
In-Reply-To: <1514997170-31906-1-git-send-email-silvano.dininno@nxp.com>

The kernel decompressor is not aware of external caches.
If those caches are enabled (It can be so if Linux runs in
Non-secure world and the secure world OS has enabled them),
it leads to stale data in external caches and coherency
problem when Linux enables them.

This patch makes the RAM sections Outer non-cacheable

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
---
 arch/arm/boot/compressed/head.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 45c8823..1cbba2a 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -775,6 +775,7 @@ __armv7_mmu_cache_on:
 		mrc	p15, 0, r11, c0, c1, 4	@ read ID_MMFR0
 		tst	r11, #0xf		@ VMSA
 		movne	r6, #CB_BITS | 0x02	@ !XN
+		orrne	r6, r6, #4 << 12	@ TEX[2:0] = 100
 		blne	__setup_mmu
 		mov	r0, #0
 		mcr	p15, 0, r0, c7, c10, 4	@ drain write buffer
-- 
2.7.4

      reply	other threads:[~2018-01-03 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 16:32 [RFC] ARM: decompressor: Make RAM sections Outer non-cacheable Silvano di Ninno
2018-01-03 16:32 ` Silvano di Ninno [this message]

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=1514997170-31906-2-git-send-email-silvano.dininno@nxp.com \
    --to=silvano.dininno@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox