From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: "kernelci.org bot" <bot@kernelci.org>,
maz@kernel.org, linus.walleij@linaro.org, linux@armlinux.org.uk,
guillaume.tucker@collabora.com, Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH] ARM: decompressor: clean decompressed kernel from cache twice on v7
Date: Thu, 4 Feb 2021 14:02:09 +0100 [thread overview]
Message-ID: <20210204130209.114928-1-ardb@kernel.org> (raw)
Commit 5a29552af92dbd62 ("ARM: 9052/1: decompressor: cover BSS in cache
clean and reorder with MMU disable on v7") moved cleaning of the kernel
image to after the point where the MMU and caches are disabled, which is
more in line with the architectural requirements. Unfortunately, doing
so caused a regression on Clang builds, crashing before any diagnostic
output is printed.
Given that the full cleaning the cache afterwards is required in any
case, let's reinstate the original cache clean of just the decompressed
image occurring beforehand, amounting to a partial revert of the commit
in question. Doing so has been confirmed by the reporter of the
regression to mitigate it.
Fixes: 5a29552af92dbd62 ("ARM: 9052/1: decompressor: cover BSS in ...")
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/arm/boot/compressed/head.S | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 5c97d341de6b..4e49ac64bf49 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -616,14 +616,18 @@ not_relocated: mov r0, #0
@ operations on the range [R0, R1], making this prior call to
@ cache_clean_flush() redundant. In other cases, the clean is
@ performed by set/way and R0/R1 are ignored.
+ @ However, not performing the redundant cache clean before
+ @ turning the MMU and caches off has been observed to cause
+ @ regressions, so on v7+ systems, the decompressed kernel image
+ @ is cleaned twice.
@
- mov r0, #0
- mov r1, #0
+ get_inflated_image_size r6, r2, r3
+ mov r0, r4 @ start of decompressed kernel
+ add r1, r0, r6 @ end of decompressed kernel
bl cache_clean_flush
- get_inflated_image_size r1, r2, r3
ldr r2, =_kernel_bss_size
- add r1, r1, r2
+ add r1, r2, r6
mov r0, r4 @ start of decompressed kernel
add r1, r1, r0 @ end of kernel BSS
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-02-04 13:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 13:02 Ard Biesheuvel [this message]
2021-02-05 8:53 ` [PATCH] ARM: decompressor: clean decompressed kernel from cache twice on v7 Ard Biesheuvel
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=20210204130209.114928-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=bot@kernelci.org \
--cc=guillaume.tucker@collabora.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=maz@kernel.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;
as well as URLs for NNTP newsgroup(s).