[PATCH] Change address of ppc64 initial segment table

On ppc64 machines with segment tables, CPU0's segment table is at a
fixed address, currently 0x9000. This patch moves it to the free
space at 0x6000, just below the fwnmi data area. This saves 8k of
space in vmlinux and the runtime kernel image.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

David Gibson and committed by
Paul Mackerras
c59c464a ec465515

+24 -19
+17 -15
arch/ppc64/kernel/head.S
··· 52 * We layout physical memory as follows: 53 * 0x0000 - 0x00ff : Secondary processor spin code 54 * 0x0100 - 0x2fff : pSeries Interrupt prologs 55 - * 0x3000 - 0x6fff : interrupt support, iSeries and common interrupt prologs 56 * 0x7000 - 0x7fff : FWNMI data area 57 - * 0x9000 - 0x9fff : Initial segment table 58 */ 59 60 /* ··· 1258 b 1b 1259 1260 /* 1261 * Data area reserved for FWNMI option. 1262 * This address (0x7000) is fixed by the RPA. 1263 */ ··· 1279 .globl fwnmi_data_area 1280 fwnmi_data_area: 1281 .space PAGE_SIZE 1282 - 1283 - /* 1284 - * Space for the initial segment table 1285 - * For LPAR, the hypervisor must fill in at least one entry 1286 - * before we get control (with relocate on) 1287 - */ 1288 - . = STAB0_PHYS_ADDR 1289 - .globl __start_stab 1290 - __start_stab: 1291 - 1292 - . = (STAB0_PHYS_ADDR + PAGE_SIZE) 1293 - .globl __end_stab 1294 - __end_stab: 1295 1296 /* 1297 * On pSeries, secondary processors spin in the following code.
··· 52 * We layout physical memory as follows: 53 * 0x0000 - 0x00ff : Secondary processor spin code 54 * 0x0100 - 0x2fff : pSeries Interrupt prologs 55 + * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs 56 + * 0x6000 - 0x6fff : Initial (CPU0) segment table 57 * 0x7000 - 0x7fff : FWNMI data area 58 + * 0x8000 - : Early init and support code 59 */ 60 61 /* ··· 1257 b 1b 1258 1259 /* 1260 + * Space for CPU0's segment table. 1261 + * 1262 + * On iSeries, the hypervisor must fill in at least one entry before 1263 + * we get control (with relocate on). The address is give to the hv 1264 + * as a page number (see xLparMap in LparData.c), so this must be at a 1265 + * fixed address (the linker can't compute (u64)&initial_stab >> 1266 + * PAGE_SHIFT). 1267 + */ 1268 + . = STAB0_PHYS_ADDR /* 0x6000 */ 1269 + .globl initial_stab 1270 + initial_stab: 1271 + .space 4096 1272 + 1273 + /* 1274 * Data area reserved for FWNMI option. 1275 * This address (0x7000) is fixed by the RPA. 1276 */ ··· 1264 .globl fwnmi_data_area 1265 fwnmi_data_area: 1266 .space PAGE_SIZE 1267 1268 /* 1269 * On pSeries, secondary processors spin in the following code.
+2 -2
arch/ppc64/kernel/pacaData.c
··· 78 79 #define BOOTCPU_PACA_INIT(number) \ 80 { \ 81 - PACA_INIT_COMMON(number, 1, 0, STAB0_VIRT_ADDR) \ 82 PACA_INIT_ISERIES(number) \ 83 } 84 ··· 90 91 #define BOOTCPU_PACA_INIT(number) \ 92 { \ 93 - PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR) \ 94 } 95 #endif 96
··· 78 79 #define BOOTCPU_PACA_INIT(number) \ 80 { \ 81 + PACA_INIT_COMMON(number, 1, 0, (u64)&initial_stab) \ 82 PACA_INIT_ISERIES(number) \ 83 } 84 ··· 90 91 #define BOOTCPU_PACA_INIT(number) \ 92 { \ 93 + PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, (u64)&initial_stab) \ 94 } 95 #endif 96
+5 -2
include/asm-ppc64/mmu.h
··· 28 #define STE_VSID_SHIFT 12 29 30 /* Location of cpu0's segment table */ 31 - #define STAB0_PAGE 0x9 32 #define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT) 33 - #define STAB0_VIRT_ADDR (KERNELBASE+STAB0_PHYS_ADDR) 34 35 /* 36 * SLB
··· 28 #define STE_VSID_SHIFT 12 29 30 /* Location of cpu0's segment table */ 31 + #define STAB0_PAGE 0x6 32 #define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT) 33 + 34 + #ifndef __ASSEMBLY__ 35 + extern char initial_stab[]; 36 + #endif /* ! __ASSEMBLY */ 37 38 /* 39 * SLB