Commit f4329f2e authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64s: Reduce exception alignment

Exception handlers are aligned to 128 bytes (L1 cache) on 64s, which is
overkill. It can reduce the icache footprint of any individual exception
path. However taken as a whole, the expansion in icache footprint seems
likely to be counter-productive and cause more total misses.

Create IFETCH_ALIGN_SHIFT/BYTES, which should give optimal ifetch
alignment with much more reasonable alignment. This saves 1792 bytes
from head_64.o text with an allmodconfig build.

Other subarchitectures should define appropriate IFETCH_ALIGN_SHIFT
values if this becomes more widely used.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent fda0440d
...@@ -20,12 +20,15 @@ ...@@ -20,12 +20,15 @@
#endif #endif
#else /* CONFIG_PPC64 */ #else /* CONFIG_PPC64 */
#define L1_CACHE_SHIFT 7 #define L1_CACHE_SHIFT 7
#define IFETCH_ALIGN_SHIFT 4 /* POWER8,9 */
#endif #endif
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
#define SMP_CACHE_BYTES L1_CACHE_BYTES #define SMP_CACHE_BYTES L1_CACHE_BYTES
#define IFETCH_ALIGN_BYTES (1 << IFETCH_ALIGN_SHIFT)
#if defined(__powerpc64__) && !defined(__ASSEMBLY__) #if defined(__powerpc64__) && !defined(__ASSEMBLY__)
struct ppc64_caches { struct ppc64_caches {
u32 dsize; /* L1 d-cache size */ u32 dsize; /* L1 d-cache size */
......
...@@ -95,12 +95,12 @@ end_##sname: ...@@ -95,12 +95,12 @@ end_##sname:
#define __FIXED_SECTION_ENTRY_BEGIN(sname, name, __align) \ #define __FIXED_SECTION_ENTRY_BEGIN(sname, name, __align) \
USE_FIXED_SECTION(sname); \ USE_FIXED_SECTION(sname); \
.align __align; \ .balign __align; \
.global name; \ .global name; \
name: name:
#define FIXED_SECTION_ENTRY_BEGIN(sname, name) \ #define FIXED_SECTION_ENTRY_BEGIN(sname, name) \
__FIXED_SECTION_ENTRY_BEGIN(sname, name, 0) __FIXED_SECTION_ENTRY_BEGIN(sname, name, IFETCH_ALIGN_BYTES)
#define FIXED_SECTION_ENTRY_BEGIN_LOCATION(sname, name, start) \ #define FIXED_SECTION_ENTRY_BEGIN_LOCATION(sname, name, start) \
USE_FIXED_SECTION(sname); \ USE_FIXED_SECTION(sname); \
...@@ -205,7 +205,7 @@ end_##sname: ...@@ -205,7 +205,7 @@ end_##sname:
#define EXC_COMMON_BEGIN(name) \ #define EXC_COMMON_BEGIN(name) \
USE_TEXT_SECTION(); \ USE_TEXT_SECTION(); \
.align 7; \ .balign IFETCH_ALIGN_BYTES; \
.global name; \ .global name; \
DEFINE_FIXED_SYMBOL(name); \ DEFINE_FIXED_SYMBOL(name); \
name: name:
......
...@@ -1403,7 +1403,7 @@ USE_TEXT_SECTION() ...@@ -1403,7 +1403,7 @@ USE_TEXT_SECTION()
/* /*
* Hash table stuff * Hash table stuff
*/ */
.align 7 .balign IFETCH_ALIGN_BYTES
do_hash_page: do_hash_page:
#ifdef CONFIG_PPC_STD_MMU_64 #ifdef CONFIG_PPC_STD_MMU_64
andis. r0,r4,0xa410 /* weird error? */ andis. r0,r4,0xa410 /* weird error? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment