ARM: decompressor: clean decompressed kernel from cache twice on v7
PATCH 1/1 ARM: decompressor: clean decompressed kernel from cache twice on v7
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.
--- arch/arm/boot/compressed/head.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm/boot/compressed/head.S +8 -4
@@ -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
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 14 lines · Ard Biesheuvel
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.
Quoted 3 lines
Fixes 5a29552af92dbd62 ("ARM: 9052/1: decompressor: cover BSS in ...")Reported-by "kernelci.org bot" <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>
Please disregard this patch - this turns out to be an interoperability issue with LLVM ld.lld
Quoted 32 lines
--- arch/arm/boot/compressed/head.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)arch/arm/boot/compressed/head.S +8
-5@@ -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 --
Quoted 2 lines
2.20.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel