arm64: mm: Fix operands of clz in __flush_dcache_all
PATCH 1/1 arm64: mm: Fix operands of clz in __flush_dcache_all
From: Sukanto Ghosh <[email protected]>
The format of the lower 32-bits of the 64-bit operand to 'dc cisw' is unchanged from ARMv7 architecture and the upper bits are RES0. This implies that the 'way' field of the operand of 'dc cisw' occupies the bit-positions [31 .. (32-A)]. Due to the use of 64-bit extended operands to 'clz', the existing implementation of __flush_dcache_all is incorrectly placing the 'way' field in the bit-positions [63 .. (64-A)].
--- arch/arm64/mm/cache.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/cache.S +1 -1
@@ -52,7 +52,7 @@ loop1: add x2, x2, #4 // add 4 (line length offset) mov x4, #0x3ff and x4, x4, x1, lsr #3 // find maximum number on the way size - clz x5, x4 // find bit position of way size increment + clz w5, w4 // find bit position of way size increment mov x7, #0x7fff and x7, x7, x1, lsr #13 // extract max number of the index size loop2:
Signature · 1 line
1.7.9.5
Catalin Marinas
maintainerPATCH 1/1 arm64: mm: Fix operands of clz in __flush_dcache_all
Quoted 20 lines · Anup Patel
From: Sukanto Ghosh <[email protected]>
The format of the lower 32-bits of the 64-bit operand to 'dc cisw' is unchanged from ARMv7 architecture and the upper bits are RES0. This implies that the 'way' field of the operand of 'dc cisw' occupies the bit-positions [31 .. (32-A)]. Due to the use of 64-bit extended operands to 'clz', the existing implementation of
__flush_dcache_allis incorrectly placing the 'way' field in the bit-positions [63 .. (64-A)].Signed-off-by Sukanto Ghosh <[email protected]>Tested-by Anup Patel <[email protected]>--- arch/arm64/mm/cache.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/cache.S +0
-0
arch/arm64/mm/cache.S loop1: · line 58
Quoted 8 lines
arch/arm64/mm/cache.S +1
-1@@ -52,7 +52,7 @@ loop1: add x2, x2, #4 // add 4 (line length offset) mov x4, #0x3ff and x4, x4, x1, lsr #3 // find maximum number on the way size - clz x5, x4 // find bit position of way size increment + clz w5, w4 // find bit position of way size increment mov x7, #0x7fff and x7, x7, x1, lsr #13 // extract max number of the index size loop2:
Good catch. I'll queue it for 3.10-rc2.
Thanks.
Signature · 1 line
Catalin