Skip to contentSkip to conversation

ARM: non-sec: flush code cacheline aligned

PATCH In review Stefan Agner 3 participants 3 messages Aug 3, 2016 – Aug 12, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: non-sec: flush code cacheline aligned

From: Stefan Agner <[email protected]>

Flush operations need to be cacheline aligned to take effect, make sure to flush always complete cachelines. This avoids messages such as:
CACHE: Misaligned operation at range [00900000, 009004d9]

---

 arch/arm/cpu/armv7/virt-v7.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/virt-v7.c +3 -1
index 9c53306..d33e5c6 100644
@@ -54,10 +54,12 @@ static void relocate_secure_section(void)
 {
 #ifdef CONFIG_ARMV7_SECURE_BASE
 	size_t sz = __secure_end - __secure_start;
+	unsigned long szflush = ALIGN(sz + 1, CONFIG_SYS_CACHELINE_SIZE);
 
 	memcpy((void *)CONFIG_ARMV7_SECURE_BASE, __secure_start, sz);
+
 	flush_dcache_range(CONFIG_ARMV7_SECURE_BASE,
-			   CONFIG_ARMV7_SECURE_BASE + sz + 1);
+			   CONFIG_ARMV7_SECURE_BASE + szflush);
 	protect_secure_section();
 	invalidate_icache_all();
 #endif
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/1 ARM: non-sec: flush code cacheline aligned

Hi Stefan,

Quoted 8 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Flush operations need to be cacheline aligned to take effect, make sure to flush always complete cachelines. This avoids messages such as:
CACHE: Misaligned operation at range [00900000, 009004d9]

This fixes the cache warnings:

Thanks

#2 lore raw
In reply to Stefan Agner
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Flush operations need to be cacheline aligned to take effect, make sure to flush always complete cachelines. This avoids messages such as:
CACHE: Misaligned operation at range [00900000, 009004d9]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160812/65049d53/attachment.sig>