[PATCH] lib/raid6: align AVX512 constants to 512 bits, not bytes

From: Denys Vlasenko
Date: Sat Aug 12 2017 - 13:44:08 EST


Signed-off-by: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: mingo@xxxxxxxxxx
Cc: Jim Kukunas <james.t.kukunas@xxxxxxxxxxxxxxx>
Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>
Cc: Megha Dey <megha.dey@xxxxxxxxxxxxxxx>
Cc: Gayatri Kammela <gayatri.kammela@xxxxxxxxx>
Cc: Shaohua Li <shli@xxxxxx>
Cc: x86@xxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
avx512.o before:
Sections:
Idx Name Size VMA LMA File off Algn
4 .rodata 00000240 0000000000000000 0000000000000000 00000c00 2**9
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
...
Contents of section .rodata:
0000 00000000 00000000 00000000 00000000 ................
0010 00000000 00000000 00000000 00000000 ................
0020 01000000 00000000 00000000 00000000 ................
0030 00000000 00000000 00000000 00000000 ................
0040 00000000 00000000 00000000 00000000 ................
0050 00000000 00000000 00000000 00000000 ................
0060 01000000 00000000 00000000 00000000 ................
0070 00000000 00000000 00000000 00000000 ................
0080 00000000 00000000 00000000 00000000 ................
0090 00000000 00000000 00000000 00000000 ................
00a0 01000000 00000000 00000000 00000000 ................
00b0 00000000 00000000 00000000 00000000 ................
00c0 00000000 00000000 00000000 00000000 ................
00d0 00000000 00000000 00000000 00000000 ................
00e0 00000000 00000000 00000000 00000000 ................
00f0 00000000 00000000 00000000 00000000 ................
0100 00000000 00000000 00000000 00000000 ................
0110 00000000 00000000 00000000 00000000 ................
0120 00000000 00000000 00000000 00000000 ................
0130 00000000 00000000 00000000 00000000 ................
0140 00000000 00000000 00000000 00000000 ................
0150 00000000 00000000 00000000 00000000 ................
0160 00000000 00000000 00000000 00000000 ................
0170 00000000 00000000 00000000 00000000 ................
0180 00000000 00000000 00000000 00000000 ................
0190 00000000 00000000 00000000 00000000 ................
01a0 00000000 00000000 00000000 00000000 ................
01b0 00000000 00000000 00000000 00000000 ................
01c0 00000000 00000000 00000000 00000000 ................
01d0 00000000 00000000 00000000 00000000 ................
01e0 00000000 00000000 00000000 00000000 ................
01f0 00000000 00000000 00000000 00000000 ................
0200 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
0210 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
0220 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
0230 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................

avx512.o after:
Sections:
Idx Name Size VMA LMA File off Algn
4 .rodata 00000100 0000000000000000 0000000000000000 00000b40 2**6
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
...
Contents of section .rodata:
0000 00000000 00000000 00000000 00000000 ................
0010 00000000 00000000 00000000 00000000 ................
0020 01000000 00000000 00000000 00000000 ................
0030 00000000 00000000 00000000 00000000 ................
0040 00000000 00000000 00000000 00000000 ................
0050 00000000 00000000 00000000 00000000 ................
0060 01000000 00000000 00000000 00000000 ................
0070 00000000 00000000 00000000 00000000 ................
0080 00000000 00000000 00000000 00000000 ................
0090 00000000 00000000 00000000 00000000 ................
00a0 01000000 00000000 00000000 00000000 ................
00b0 00000000 00000000 00000000 00000000 ................
00c0 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
00d0 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
00e0 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................
00f0 1d1d1d1d 1d1d1d1d 1d1d1d1d 1d1d1d1d ................


lib/raid6/avx512.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/raid6/avx512.c b/lib/raid6/avx512.c
index f524a79..46df797 100644
--- a/lib/raid6/avx512.c
+++ b/lib/raid6/avx512.c
@@ -29,7 +29,7 @@

static const struct raid6_avx512_constants {
u64 x1d[8];
-} raid6_avx512_constants __aligned(512) = {
+} raid6_avx512_constants __aligned(512/8) = {
{ 0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL,
0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL,
0x1d1d1d1d1d1d1d1dULL, 0x1d1d1d1d1d1d1d1dULL,
--
2.9.2