Mainline BG/P platform support
Subsystems (2)
RFC PATCH 1/7 Mainline BG/P platform support
The Linux kernel patches for the IBM BlueGene/P have been open-sourced for quite some time, but haven't been integrated into the mainline Linux kernel source tree. This is the first patch series of several where I will attempt to cleanup and mainline the already public patches. I welcome feedback as well as any help I can get. I'm drawing on the patches available for the IBM Compute Node kernel, the ZeptoOS project and the Kittyhawk project.
(all available from http://wiki.bg.anl-external.org)
I'll be prioritizing core patches which are harder to keep current with mainline due to merge conflicts and then slowly incorporating the drivers and other extensions (if acceptable after community review).
I'll be maintaining the patchset in my kernel.org repository (/pub/scm/linux/kernel/git/ericvh/bluegene.git) under the bluegene branch with the source repos (zepto, kittyhawk, ibmcn) available in respective branches. Ben - if you would prefer me to send pull requests once we get rolling, I can switch to that -- otherwise I'll stick to just submitting patches to the list assuming you'll pull them when they become acceptable. Thanks for your attention reviewing these patches.
--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
@@ -3863,6 +3863,14 @@ S: Maintained F: arch/powerpc/platforms/40x/ F: arch/powerpc/platforms/44x/ +LINUX FOR POWERPC BLUEGENE/P +M: Eric Van Hensbergen <[email protected]> +W: http://bg-linux.anl-external.org/wiki/index.php/Main_Page +L: [email protected] +T: git git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/bluegene.git +S: Maintained +F: arch/powerpc/platforms/44x/bgp* + LINUX FOR POWERPC EMBEDDED XILINX VIRTEX M: Grant Likely <[email protected]> W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
Signature · 1 line
1.7.4.1
RFC PATCH 2/7 add bluegene entry to cputable
--- arch/powerpc/kernel/cputable.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
arch/powerpc/kernel/cputable.c +14 -0
@@ -1732,6 +1732,20 @@ static struct cpu_spec __initdata cpu_specs[] = { .machine_check = machine_check_440A, .platform = "ppc440", }, + {/* Blue Gene/P */ + .pvr_mask = 0xfffffff0, + .pvr_value = 0x52131880, + .cpu_name = "450 Blue Gene/P", + .cpu_features = CPU_FTRS_440x6, + .cpu_user_features =COMMON_USER_BOOKE | + PPC_FEATURE_HAS_FPU, + .mmu_features = MMU_FTR_TYPE_44x, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_460gt, + .machine_check = machine_check_440A, + .platform = "ppc440", + }, { /* 460EX */ .pvr_mask = 0xffff0006, .pvr_value = 0x13020002,
Signature · 1 line
1.7.4.1
RFC PATCH 4/7 enable L1_WRITETHROUGH mode for BG/P
In reply to Eric Van HensbergenBG/P nodes need to be configured for writethrough to work in SMP configurations. This patch adds the right hooks in the MMU code to make sure L1_WRITETHROUGH configurations are setup for BG/P.
--- arch/powerpc/include/asm/mmu-44x.h | 2 ++ arch/powerpc/kernel/head_44x.S | 24 ++++++++++++++++++++++-- arch/powerpc/kernel/misc_32.S | 15 +++++++++++++++ arch/powerpc/lib/copy_32.S | 10 ++++++++++ arch/powerpc/mm/44x_mmu.c | 7 +++++-- arch/powerpc/platforms/Kconfig | 5 +++++ arch/powerpc/platforms/Kconfig.cputype | 4 ++++ 7 files changed, 63 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/mmu-44x.h +2 -0
@@ -8,6 +8,7 @@#define PPC44x_MMUCR_TID 0x000000ff#define PPC44x_MMUCR_STS 0x00010000 +#define PPC44x_MMUCR_U2 0x00200000#define PPC44x_TLB_PAGEID 0#define PPC44x_TLB_XLAT 1
@@ -32,6 +33,7 @@/* Storage attribute and access control fields */ #define PPC44x_TLB_ATTR_MASK 0x0000ff80 +#define PPC44x_TLB_WL1 0x00100000/* Write-through L1 */ #define PPC44x_TLB_U0 0x00008000/* User 0 */ #define PPC44x_TLB_U1 0x00004000/* User 1 */ #define PPC44x_TLB_U2 0x00002000/* User 2 */
arch/powerpc/kernel/head_44x.S +22 -2
@@ -429,7 +429,16 @@ finish_tlb_load_44x: andi. r10,r12,_PAGE_USER /* User page ? */ beq 1f /* nope, leave U bits empty */ rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */ -1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ +1: +#ifdef CONFIG_L1_WRITETHROUGH + andi. r10, r11, PPC44x_TLB_I + bne 2f + oris r11,r11,PPC44x_TLB_WL1@h /* Add coherency for */ + /* non-inhibited */ + ori r11,r11,PPC44x_TLB_U2|PPC44x_TLB_M +2: +#endif /* CONFIG_L1_WRITETHROUGH */ + tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ /* Done...restore registers and get out of here. */
@@ -799,7 +808,11 @@ skpinv: addi r4,r4,1 /* Increment */ sync /* Initialize MMUCR */ +#ifdef CONFIG_L1_WRITETHROUGH + lis r5, PPC44x_MMUCR_U2@h +#else li r5,0 +#endif /* CONFIG_L1_WRITETHROUGH */ mtspr SPRN_MMUCR,r5 sync
@@ -814,7 +827,14 @@ skpinv: addi r4,r4,1 /* Increment */ /* attrib fields */ /* Added guarded bit to protect against speculative loads/stores */ li r5,0 - ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G) +#ifdef CONFIG_L1_WRITETHROUGH + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G | PPC44x_TLB_U2) + oris r5,r5,PPC44x_TLB_WL1@h +#else + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G) +#endif /* CONFIG_L1_WRITETHROUGH li r0,63 /* TLB slot 63 */
arch/powerpc/kernel/misc_32.S +15 -0
@@ -506,7 +506,20 @@ _GLOBAL(clear_pages) li r0,PAGE_SIZE/L1_CACHE_BYTES slw r0,r0,r4 mtctr r0 +#ifdef CONFIG_L1_WRITETHROUGH + /* assuming 32 byte cacheline */ + li r4, 0 +1: stw r4, 0(r3) + stw r4, 4(r3) + stw r4, 8(r3) + stw r4, 12(r3) + stw r4, 16(r3) + stw r4, 20(r3) + stw r4, 24(r3) + stw r4, 28(r3) +#else 1: dcbz 0,r3 +#endif /* CONFIG_L1_WRITETHROUGH */ addi r3,r3,L1_CACHE_BYTES bdnz 1b blr
@@ -550,7 +563,9 @@ _GLOBAL(copy_page) mtctr r0 1: dcbt r11,r4 +#ifndef CONFIG_L1_WRITETHROUGH dcbz r5,r3 +#endif COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTES
arch/powerpc/lib/copy_32.S +10 -0
@@ -98,7 +98,11 @@ _GLOBAL(cacheable_memzero) bdnz 4b 3: mtctr r9 li r7,4 +#ifdef CONFIG_L1_WRITETHROUGH +10: +#else 10: dcbz r7,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ addi r6,r6,CACHELINE_BYTES bdnz 10b clrlwi r5,r8,32-LG_CACHELINE_BYTES
@@ -187,7 +191,9 @@ _GLOBAL(cacheable_memcpy) mtctr r0 beq 63f 53: +#ifndef CONFIG_L1_WRITETHROUGH dcbz r11,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTES
@@ -368,7 +374,11 @@ _GLOBAL(__copy_tofrom_user) mtctr r8 53: dcbt r3,r4 +#ifdef CONFIG_L1_WRITETHROUGH +54: +#else 54: dcbz r11,r6 +#endif .section __ex_table,"a" .align 2 .long 54b,105f
arch/powerpc/mm/44x_mmu.c +5 -2
@@ -80,9 +80,12 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys) :#ifdef CONFIG_PPC47x : "r" (PPC47x_TLB2_S_RWX), -#else +#elseif CONFIG_L1_WRITETHROUGH + : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_WL1 \ + | PPC44x_TLB_U2 | PPC44x_TLB_M), +#else /* neither CONFIG_PPC47x or CONFIG_L1_WRITETHROUGH */ : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), -#endif +#endif /* CONFIG_PPC47x */ "r" (phys),"r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M), "r" (entry),
arch/powerpc/platforms/Kconfig +5 -0
@@ -348,4 +348,9 @@ config XILINX_PCI bool "Xilinx PCI host bridge support" depends on PCI && XILINX_VIRTEX +config L1_WRITETHROUGH + bool "Blue Gene/P enabled writethrough mode" + depends on BGP + default y + endmenu
arch/powerpc/platforms/Kconfig.cputype +4 -0
@@ -329,9 +329,13 @@ config NOT_COHERENT_CACHE bool depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON default n if PPC_47x + default n if BGP default y config CHECK_CACHE_COHERENCY bool +config L1_WRITETHROUGH + bool + endmenu
Signature · 1 line
1.7.4.1
RFC PATCH 3/7 add support for BlueGene/P FPU
In reply to Eric Van HensbergenThis patch adds save/restore register support for the BlueGene/P double hummer FPU.
--- arch/powerpc/include/asm/ppc_asm.h | 39 ++++++++++++++++++++++++----------- arch/powerpc/kernel/fpu.S | 8 +++--- arch/powerpc/platforms/44x/Kconfig | 9 ++++++++ 3 files changed, 40 insertions(+), 16 deletions(-)
arch/powerpc/include/asm/ppc_asm.h +27 -12
@@ -88,6 +88,13 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) REST_10GPRS(22, base)#endif +#ifdef CONFIG_BGP +#define LFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(462<<1) +#define STFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(974<<1) +#endif /* CONFIG_BGP */ +#define SAVE_2GPRS (n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)#define SAVE_4GPRS (n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)#define SAVE_8GPRS (n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
@@ -97,18 +104,26 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)#define REST_8GPRS (n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)#define REST_10GPRS (n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) -#define SAVE_FPR (n, base) stfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define SAVE_2FPRS (n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) -#define SAVE_4FPRS (n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) -#define SAVE_8FPRS (n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base) -#define SAVE_16FPRS (n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base) -#define SAVE_32FPRS (n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base) -#define REST_FPR (n, base) lfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define REST_2FPRS (n, base) REST_FPR(n, base); REST_FPR(n+1, base) -#define REST_4FPRS (n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base) -#define REST_8FPRS (n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base) -#define REST_16FPRS (n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) -#define REST_32FPRS (n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) +#ifdef CONFIG_BGP +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b) +#else /* CONFIG_BGP */ +#define SAVE_FPR (n, b, base) (stfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)) +#define REST_FPR (n, b, base) (lfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)) +#endif /* CONFIG_BGP */ + +#define SAVE_2FPRS (n, b, base) SAVE_FPR(n, b, base); SAVE_FPR(n+1, b, base) +#define SAVE_4FPRS (n, b, base) SAVE_2FPRS(n, b, base); SAVE_2FPRS(n+2, b, base) +#define SAVE_8FPRS (n, b, base) SAVE_4FPRS(n, b, base); SAVE_4FPRS(n+4, b, base) +#define SAVE_16FPRS (n, b, base) SAVE_8FPRS(n, b, base); SAVE_8FPRS(n+8, b, base) +#define SAVE_32FPRS (n, b, base) SAVE_16FPRS(n, b, base); \ + SAVE_16FPRS(n+16, b, base) +#define REST_2FPRS (n, b, base) REST_FPR(n, b, base); REST_FPR(n+1, b, base) +#define REST_4FPRS (n, b, base) REST_2FPRS(n, b, base); REST_2FPRS(n+2, b, base) +#define REST_8FPRS (n, b, base) REST_4FPRS(n, b, base); REST_4FPRS(n+4, b, base) +#define REST_16FPRS (n, b, base) REST_8FPRS(n, b, base); REST_8FPRS(n+8, b, base) +#define REST_32FPRS (n, b, base) REST_16FPRS(n, b, base); \ + REST_16FPRS(n+16, b, base)#define SAVE_VR (n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,base,b#define SAVE_2VRS (n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
arch/powerpc/kernel/fpu.S +4 -4
@@ -30,7 +30,7 @@ BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - REST_32FPRS(n,base); \ + REST_32FPRS(n,c,base); \ b 3f; \ 2: REST_32VSRS(n,c,base); \ 3:
@@ -39,13 +39,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - SAVE_32FPRS(n,base); \ + SAVE_32FPRS(n,c,base); \ b 3f; \ 2: SAVE_32VSRS(n,c,base); \ 3: #else -#define REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) -#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) +#define REST_32FPVSRS(n,b,base) REST_32FPRS(n,b,base) +#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n,b,base) #endif /*
arch/powerpc/platforms/44x/Kconfig +9 -0
@@ -169,6 +169,15 @@ config YOSEMITE help This option enables support for the AMCC PPC440EP evaluation board. +config BGP + bool "Blue Gene/P" + depends on 44x + default n + select PPC_FPU + select PPC_DOUBLE_FPU + help + This option enables support for the IBM BlueGene/P supercomputer. + config ISS4xx bool "ISS 4xx Simulator" depends on (44x || 40x)
Signature · 1 line
1.7.4.1
RFC PATCH 5/7 force 32-byte aligned kmallocs
In reply to Eric Van HensbergenFor BGP, it is convenient for 'kmalloc' to come back with 32-byte aligned units for torus DMA
--- arch/powerpc/include/asm/page_32.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/page_32.h +1 -1
@@ -9,7 +9,7 @@#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 -#ifdef CONFIG_NOT_COHERENT_CACHE +#if defined(CONFIG_NOT_COHERENT_CACHE ) || defined(CONFIG_BGP )#define ARCH_DMA_MINALIGN L1_CACHE_BYTES#endif
Signature · 1 line
1.7.4.1
RFC PATCH 6/7 enable early TLBs for BG/P
In reply to Eric Van HensbergenBG/P maps firmware with an early TLB
--- arch/powerpc/include/asm/mmu-44x.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/mmu-44x.h +5 -1
@@ -115,8 +115,12 @@ typedef struct {#endif /* !__ASSEMBLY__ */ #ifndef CONFIG_PPC_EARLY_DEBUG_44x +#ifndef CONFIG_BGP #define PPC44x_EARLY_TLBS 1 -#else +#else /* CONFIG_BGP */ +#define PPC44x_EARLY_TLBS 2 +#endif /* CONFIG_BGP */ +#else /* CONFIG_PPC_EARLY_DEBUG_44x */ #define PPC44x_EARLY_TLBS 2#define PPC44x_EARLY_DEBUG_VIRTADDR (ASM_CONST(0xf0000000) \ | (ASM_CONST(CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW) & 0xffff))
Signature · 1 line
1.7.4.1
RFC PATCH 7/7 SMP support code
In reply to Eric Van HensbergenThis patch adds the necessary core code to enable SMP support on BlueGene/P
--- arch/powerpc/kernel/head_44x.S | 72 +++++++++++++++++++++++++++++ arch/powerpc/mm/fault.c | 77 ++++++++++++++++++++++++++++++++ arch/powerpc/platforms/Kconfig.cputype | 2 +- 3 files changed, 150 insertions(+), 1 deletions(-)
arch/powerpc/kernel/head_44x.S +72 -0
@@ -1133,6 +1133,70 @@ clear_utlb_entry: #endif /* CONFIG_PPC_47x */ +#if defined(CONFIG_BGP) && defined(CONFIG_SMP) +_GLOBAL(start_secondary_bgp) + /* U2 will be enabled in TLBs. */ + lis r7,PPC44x_MMUCR_U2@h + mtspr SPRN_MMUCR,r7 + li r7,0 + mtspr SPRN_PID,r7 + sync + lis r8,KERNELBASE@h + + /* The tlb_44x_hwater global var (setup by cpu#0) reveals how many + * 256M TLBs we need to map. + */ + lis r9, tlb_44x_hwater@ha + lwz r9, tlb_44x_hwater@l(r9) + + li r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_M|PPC44x_TLB_U2) + oris r5, r5, PPC44x_TLB_WL1@h + + /* tlb_44x_hwater is the biggest TLB slot number for regular TLBs. + TLB 63 covers kernel base mapping(256MB) and TLB 62 covers CNS. + With 768MB lowmem, it is set to 59. + */ +2: + addi r9, r9, 1 + cmpwi r9,62 /* Stop at entry 62 which is the fw */ + beq 3f + addis r7,r7,0x1000 /* add 256M */ + addis r8,r8,0x1000 + ori r6,r8,PPC44x_TLB_VALID | PPC44x_TLB_256M + + tlbwe r6,r9,PPC44x_TLB_PAGEID /* Load the pageid fields */ + tlbwe r7,r9,PPC44x_TLB_XLAT /* Load the translation fields */ + tlbwe r5,r9,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ + b 2b + +3: isync + + /* Setup context from global var secondary_ti */ + lis r1, secondary_ti@ha + lwz r1, secondary_ti@l(r1) + lwz r2, TI_TASK(r1) /* r2 = task_info */ + + addi r3,r2,THREAD /* init task's THREAD */ + mtspr SPRN_SPRG3,r3 + + li r0,0 + stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) + + /* Let's move on */ + lis r4,start_secondary@h + ori r4,r4,start_secondary@l + lis r3,MSR_KERNEL@h + ori r3,r3,MSR_KERNEL@l + mtspr SPRN_SRR0,r4 + mtspr SPRN_SRR1,r3 + rfi /* change context and jump to start_secondary */ + +_GLOBAL(start_secondary_resume) + /* I don't think this currently happens on BGP */ + b . +#endif /* CONFIG_BGP && CONFIG_SMP */ + /* * Here we are back to code that is common between 44x and 47x *
@@ -1144,6 +1208,14 @@ head_start_common: lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ mtspr SPRN_IVPR,r4 +#if defined(CONFIG_BGP) && defined(CONFIG_SMP) + /* are we an additional CPU */ + li r0, 0 + mfspr r4, SPRN_PIR + cmpw r4, r0 + bgt start_secondary_bgp +#endif /* CONFIG_BGP && CONFIG_SMP */ + addis r22,r22,KERNELBASE@h mtlr r22 isync
arch/powerpc/mm/fault.c +77 -0
89 lines not on this page · raw message
arch/powerpc/platforms/Kconfig.cputype +1 -1
@@ -300,7 +300,7 @@ config PPC_PERF_CTRS This enables the powerpc-specific perf_event back-end. config SMP - depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x + depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x || BGP bool "Symmetric multi-processing support" ---help--- This enables support for systems with more than one CPU. If you have
Signature · 1 line
1.7.4.1
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Eric Van HensbergenEric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
What does this mean? Needs more details here.
Quoted 3 lines
Signed-off-by Eric Van Hensbergen <[email protected]>--- arch/powerpc/include/asm/ppc_asm.h | 39 ++++++++++++++++++++++++----------
-
arch/powerpc/include/asm/pp
Quoted 5 lines
arch/powerpc/kernel/fpu.S | 8 +++--- arch/powerpc/platforms/44x/Kconfig | 9 ++++++++ 3 files changed, 40 insertions(+), 16 deletions(-)arch/powerpc/include/asm/pp renamed from arch/powerpc/include/asm/ppc_asm.h +0
-0
c_asm.h
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 96
Quoted 13 lines
index 9821006..daa22bb 100644
arch/powerpc/include/asm/ppc_asm.h +6
-0@@ -88,6 +88,13 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) REST_10GPRS(22, base)#endif +#ifdef CONFIG_BGP +#define LFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(462<<1) +#define STFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(974<<1) +#endif /* CONFIG_BGP */
Put these in arch/powerpc/include/asm/ppc-opcode.h and reformat to fit whats there already.
Also, don't need to put these defines inside a #ifdef.
Quoted 13 lines
arch/powerpc/include/asm/ppc_asm.h +1
-5+#define SAVE_2GPRS (n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)#define SAVE_4GPRS (n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)#define SAVE_8GPRS (n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)@@ -97,18 +104,26 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)#define REST_8GPRS (n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)#define REST_10GPRS (n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) -#define SAVE_FPR (n, base) stfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define SAVE_2FPRS (n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) -#define SAVE_4FPRS (n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) -#define SAVE_8FPRS (n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base) -#define SAVE_16FPRS (n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 109
Quoted 10 lines
arch/powerpc/include/asm/ppc_asm.h +3
-7-#define SAVE_32FPRS (n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base) -#define REST_FPR (n, base) lfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define REST_2FPRS (n, base) REST_FPR(n, base); REST_FPR(n+1, base) -#define REST_4FPRS (n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base) -#define REST_8FPRS (n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base) -#define REST_16FPRS (n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) -#define REST_32FPRS (n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) +#ifdef CONFIG_BGP +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b)
16*? Are these FP regs 64 or 128 bits wide? If 128 you are doing to have to play with TS_WIDTH to get the size of the FPs correct in the thread_struct.
I think there's a bug here.
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
Quoted 6 lines
arch/powerpc/include/asm/ppc_asm.h +6
-0+#else /* CONFIG_BGP */ +#define SAVE_FPR (n, b, base) (stfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)) +#define REST_FPR (n, b, base) (lfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)) +#endif /* CONFIG_BGP */ + +#define SAVE_2FPRS (n, b, base) SAVE_FPR(n, b, base); SAVE_FPR(n+1, b,
base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 116
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define SAVE_4FPRS (n, b, base) SAVE_2FPRS(n, b, base); SAVE_2FPRS(n+2,
b, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 117
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define SAVE_8FPRS (n, b, base) SAVE_4FPRS(n, b, base); SAVE_4FPRS(n+4,
b, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 118
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define SAVE_16FPRS (n, b, base) SAVE_8FPRS(n, b, base); SAVE_8FPRS(n+8,
b, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
Quoted 3 lines
arch/powerpc/include/asm/ppc_asm.h +3
-0+#define SAVE_32FPRS (n, b, base) SAVE_16FPRS(n, b, base); \ + SAVE_16FPRS(n+16, b, base) +#define REST_2FPRS (n, b, base) REST_FPR(n, b, base); REST_FPR(n+1, b,
base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 122
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define REST_4FPRS (n, b, base) REST_2FPRS(n, b, base); REST_2FPRS(n+2,
b, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 123
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define REST_8FPRS (n, b, base) REST_4FPRS(n, b, base); REST_4FPRS(n+4,
b, base)
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 124
Quoted 1 line
arch/powerpc/include/asm/ppc_asm.h +1
-0+#define REST_16FPRS (n, b, base) REST_8FPRS(n, b, base); REST_8FPRS(n+8,
b, base)
arch/powerpc/kernel/fpu.S END_FTR_SECTION_IFSET(CPU_FTR_VSX);
Quoted 19 lines
arch/powerpc/include/asm/ppc_asm.h +2
-0+#define REST_32FPRS (n, b, base) REST_16FPRS(n, b, base); \ + REST_16FPRS(n+16, b, base)#define SAVE_VR (n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,base,b#define SAVE_2VRS (n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)arch/powerpc/kernel/fpu.S +1
-1@@ -30,7 +30,7 @@ BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - REST_32FPRS(n,base); \ + REST_32FPRS(n,c,base); \ b 3f; \ 2: REST_32VSRS(n,c,base); \ 3:@@ -39,13 +39,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX);
\
arch/powerpc/platforms/44x/
Quoted 17 lines
arch/powerpc/kernel/fpu.S +3
-3BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - SAVE_32FPRS(n,base); \ + SAVE_32FPRS(n,c,base); \ b 3f; \ 2: SAVE_32VSRS(n,c,base); \ 3: #else -#define REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) -#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) +#define REST_32FPVSRS(n,b,base) REST_32FPRS(n,b,base) +#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n,b,base) #endif /*arch/powerpc/platforms/44x/ renamed from arch/powerpc/platforms/44x/Kconfig +0
-0
Kconfig
arch/powerpc/platforms/44x/Kconfig config YOSEMITE · line 172
Quoted 8 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +1
-0@@ -169,6 +169,15 @@ config YOSEMITE help This option enables support for the AMCC PPC440EP evaluation board. +config BGP
Does this FPU feature have a specific name like double hammer? I'd rather have the BGP defconfig depend on PPC_FPU_DOUBLE_HUMMER, or something like that...
arch/powerpc/platforms/44x/Kconfig config YOSEMITE · line 177
Quoted 5 lines
arch/powerpc/platforms/44x/Kconfig +5
-0+ bool "Blue Gene/P" + depends on 44x + default n + select PPC_FPU + select PPC_DOUBLE_FPU
... in fact, it seem you are doing something like these here but you don't use PPC_DOUBLE_FPU anywhere?
Mikey
Quoted 14 lines
arch/powerpc/platforms/44x/Kconfig +3
-0+ help + This option enables support for the IBM BlueGene/P supercomputer. + config ISS4xx bool "ISS 4xx Simulator" depends on (44x || 40x)Signature · 6 lines
1.7.4.1 _______________________________________________ Linuxppc-dev mailing list [email protected] https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/7] [RFC] enable L1_WRITETHROUGH mode for BG/P
In reply to Eric Van HensbergenQuoted 182 lines · Eric Van Hensbergen
BG/P nodes need to be configured for writethrough to work in SMP configurations. This patch adds the right hooks in the MMU code to make sure
L1_WRITETHROUGHconfigurations are setup for BG/P.Signed-off-by Eric Van Hensbergen <[email protected]>---
arch/powerpc/include/asm/mmu-44x.h | 2 ++ arch/powerpc/kernel/head_44x.S | 24 ++++++++++++++++++++++-- arch/powerpc/kernel/misc_32.S | 15 +++++++++++++++ arch/powerpc/lib/copy_32.S | 10 ++++++++++ arch/powerpc/mm/44x_mmu.c | 7 +++++-- arch/powerpc/platforms/Kconfig | 5 +++++ arch/powerpc/platforms/Kconfig.cputype | 4 ++++ 7 files changed, 63 insertions(+), 4 deletions(-)arch/powerpc/include/asm/mmu-44x.h +2
-0@@ -8,6 +8,7 @@#define PPC44x_MMUCR_TID 0x000000ff#define PPC44x_MMUCR_STS 0x00010000 +#define PPC44x_MMUCR_U2 0x00200000#define PPC44x_TLB_PAGEID 0#define PPC44x_TLB_XLAT 1@@ -32,6 +33,7 @@/* Storage attribute and access control fields */ #define PPC44x_TLB_ATTR_MASK 0x0000ff80 +#define PPC44x_TLB_WL1 0x00100000/* Write-through L1 */ #define PPC44x_TLB_U0 0x00008000/* User 0 */ #define PPC44x_TLB_U1 0x00004000/* User 1 */ #define PPC44x_TLB_U2 0x00002000/* User 2 */ arch/powerpc/kernel/head_44x.S +22
-2@@ -429,7 +429,16 @@ finish_tlb_load_44x: andi. r10,r12,_PAGE_USER /* User page ? */ beq 1f /* nope, leave U bits empty */ rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */ -1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ +1: +#ifdef CONFIG_L1_WRITETHROUGH + andi. r10, r11, PPC44x_TLB_I + bne 2f + oris r11,r11,PPC44x_TLB_WL1@h /* Add coherency for */ + /* non-inhibited */ + ori r11,r11,PPC44x_TLB_U2|PPC44x_TLB_M +2: +#endif /* CONFIG_L1_WRITETHROUGH */ + tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ /* Done...restore registers and get out of here. */@@ -799,7 +808,11 @@ skpinv: addi r4,r4,1 /* Increment */ sync /* Initialize MMUCR */ +#ifdef CONFIG_L1_WRITETHROUGH + lis r5, PPC44x_MMUCR_U2@h +#else li r5,0 +#endif /* CONFIG_L1_WRITETHROUGH */ mtspr SPRN_MMUCR,r5 sync@@ -814,7 +827,14 @@ skpinv: addi r4,r4,1 /* Increment */ /* attrib fields */ /* Added guarded bit to protect against speculative loads/stores */ li r5,0 - ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G) +#ifdef CONFIG_L1_WRITETHROUGH + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G | PPC44x_TLB_U2) + oris r5,r5,PPC44x_TLB_WL1@h +#else + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G) +#endif /* CONFIG_L1_WRITETHROUGH li r0,63 /* TLB slot 63 */arch/powerpc/kernel/misc_32.S +12
-0@@ -506,7 +506,20 @@ _GLOBAL(clear_pages) li r0,PAGE_SIZE/L1_CACHE_BYTES slw r0,r0,r4 mtctr r0 +#ifdef CONFIG_L1_WRITETHROUGH + /* assuming 32 byte cacheline */ + li r4, 0 +1: stw r4, 0(r3) + stw r4, 4(r3) + stw r4, 8(r3) + stw r4, 12(r3) + stw r4, 16(r3) + stw r4, 20(r3) + stw r4, 24(r3) + stw r4, 28(r3) +#else1: dcbz 0,r3
+#endif /*CONFIG_L1_WRITETHROUGH*/addi r3,r3,L1_CACHE_BYTES bdnz 1b blrarch/powerpc/kernel/misc_32.S +0
-0@@ -550,7 +563,9 @@ _GLOBAL(copy_page) mtctr r01:
dcbt r11,r4 +#ifndef CONFIG_L1_WRITETHROUGH dcbz r5,r3 +#endif COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTESarch/powerpc/lib/copy_32.S +0
-0@@ -98,7 +98,11 @@ _GLOBAL(cacheable_memzero) bdnz 4b3: mtctr r9
li r7,4arch/powerpc/lib/copy_32.S +3
-0+#ifdef CONFIG_L1_WRITETHROUGH +10: +#else10: dcbz r7,r6
+#endif /*CONFIG_L1_WRITETHROUGH*/addi r6,r6,CACHELINE_BYTES bdnz 10b clrlwi r5,r8,32-LG_CACHELINE_BYTESarch/powerpc/lib/copy_32.S +0
-0@@ -187,7 +191,9 @@ _GLOBAL(cacheable_memcpy) mtctr r0 beq 63f53:
+#ifndefCONFIG_L1_WRITETHROUGHdcbz r11,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTESarch/powerpc/lib/copy_32.S +0
-0@@ -368,7 +374,11 @@ _GLOBAL(__copy_tofrom_user) mtctr r853: dcbt r3,r4
arch/powerpc/lib/copy_32.S +3
-0+#ifdef CONFIG_L1_WRITETHROUGH +54: +#else54: dcbz r11,r6
+#endif.section __ex_table,"a" .align 2 .long 54b,105farch/powerpc/mm/44x_mmu.c +5
-2@@ -80,9 +80,12 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys) :#ifdef CONFIG_PPC47x : "r" (PPC47x_TLB2_S_RWX), -#else +#elseif CONFIG_L1_WRITETHROUGH + : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_WL1 \ + | PPC44x_TLB_U2 | PPC44x_TLB_M), +#else /* neither CONFIG_PPC47x or CONFIG_L1_WRITETHROUGH */ : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), -#endif +#endif /* CONFIG_PPC47x */ "r" (phys),"r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M), "r" (entry),arch/powerpc/platforms/Kconfig +0
-0
arch/powerpc/platforms/Kconfig config XILINX_PCI · line 354
Quoted 7 lines
arch/powerpc/platforms/Kconfig +4
-0@@ -348,4 +348,9 @@ config XILINX_PCI bool "Xilinx PCI host bridge support" depends on PCI && XILINX_VIRTEX +config L1_WRITETHROUGH + bool "Blue Gene/P enabled writethrough mode" + depends on BGP + default y
You add this config option here, named generically, but then make it depend on BGP. It sees it should be named BGP_L1_WRITETHROUGH, and then just selected by the BGP platform. But then....
Quoted 15 lines
endmenu
arch/powerpc/platforms/Kconfig.cputype +1
-0@@ -329,9 +329,13 @@ config NOT_COHERENT_CACHE bool depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON default n if PPC_47x + default n if BGP default yconfig
CHECK_CACHE_COHERENCY
bool
arch/powerpc/platforms/Kconfig.cputype config NOT_COHERENT_CACHE · line 339
Quoted 2 lines
arch/powerpc/platforms/Kconfig.cputype +2
-0+config L1_WRITETHROUGH + bool
You add an identical option down here. Confused.
josh
Quoted 13 lines · Eric Van Hensbergen
The Linux kernel patches for the IBM BlueGene/P have been open-sourced for quite some time, but haven't been integrated into the mainline Linux kernel source tree. This is the first patch series of several where I will attempt to cleanup and mainline the already public patches. I welcome feedback as well as any help I can get. I'm drawing on the patches available for the IBM Compute Node kernel, the ZeptoOS project and the Kittyhawk project.
(all available from http://wiki.bg.anl-external.org)I'll be prioritizing core patches which are harder to keep current with mainline due to merge conflicts and then slowly incorporating the drivers and other extensions (if acceptable after community review).
Quoted 7 lines
I'll be maintaining the patchset in my kernel.org repository (/pub/scm/linux/kernel/git/ericvh/bluegene.git) under the bluegene branch with the source repos (zepto, kittyhawk, ibmcn) available in respective branches. Ben - if you would prefer me to send pull requests once we get rolling, I can switch to that -- otherwise I'll stick to just submitting patches to the list assuming you'll pull them when they become acceptable. Thanks for your attention reviewing these patches.
This is going to get slightly messy if there are lots of changes in platforms/44x and/or head_44x.S. Most 4xx changes go through my tree, and I'm happy to pull from your tree once things get off the ground. We just need to make sure and coordinate as we go.
My tree is fairly low-churn (as is all of 4xx) so hopefully I'm worried for nothing.
Quoted 13 lines
Signed-off-by Eric Van Hensbergen <[email protected]>---
MAINTAINERS| 8 ++++++++1 files changed, 8 insertions(+), 0 deletions(-)MAINTAINERS +0
-0@@ -3863,6 +3863,14 @@ S: MaintainedF:
arch/powerpc/platforms/40x/
F:arch/powerpc/platforms/44x/
MAINTAINERS S: Maintained · line 3872
Quoted 7 lines
MAINTAINERS +7
-0+LINUX FOR POWERPC BLUEGENE/P +M: Eric Van Hensbergen <[email protected]> +W: http://bg-linux.anl-external.org/wiki/index.php/Main_Page +L: [email protected] +T: git git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/bluegene.git +S: Maintained +F: arch/powerpc/platforms/44x/bgp*
This should probably be the last patch in the series. You have a file pattern listed for files that don't exist at all in any of the other patches you submitted :).
josh
Quoted 10 lines · Josh Boyer
Quoted 8 lines · Eric Van Hensbergen
I'll be maintaining the patchset in my kernel.org repository (/pub/scm/linux/kernel/git/ericvh/bluegene.git) under the bluegene branch with the source repos (zepto, kittyhawk, ibmcn) available in respective branches. Ben - if you would prefer me to send pull requests once we get rolling, I can switch to that -- otherwise I'll stick to just submitting patches to the list assuming you'll pull them when they become acceptable. Thanks for your attention reviewing these patches.
Quoted 5 lines
This is going to get slightly messy if there are lots of changes in platforms/44x and/or
head_44x.S. Most 4xx changes go through my tree, and I'm happy to pull from your tree once things get off the ground. We just need to make sure and coordinate as we go.
I'm fine with processing the changes through your tree. Most of the items with conflicts are in this series, so hopefully it won't be too messy (outside of some Makefile and Kconfig changes which are much easier to merge) after this. So, should I base changes on:
http://git.kernel.org/?p=linux/kernel/git/jwboyer/powerpc-4xx.git;a=shortlog;h=refs/heads/next
or:
http://git.kernel.org/?p=linux/kernel/git/benh/powerpc.git;a=shortlog;h=refs/heads/next
There are some important questions on code organization which it would probably be a good idea to discuss at some point -- in particular what I should do about the device drivers. Pretty much every driver except for the ethernet is particular to this platform. IIRC some of the embedded platforms have the SOC drivers in the platforms directory -- but it doesn't seem like you've done this with 4xx so I was gonna just place them in the appropriate drivers/* directory. The other question is that there are a number of patches which involve communication which a somewhat substantial firmware layer. You can get an idea of the existing patch's code organization by looking at:
Its important to point out that I am going through and cleaning up as I go, so not everything from that patch will make the cut as is (or perhaps even at all) -- but that should help identify where potential conflicts are as well as potentially out of place code.
Quoted 13 lines
MAINTAINERS S: Maintained · line 3872
Quoted 8 lines
MAINTAINERS +7
-0+LINUX FOR POWERPC BLUEGENE/P +M: Eric Van Hensbergen <[email protected]> +W: http://bg-linux.anl-external.org/wiki/index.php/Main_Page +L: [email protected] +T: git git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/bluegene.git +S: Maintained +F: arch/powerpc/platforms/44x/bgp*This should probably be the last patch in the series. You have a file pattern listed for files that don't exist at all in any of the other patches you submitted :).
Yeah, I wondered about that, its just I hate patch series intro messages with no patch, and I figured this was a good way out of it. It also adds the relevant
info as far as mailing lists and wiki pages where folks can go for more info -- but if folks have a problem with it I'll kill it until we get everything else in.
-eric
Re: [PATCH 4/7] [RFC] enable L1_WRITETHROUGH mode for BG/P
In reply to Josh BoyerQuoted 23 lines · Josh Boyer
Quoted 5 lines · Eric Van Hensbergen
+config
L1_WRITETHROUGH
+ bool "Blue Gene/P enabled writethrough mode"
+ depends on BGP
+ default yYou add this config option here, named generically, but then make it depend on BGP. It sees it should be named
BGP_L1_WRITETHROUGH, and then just selected by the BGP platform. But then....Quoted 12 lines
endmenu
arch/powerpc/platforms/Kconfig.cputype +0
-0@@ -329,9 +329,13 @@ config NOT_COHERENT_CACHEbool
depends on 4xx || 8xx || E200 ||PPC_MPC512x||GAMECUBE_COMMONdefault n ifPPC_47x
+ default n if BGP
default y
Quoted 8 lines
Quoted 5 lines
config
CHECK_CACHE_COHERENCY
bool+config
L1_WRITETHROUGH
+ boolYou add an identical option down here. Confused.
Yeah, this was copied from the original patches and it confused me as well, but I had never
modified Kconfig.cputype before so I wasn't sure if there were some weird rules. I'm happy
to remove the vestigial one and make the changes you suggest to make the naming BGP
specific.
-eric
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Michael NeulingQuoted 7 lines · Michael Neuling
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
What does this mean? Needs more details here.
Hi Mikey,
any specific details you are looking for here? AFAIK these patches are required for the kernel to save/restore the double hummer properly.
Quoted 11 lines
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 96
Quoted 7 lines
arch/powerpc/include/asm/ppc_asm.h +6
-0+#ifdef CONFIG_BGP +#define LFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(462<<1) +#define STFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(974<<1) +#endif /* CONFIG_BGP */ Put these in
arch/powerpc/include/asm/ppc-opcode.hand reformat to fit whats there already.
Quoted 2 lines
Also, don't need to put these defines inside a #ifdef.
Sure, I'll fix that up.
Quoted 10 lines
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 109
Quoted 3 lines
arch/powerpc/include/asm/ppc_asm.h +3
-0+#ifdef CONFIG_BGP +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b)16*? Are these FP regs 64 or 128 bits wide? If 128 you are doing to have to play with
TS_WIDTHto get the size of the FPs correct in thethread_struct.I think there's a bug here.
I actually have three different versions of this code from different source patches that I'm drawing from - so your help in figuring out the best way to approach this is appreciated. The kittyhawk version of the code has 8* instead of 16*. According to the docs:
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a second SAVE_32SFPRS for the second hummer. What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible). If this is not the way to go, I can certainly switch the kittyhawk version of the patch with the *, the extra SAVE32SFPR and the extra double hummer specific storage space in the thread_struct. If it would help I can post an alternate version of the patch for discussion with the kittyhawk version.
Quoted 16 lines
arch/powerpc/platforms/44x/
Quoted 2 lines
/*
arch/powerpc/platforms/44x/ renamed from arch/powerpc/platforms/44x/Kconfig +0
-0
KconfigQuoted 8 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +0
-0@@ -169,6 +169,15 @@ config YOSEMITEhelp
This option enables support for the AMCC PPC440EP evaluation board.+config BGP
Does this FPU feature have a specific name like double hammer? I'd rather have the BGP defconfig depend on
PPC_FPU_DOUBLE_HUMMER, or something like that...
Quoted 9 lines
Quoted 5 lines
+ bool "Blue Gene/P"
+ depends on 44x
+ default n
+ selectPPC_FPU
+ selectPPC_DOUBLE_FPU... in fact, it seem you are doing something like these here but you don't use
PPC_DOUBLE_FPUanywhere?
A fair point. I'm fine with calling it DOUBLE_HUMMER, but I wasn't sure if that was "too internal" of a name for the kernel. Let me know and I'll fix it up.
I'll also change the CONFIG_BGP defines in the FPU code to PPC_DOUBLE_FPU or PPC_DOUBLE_HUMMER depending on what the community decides.
Thanks for the feedback!
-eric
Re: [bg-linux] [PATCH 3/7] [RFC] add support for BlueGene/P FPU
Quoted 12 lines · Eric Van Hensbergen
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
+#ifdef
CONFIG_BGP
+#defineSAVE_FPR(n, b, base)li b, THREAD_FPR0+(16*(n));STFPDX(n, base, b)+#defineREST_FPR(n, b, base)li b, THREAD_FPR0+(16*(n));LFPDX(n, base, b)Quoted 7 lines
Quoted 6 lines
16*? Are these FP regs 64 or 128 bits wide? If 128 you are doing to have to play with
TS_WIDTHto get the size of the FPs correct in thethread_struct.I think there's a bug here.
Quoted 11 lines
I actually have three different versions of this code from different source patches that I'm drawing from - so your help in figuring out the best way to approach this is appreciated. The kittyhawk version of the code has 8* instead of 16*. According to the docs:
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a secondSAVE_32SFPRSfor the second hummer. What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible).
Yes, it does. SIMD like instructions are added to BGP PPC.
stdpdx or lfpdx, for example, handle two FPU registers (primary and secondary).
Thanks,
Kaz
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Eric Van HensbergenQuoted 7 lines · In message <[email protected]> you wrote:
On Thu, May 19, 2011 at 12:58 AM, Michael Neuling <[email protected]> wrote= :
Quoted 5 lines
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
Quoted 8 lines
Quoted 2 lines
What does this mean? =A0Needs more details here.
Hi Mikey,
any specific details you are looking for here? AFAIK these patches are required for the kernel to save/restore the double hummer properly.
I should have been more specific. What does double hammer mean?
I description of how double hammer differs from normal and why a change in the fpu code is needed would be great.
Quoted 32 lines
Quoted 5 lines
Review
Quoted 5 lines
(quoted diff) +3
-0+#ifdef CONFIG_BGP +#define LFPDX(frt, ra, rb) =A0 .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ==A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((rb)<<11)|(462<<1)
Quoted 2 lines
Quoted 2 lines
+#define
STFPDX(frt, ra, rb)=A0.long (31<<26)|((frt)<<21)|((ra)<<16)| \
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ==A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((rb)<<11)|(974<<1)
Quoted 7 lines
Quoted 1 line
+#endif /*
CONFIG_BGP*/Put these in
arch/powerpc/include/asm/ppc-opcode.hand reformat to fit whats there already.Also, don't need to put these defines inside a #ifdef.
Sure, I'll fix that up.
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+#ifdef CONFIG_BGP +#define SAVE_FPR(n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base=, b)
Quoted 1 line
Quoted 1 line
+#define
REST_FPR(n, b, base)li b, THREAD_FPR0+(16*(n)); LFPDX(n, base,=b)
Quoted 7 lines
16*? =A0Are these FP regs 64 or 128 bits wide? =A0If 128 you are doing to have to play with
TS_WIDTHto get the size of the FPs correct in thethread_struct.I think there's a bug here.
Quoted 11 lines
I actually have three different versions of this code from different source patches that I'm drawing from - so your help in figuring out the best way to approach this is appreciated. The kittyhawk version of the code has 8* instead of 16*. According to the docs:
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a secondSAVE_32SFPRSfor the second hummer. What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible).
Ok, sounds like there is 32*8*2 bytes of data, rather than the normal 32*8 bytes for FP only (ignoring VSX). If this is the case, then you'll need make 'fpr' in the thread struct bigger which you can do by setting TS_FPRWIDTH = 2 like we do for VSX.
If there is some instruction that saves and restores two of these at a time (which LFPDX/STFPDX might I guess), then we can use that, otherwise we'll have to do 64 saves/restores. Double load/stores will be faster I'm guessing though.
If two at a time, do we need to increase the index in pairs?
Quoted 4 lines
If this is not the way to go, I can certainly
switch the kittyhawk version of the patch with the *, the extra SAVE32SFPR and the extra double hummer specific storage space in thethread_struct.
I'd be tempted to keep it in the 'fpr' part of the struct so you can then access it with ptrace/signals/core dumps.
Quoted 2 lines
If it would help I can post an alternate version of the patch for discussion with the kittyhawk version.
Sure.
The most useful thing would be to see the instruction definition for STFPDX/LFPDX.
Quoted 25 lines
Quoted 3 lines
arch/powerpc/platforms=
Quoted 3 lines
=A0/*
arch/powerpc/platforms= renamed from arch/powerpc/platforms/44x/Kconfig +0
-0/44x/
Quoted 7 lines
KconfigQuoted 6 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +0
-0@@ -169,6 +169,15 @@ config YOSEMITE=A0 =A0 =A0 help
=A0 =A0 =A0 =A0 This option enables support for the AMCC PPC440EP evalua=tion board.
Quoted 13 lines
Quoted 2 lines
+config =A0 =A0 =A0 BGP
Does this FPU feature have a specific name like double hammer? =A0I'd rather have the BGP defconfig depend on
PPC_FPU_DOUBLE_HUMMER, or something like that...Quoted 5 lines
+ =A0 =A0 bool "Blue Gene/P"
+ =A0 =A0 depends on 44x
+ =A0 =A0 default n
+ =A0 =A0 selectPPC_FPU
+ =A0 =A0 selectPPC_DOUBLE_FPU
Quoted 7 lines
Quoted 3 lines
... in fact, it seem you are doing something like these here but you don't use
PPC_DOUBLE_FPUanywhere?A fair point. I'm fine with calling it
DOUBLE_HUMMER, but I wasn't sure if that was "too internal" of a name for the kernel. Let me know and I'll fix it up.
What I'm mostly concerned about is disassociating it with a particular CPU.
If it has an external name, then all the better.
Quoted 2 lines
I'll also change the
CONFIG_BGPdefines in the FPU code toPPC_DOUBLE_FPUorPPC_DOUBLE_HUMMERdepending on what the community decides.
Mikey
RFC PATCH v2 3/7 add support for BlueGene/P Double FPU
In reply to Eric Van HensbergenThis patch adds save/restore register support for the BlueGene/P double FPU. Since there are two FPUs, we need to save and restore twice the registers. Fortunately BG/P gives us some opcodes to assist with that task.
--- arch/powerpc/include/asm/ppc-opcode.h | 9 +++++++++ arch/powerpc/include/asm/ppc_asm.h | 32 ++++++++++++++++++++------------ arch/powerpc/kernel/fpu.S | 8 ++++---- arch/powerpc/platforms/44x/Kconfig | 9 +++++++++ arch/powerpc/platforms/Kconfig.cputype | 4 ++++ 5 files changed, 46 insertions(+), 16 deletions(-)
arch/powerpc/include/asm/ppc-opcode.h +9 -0
@@ -56,6 +56,9 @@#define PPC_INST_TLBSRX_DOT 0x7c0006a5#define PPC_INST_XXLOR 0xf0000510 +#define PPC_INST_LFPDX 0x7c00039c +#define PPC_INST_STFPDX 0x7c00079c +/* macros to insert fields into opcodes */ #define __PPC_RA (a) (((a) & 0x1f) << 16)#define __PPC_RB (b) (((b) & 0x1f) << 11)
@@ -126,4 +129,10 @@#define XXLOR (t, a, b) stringify_in_c(.long PPC_INST_XXLOR | \ VSX_XX3((t), (a), (b))) +#define LFPDX (t, a, b) stringify_in_c(.long PPC_INST_LFPDX | \ + __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b))) +#define STFPDX (t, a, b) stringify_in_c(.long PPC_INST_STFPDX | \ + __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b))) + +#endif /* _ASM_POWERPC_PPC_OPCODE_H */
arch/powerpc/include/asm/ppc_asm.h +20 -12
@@ -97,18 +97,26 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)#define REST_8GPRS (n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)#define REST_10GPRS (n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) -#define SAVE_FPR (n, base) stfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define SAVE_2FPRS (n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) -#define SAVE_4FPRS (n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) -#define SAVE_8FPRS (n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base) -#define SAVE_16FPRS (n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base) -#define SAVE_32FPRS (n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base) -#define REST_FPR (n, base) lfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define REST_2FPRS (n, base) REST_FPR(n, base); REST_FPR(n+1, base) -#define REST_4FPRS (n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base) -#define REST_8FPRS (n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base) -#define REST_16FPRS (n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) -#define REST_32FPRS (n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) +#ifdef CONFIG_DOUBLE_FPU +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b) +#else /* CONFIG_DOUBLE_FPU */ +#define SAVE_FPR (n, b, base) stfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) +#define REST_FPR (n, b, base) lfd n, THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) +#endif /* CONFIG_DOUBLE_FPU */ + +#define SAVE_2FPRS (n, b, base) SAVE_FPR(n, b, base); SAVE_FPR(n+1, b, base) +#define SAVE_4FPRS (n, b, base) SAVE_2FPRS(n, b, base); SAVE_2FPRS(n+2, b, base) +#define SAVE_8FPRS (n, b, base) SAVE_4FPRS(n, b, base); SAVE_4FPRS(n+4, b, base) +#define SAVE_16FPRS (n, b, base) SAVE_8FPRS(n, b, base); SAVE_8FPRS(n+8, b, base) +#define SAVE_32FPRS (n, b, base) SAVE_16FPRS(n, b, base); \ + SAVE_16FPRS(n+16, b, base) +#define REST_2FPRS (n, b, base) REST_FPR(n, b, base); REST_FPR(n+1, b, base) +#define REST_4FPRS (n, b, base) REST_2FPRS(n, b, base); REST_2FPRS(n+2, b, base) +#define REST_8FPRS (n, b, base) REST_4FPRS(n, b, base); REST_4FPRS(n+4, b, base) +#define REST_16FPRS (n, b, base) REST_8FPRS(n, b, base); REST_8FPRS(n+8, b, base) +#define REST_32FPRS (n, b, base) REST_16FPRS(n, b, base); \ + REST_16FPRS(n+16, b, base)#define SAVE_VR (n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,base,b#define SAVE_2VRS (n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
arch/powerpc/kernel/fpu.S +4 -4
@@ -30,7 +30,7 @@ BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - REST_32FPRS(n,base); \ + REST_32FPRS(n,c,base); \ b 3f; \ 2: REST_32VSRS(n,c,base); \ 3:
@@ -39,13 +39,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ BEGIN_FTR_SECTION \ b 2f; \ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ - SAVE_32FPRS(n,base); \ + SAVE_32FPRS(n,c,base); \ b 3f; \ 2: SAVE_32VSRS(n,c,base); \ 3: #else -#define REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) -#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) +#define REST_32FPVSRS(n,b,base) REST_32FPRS(n,b,base) +#define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n,b,base) #endif /*
arch/powerpc/platforms/44x/Kconfig +9 -0
@@ -169,6 +169,15 @@ config YOSEMITE help This option enables support for the AMCC PPC440EP evaluation board. +config BGP + bool "Blue Gene/P" + depends on 44x + default n + select PPC_FPU + select PPC_DOUBLE_FPU + help + This option enables support for the IBM BlueGene/P supercomputer. + config ISS4xx bool "ISS 4xx Simulator" depends on (44x || 40x)
arch/powerpc/platforms/Kconfig.cputype +4 -0
@@ -137,6 +137,10 @@ config PPC_FPU bool default y if PPC64 +config PPC_DOUBLE_FPU + bool "Bluegene/P Double FPU Support" + depends on BGP + config FSL_EMB_PERFMON bool "Freescale Embedded Perfmon" depends on E500 || PPC_83xx
Signature · 1 line
1.7.4.1
RFC PATCH v2 4/7 enable BGP_L1_WRITETHROUGH mode for BG/P
In reply to Eric Van HensbergenBG/P nodes need to be configured for writethrough to work in SMP configurations. This patch adds the right hooks in the MMU code to make sure BGP_L1_WRITETHROUGH configurations are setup for BG/P.
--- arch/powerpc/include/asm/mmu-44x.h | 2 ++ arch/powerpc/kernel/head_44x.S | 24 ++++++++++++++++++++++-- arch/powerpc/kernel/misc_32.S | 15 +++++++++++++++ arch/powerpc/lib/copy_32.S | 10 ++++++++++ arch/powerpc/mm/44x_mmu.c | 7 +++++-- arch/powerpc/platforms/Kconfig | 5 +++++ arch/powerpc/platforms/Kconfig.cputype | 1 + 7 files changed, 60 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/mmu-44x.h +2 -0
@@ -8,6 +8,7 @@#define PPC44x_MMUCR_TID 0x000000ff#define PPC44x_MMUCR_STS 0x00010000 +#define PPC44x_MMUCR_U2 0x00200000#define PPC44x_TLB_PAGEID 0#define PPC44x_TLB_XLAT 1
@@ -32,6 +33,7 @@/* Storage attribute and access control fields */ #define PPC44x_TLB_ATTR_MASK 0x0000ff80 +#define PPC44x_TLB_WL1 0x00100000/* Write-through L1 */ #define PPC44x_TLB_U0 0x00008000/* User 0 */ #define PPC44x_TLB_U1 0x00004000/* User 1 */ #define PPC44x_TLB_U2 0x00002000/* User 2 */
arch/powerpc/kernel/head_44x.S +22 -2
@@ -429,7 +429,16 @@ finish_tlb_load_44x: andi. r10,r12,_PAGE_USER /* User page ? */ beq 1f /* nope, leave U bits empty */ rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */ -1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ +1: +#ifdef CONFIG_BGP_L1_WRITETHROUGH + andi. r10, r11, PPC44x_TLB_I + bne 2f + oris r11,r11,PPC44x_TLB_WL1@h /* Add coherency for */ + /* non-inhibited */ + ori r11,r11,PPC44x_TLB_U2|PPC44x_TLB_M +2: +#endif /* CONFIG_BGP_L1_WRITETHROUGH */ + tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ /* Done...restore registers and get out of here. */
@@ -799,7 +808,11 @@ skpinv: addi r4,r4,1 /* Increment */ sync /* Initialize MMUCR */ +#ifdef CONFIG_BGP_L1_WRITETHROUGH + lis r5, PPC44x_MMUCR_U2@h +#else li r5,0 +#endif /* CONFIG_BGP_L1_WRITETHROUGH */ mtspr SPRN_MMUCR,r5 sync
@@ -814,7 +827,14 @@ skpinv: addi r4,r4,1 /* Increment */ /* attrib fields */ /* Added guarded bit to protect against speculative loads/stores */ li r5,0 - ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G) +#ifdef CONFIG_BGP_L1_WRITETHROUGH + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G | PPC44x_TLB_U2) + oris r5,r5,PPC44x_TLB_WL1@h +#else + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G) +#endif /* CONFIG_BGP_L1_WRITETHROUGH li r0,63 /* TLB slot 63 */
arch/powerpc/kernel/misc_32.S +15 -0
@@ -506,7 +506,20 @@ _GLOBAL(clear_pages) li r0,PAGE_SIZE/L1_CACHE_BYTES slw r0,r0,r4 mtctr r0 +#ifdef CONFIG_BGP_L1_WRITETHROUGH + /* assuming 32 byte cacheline */ + li r4, 0 +1: stw r4, 0(r3) + stw r4, 4(r3) + stw r4, 8(r3) + stw r4, 12(r3) + stw r4, 16(r3) + stw r4, 20(r3) + stw r4, 24(r3) + stw r4, 28(r3) +#else 1: dcbz 0,r3 +#endif /* CONFIG_BGP_L1_WRITETHROUGH */ addi r3,r3,L1_CACHE_BYTES bdnz 1b blr
@@ -550,7 +563,9 @@ _GLOBAL(copy_page) mtctr r0 1: dcbt r11,r4 +#ifndef CONFIG_BGP_L1_WRITETHROUGH dcbz r5,r3 +#endif /* CONFIG_BGP_L1_WRITETHROUGH */ COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTES
arch/powerpc/lib/copy_32.S +10 -0
@@ -98,7 +98,11 @@ _GLOBAL(cacheable_memzero) bdnz 4b 3: mtctr r9 li r7,4 +#ifdef CONFIG_BGP_L1_WRITETHROUGH +10: +#else 10: dcbz r7,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ addi r6,r6,CACHELINE_BYTES bdnz 10b clrlwi r5,r8,32-LG_CACHELINE_BYTES
@@ -187,7 +191,9 @@ _GLOBAL(cacheable_memcpy) mtctr r0 beq 63f 53: +#ifndef CONFIG_BGP_L1_WRITETHROUGH dcbz r11,r6 +#endif /* CONFIG_BGP_L1_WRITETHROUGH */ COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTES
@@ -368,7 +374,11 @@ _GLOBAL(__copy_tofrom_user) mtctr r8 53: dcbt r3,r4 +#ifdef CONFIG_BGP_L1_WRITETHROUGH +54: +#else 54: dcbz r11,r6 +#endif .section __ex_table,"a" .align 2 .long 54b,105f
arch/powerpc/mm/44x_mmu.c +5 -2
@@ -80,9 +80,12 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys) :#ifdef CONFIG_PPC47x : "r" (PPC47x_TLB2_S_RWX), -#else +#elseif CONFIG_BGP_L1_WRITETHROUGH + : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_WL1 \ + | PPC44x_TLB_U2 | PPC44x_TLB_M), +#else /* neither CONFIG_PPC47x or CONFIG_BGP_L1_WRITETHROUGH */ : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), -#endif +#endif /* CONFIG_PPC47x */ "r" (phys),"r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M), "r" (entry),
arch/powerpc/platforms/Kconfig +5 -0
@@ -348,4 +348,9 @@ config XILINX_PCI bool "Xilinx PCI host bridge support" depends on PCI && XILINX_VIRTEX +config BGP_L1_WRITETHROUGH + bool "Blue Gene/P enabled writethrough mode" + depends on BGP + default y + endmenu
arch/powerpc/platforms/Kconfig.cputype +1 -0
@@ -333,6 +333,7 @@ config NOT_COHERENT_CACHE bool depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON default n if PPC_47x + default n if BGP default y config CHECK_CACHE_COHERENCY
Signature · 1 line
1.7.4.1
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Michael NeulingDamnit Mikey, just after I hit send on [V2].....
Quoted 1 line · Michael Neuling
In message <[email protected]> you wrote=
:
Quoted 1 line
Quoted 1 line
On Thu, May 19, 2011 at 12:58 AM, Michael Neuling <[email protected]> wr=
ote=3D
Quoted 8 lines
Quoted 8 lines
:
Quoted 7 lines
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
What does this mean? =3DA0Needs more details here.
okay, I've changed it a bit in [V2], if you want more I can do my best.
Quoted 10 lines
Quoted 7 lines
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a second
SAVE_32SFPRSfor the second hummer. =A0What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible).Ok, sounds like there is 32*8*2 bytes of data, rather than the normal 32*8 bytes for FP only (ignoring VSX). =A0If this is the case, then you'l=
l
Quoted 3 lines
need make 'fpr' in the thread struct bigger which you can do by setting
TS_FPRWIDTH=3D 2 like we do for VSX.
Okay, I'll incorporate that into [V3].
Quoted 4 lines
If there is some instruction that saves and restores two of these at a time (which LFPDX/STFPDX might I guess), then we can use that, otherwise we'll have to do 64 saves/restores. =A0Double load/stores will be faster I'm guessing though.
I assume that's true.
Quoted 3 lines
If two at a time, do we need to increase the index in pairs?
I don't believe so.
Quoted 5 lines
Quoted 4 lines
If this is not the way to go, I can certainly
switch the kittyhawk version of the patch with the *, the extra SAVE32SFPR and the extra double hummer specific storage space in thethread_struct.
Quoted 8 lines
I'd be tempted to keep it in the 'fpr' part of the struct so you can then access it with ptrace/signals/core dumps.
Quoted 2 lines
If it would help I can post an alternate version of the patch for discussion with the kittyhawk version.
Sure.
Kittyhawk version can be seen here:
http://git.kernel.org/?p=3Dlinux/kernel/git/ericvh/bluegene.git;a=3Dcommitd=
iff;h=3D94bffe786324b9bd07187b11afd836e3ec362d95
Quoted 4 lines
The most useful thing would be to see the instruction definition for STFPDX/LFPDX.
https://wiki.alcf.anl.gov/images/d/d9/PPC440_FP2_arch.pdf
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
arch/powerpc/platfo=
Quoted 3 lines
=3DA0/*
arch/powerpc/platfo= renamed from arch/powerpc/platforms/44x/Kconfig +0
-0
rms=3D
Quoted 8 lines
Quoted 8 lines
/44x/
Quoted 7 lines
KconfigQuoted 6 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +0
-0@@ -169,6 +169,15 @@ config YOSEMITE=3DA0 =3DA0 =3DA0 help
=3DA0 =3DA0 =3DA0 =3DA0 This option enables support for the AMCC PPC4=
40EP evalua=3D
Quoted 5 lines
Quoted 5 lines
tion board.
Quoted 4 lines
Quoted 2 lines
+config =3DA0 =3DA0 =3DA0 BGP
Does this FPU feature have a specific name like double hammer? =3DA0I'=
d
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
rather have the BGP defconfig depend on
PPC_FPU_DOUBLE_HUMMER, or something like that...Quoted 5 lines
+ =3DA0 =3DA0 bool "Blue Gene/P"
+ =3DA0 =3DA0 depends on 44x
+ =3DA0 =3DA0 default n
+ =3DA0 =3DA0 selectPPC_FPU
+ =3DA0 =3DA0 selectPPC_DOUBLE_FPU
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
... in fact, it seem you are doing something like these here but you don't use
PPC_DOUBLE_FPUanywhere?A fair point. =A0I'm fine with calling it
DOUBLE_HUMMER, but I wasn't su=
re if
Quoted 8 lines
Quoted 2 lines
that was "too internal" of a name for the kernel. =A0Let me know and I'll fix it up.
What I'm mostly concerned about is disassociating it with a particular CPU.
If it has an external name, then all the better.
Since it isn't available on other chips, shoudl it just be PPC_BGP_FPU or PPC_BGP_DOUBLE_FPU?
-eric
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
Quoted 10 lines · In message <[email protected]> you wrote:
Damnit Mikey, just after I hit send on [V2].....
Quoted 1 line · Michael Neuling
In message <[email protected]> you wrote=
:
Quoted 1 line
Quoted 1 line
On Thu, May 19, 2011 at 12:58 AM, Michael Neuling <[email protected]> wr=
ote=3D
Quoted 3 lines
Quoted 3 lines
:
Quoted 2 lines
Eric,
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
What does this mean? =3DA0Needs more details here.
okay, I've changed it a bit in [V2], if you want more I can do my best.
If you can describe the whole primary and secondary registers that'd be cool. ASCII art would be awesome! :-)
Quoted 42 lines
Quoted 11 lines
Quoted 8 lines
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a second
SAVE_32SFPRSfor the second hummer. =A0What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible).Ok, sounds like there is 32*8*2 bytes of data, rather than the normal 32*8 bytes for FP only (ignoring VSX). =A0If this is the case, then you'l=
l
Quoted 3 lines
need make 'fpr' in the thread struct bigger which you can do by setting
TS_FPRWIDTH=3D 2 like we do for VSX.Okay, I'll incorporate that into [V3].
Quoted 4 lines
If there is some instruction that saves and restores two of these at a time (which LFPDX/STFPDX might I guess), then we can use that, otherwise we'll have to do 64 saves/restores. =A0Double load/stores will be faster I'm guessing though.
I assume that's true.
Quoted 3 lines
If two at a time, do we need to increase the index in pairs?
I don't believe so.
Quoted 11 lines
Quoted 4 lines
If this is not the way to go, I can certainly
switch the kittyhawk version of the patch with the *, the extra SAVE32SFPR and the extra double hummer specific storage space in thethread_struct.I'd be tempted to keep it in the 'fpr' part of the struct so you can then access it with ptrace/signals/core dumps.
Quoted 2 lines
If it would help I can post an alternate version of the patch for discussion with the kittyhawk version.
Quoted 7 lines
Quoted 2 lines
Sure.
Kittyhawk version can be seen here:
http://git.kernel.org/?p=3Dlinux/kernel/git/ericvh/bluegene.git;a=3Dcommitd=
iff;h=3D94bffe786324b9bd07187b11afd836e3ec362d95
OK. I can see the secondary.
BTW I think it's buggy in a different way.
arch/powerpc/kernel/fpu.S +6 -0
@@ -51,6 +51,9 @@ _GLOBAL(load_up_fpu) toreal(r4) addi r4,r4,THREAD /* want last_task_used_math->thread */ SAVE_32FPRS(0, r4) +#ifdef CONFIG_DOUBLE_HUMMER + SAVE_32SFPRS(0, r10, r3) +#endif /* CONFIG_DOUBLE_HUMMER */ mffs fr0 stfd fr0,THREAD_FPSCR(r4) PPC_LL r5,PT_REGS(r4)
@@ -78,6 +81,9 @@ _GLOBAL(load_up_fpu) lfd fr0,THREAD_FPSCR(r5) MTFSF_L(fr0) REST_32FPRS(0, r5) +#ifdef CONFIG_DOUBLE_HUMMER + REST_32SFPRS(0, r10, r5) +#endif /* CONFIG_DOUBLE_HUMMER */
REST uses r5 as the base in both cases (primary and secondary) which is good. SAVE uses r4 in the primary case and r3 in the secondary, which is the wrong base.
Quoted 7 lines
Quoted 5 lines
The most useful thing would be to see the instruction definition for STFPDX/LFPDX.
stfpdx does Primary->DW[EA] Secondary->DW[EA+8]
I'm tempted to continue to use this and store the data in 'fpr' in the thread_struct. Doing it this way the primary register will continue to be in the same location as before, which will mean ptrace etc will continue to work at least for the primary. The secondary will be accessible using ptrace etc as well, but it'll be a bit of kludge because it'll appear in the VSX location.
Putting the secondary register in a new area in the thread struct will mean it's totally inaccessible for debugging without extra code in ptrace.c/signals.c etc
We are going to need 16x spacing but you are doing to have to increase the size using TS_FPRWIDTH = 2.
Quoted 37 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
arch/powerpc/platfo=
Quoted 3 lines
=3DA0/*
arch/powerpc/platfo= renamed from arch/powerpc/platforms/44x/Kconfig +0
-0rms=3D
Quoted 8 lines
Quoted 8 lines
/44x/
Quoted 7 lines
KconfigQuoted 6 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +0
-0@@ -169,6 +169,15 @@ config YOSEMITE=3DA0 =3DA0 =3DA0 help
=3DA0 =3DA0 =3DA0 =3DA0 This option enables support for the AMCC PPC4=40EP evalua=3D
Quoted 5 lines
Quoted 5 lines
tion board.
Quoted 4 lines
Quoted 2 lines
+config =3DA0 =3DA0 =3DA0 BGP
Does this FPU feature have a specific name like double hammer? =3DA0I'=
d
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
rather have the BGP defconfig depend on
PPC_FPU_DOUBLE_HUMMER, or something like that...Quoted 5 lines
+ =3DA0 =3DA0 bool "Blue Gene/P"
+ =3DA0 =3DA0 depends on 44x
+ =3DA0 =3DA0 default n
+ =3DA0 =3DA0 selectPPC_FPU
+ =3DA0 =3DA0 selectPPC_DOUBLE_FPUQuoted 5 lines
Quoted 5 lines
Quoted 3 lines
... in fact, it seem you are doing something like these here but you don't use
PPC_DOUBLE_FPUanywhere?A fair point. =A0I'm fine with calling it
DOUBLE_HUMMER, but I wasn't su=re if
Quoted 3 lines
Quoted 2 lines
that was "too internal" of a name for the kernel. =A0Let me know and I'll fix it up.
Quoted 8 lines
Quoted 5 lines
What I'm mostly concerned about is disassociating it with a particular CPU.
If it has an external name, then all the better.
Since it isn't available on other chips, shoudl it just be
PPC_BGP_FPUorPPC_BGP_DOUBLE_FPU?
I'd probably still prefer it disassociated with the CPU name, but we are really bike shedding here. I'm not too fussed.
Mikey
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
Quoted 12 lines · Michael Neuling
Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 1 line · Michael Neuling
In message <[email protected]> you wrote=
:
Quoted 1 line
Quoted 1 line
On Thu, May 19, 2011 at 12:58 AM, Michael Neuling <[email protected]> wr=
ote=3D
Quoted 6 lines
Quoted 6 lines
:
Quoted 5 lines
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
What does this mean? =3DA0Needs more details here.
okay, I've changed it a bit in [V2], if you want more I can do my best.
If you can describe the whole primary and secondary registers that'd be cool. ASCII art would be awesome! :-)
You sure you don't just want a bitfield.conf? :) I'll do my best, but my ASCII art isn't what it used to be. I'll also include a reference to the PDF.
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Ok, sounds like there is 32*8*2 bytes of data, rather than the normal 32*8 bytes for FP only (ignoring VSX). =A0If this is the case, then you'l=
l
Quoted 3 lines
need make 'fpr' in the thread struct bigger which you can do by setting
TS_FPRWIDTH=3D 2 like we do for VSX.
Okay - so basically what I have now and TS_FPRWIDTH=2 ?
Quoted 7 lines
Quoted 3 lines
Since it isn't available on other chips, shoudl it just be
PPC_BGP_FPUorPPC_BGP_DOUBLE_FPU?I'd probably still prefer it disassociated with the CPU name, but we are really bike shedding here. I'm not too fussed.
I'll leave it separate and switch it to PPC_FP2 (or would you prefer PPC_FP2_FPU to make it clear) since the public PDF refers to it this way.
If that all sounds good, I'll spin [V3] tomorrow.
-eric
Re: [PATCH 2/7] [RFC] add bluegene entry to cputable
In reply to Eric Van HensbergenQuoted 14 lines · Eric Van Hensbergen
Signed-off-by Eric Van Hensbergen <[email protected]>--- arch/powerpc/kernel/cputable.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)arch/powerpc/kernel/cputable.c +1
-0@@ -1732,6 +1732,20 @@ static struct cpu_spec __initdata cpu_specs[] = { .machine_check = machine_check_440A, .platform = "ppc440", }, + {/* Blue Gene/P */
arch/powerpc/kernel/cputable.c static struct cpu_spec __initdata cpu_specs[] = { · line 1745
Quoted 10 lines
arch/powerpc/kernel/cputable.c +10
-0+ .pvr_mask = 0xfffffff0, + .pvr_value = 0x52131880, + .cpu_name = "450 Blue Gene/P", + .cpu_features = CPU_FTRS_440x6, + .cpu_user_features =COMMON_USER_BOOKE | + PPC_FEATURE_HAS_FPU, + .mmu_features = MMU_FTR_TYPE_44x, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_460gt,
^^^^^^^^^^^^^^^^^^
Are you sure ?
Cheers,
Ben.
Quoted 6 lines
arch/powerpc/kernel/cputable.c +3
-0+ .machine_check = machine_check_440A, + .platform = "ppc440", + }, {/* 460EX */ .pvr_mask = 0xffff0006, .pvr_value = 0x13020002,
Re: [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Eric Van HensbergenQuoted 13 lines · Eric Van Hensbergen
For BGP, it is convenient for 'kmalloc' to come back with 32-byte aligned units for torus DMA
Signed-off-by Eric Van Hensbergen <[email protected]>--- arch/powerpc/include/asm/page_32.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/powerpc/include/asm/page_32.h +0
-0
arch/powerpc/include/asm/page_32.h line 14
Quoted 7 lines
arch/powerpc/include/asm/page_32.h +1
-1@@ -9,7 +9,7 @@#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 -#ifdef CONFIG_NOT_COHERENT_CACHE +#if defined(CONFIG_NOT_COHERENT_CACHE ) || defined(CONFIG_BGP )#define ARCH_DMA_MINALIGN L1_CACHE_BYTES#endif
Is DMA cache coherent on BG/P ? That's odd for a 4xx base :-)
Cheers,
Ben.
Re: [PATCH 6/7] [RFC] enable early TLBs for BG/P
In reply to Eric Van HensbergenQuoted 1 line · Eric Van Hensbergen
BG/P maps firmware with an early TLB
That's a bit gross. How often do you call that firmware in practice ? Aren't you better off instead inserting a TLB entry for it when you call it instead ? A simple tlbsx. + tlbwe sequence would do. That would free up a TLB entry for normal use.
Cheers,
Ben.
Quoted 23 lines
Signed-off-by Eric Van Hensbergen <[email protected]>--- arch/powerpc/include/asm/mmu-44x.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)arch/powerpc/include/asm/mmu-44x.h +5
-1@@ -115,8 +115,12 @@ typedef struct {#endif /* !__ASSEMBLY__ */ #ifndef CONFIG_PPC_EARLY_DEBUG_44x +#ifndef CONFIG_BGP #define PPC44x_EARLY_TLBS 1 -#else +#else /* CONFIG_BGP */ +#define PPC44x_EARLY_TLBS 2 +#endif /* CONFIG_BGP */ +#else /* CONFIG_PPC_EARLY_DEBUG_44x */ #define PPC44x_EARLY_TLBS 2#define PPC44x_EARLY_DEBUG_VIRTADDR (ASM_CONST(0xf0000000) \ | (ASM_CONST(CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW) & 0xffff))
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Eric Van HensbergenQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
What does this mean? =3DA0Needs more details here.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
okay, I've changed it a bit in [V2], if you want more I can do my best.
If you can describe the whole primary and secondary registers that'd be cool. =A0ASCII art would be awesome! :-)
You sure you don't just want a bitfield.conf? :)
hehe, maybe an interpretive dance video posted on youtube?
Quoted 2 lines
I'll do my best, but my ASCII art isn't what it used to be. I'll also include a reference to the PDF.
Something self contained in the comments would be great as external links tend to disappear.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Ok, sounds like there is 32*8*2 bytes of data, rather than the normal 32*8 bytes for FP only (ignoring VSX). If this is the case, then you'll need make 'fpr' in the thread struct bigger which you can do by setting
TS_FPRWIDTH= 2 like we do for VSX.Okay - so basically what I have now and TS_FPRWIDTH=2 ?
Yes.
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines
Since it isn't available on other chips, shoudl it just be
PPC_BGP_FPUorPPC_BGP_DOUBLE_FPU?I'd probably still prefer it disassociated with the CPU name, but we are really bike shedding here. =A0I'm not too fussed.
I'll leave it separate and switch it to
PPC_FP2(or would you preferPPC_FP2_FPUto make it clear) since the public PDF refers to it this way.
PPC_FPU_FP2 would be my vote.
Quoted 1 line
If that all sounds good, I'll spin [V3] tomorrow.
Thanks!
Mikey
Re: [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Benjamin HerrenschmidtQuoted 9 lines · Benjamin Herrenschmidt
Quoted 5 lines · Eric Van Hensbergen
arch/powerpc/include/asm/page_32.h +1
-1-#ifdef CONFIG_NOT_COHERENT_CACHE +#if defined(CONFIG_NOT_COHERENT_CACHE ) || defined(CONFIG_BGP )#define
ARCH_DMA_MINALIGNL1_CACHE_BYTES
#endifIs DMA cache coherent on BG/P ? That's odd for a 4xx base :-)
My understanding of things (which could be totally wrong) is that the DMA we care about on BG/P (namely the Torus and Collective networks) is coherent at the L2. Of course the change in question is talking about L1_CACHE_BYTES, so my reading of this is that its a sleazy way of getting aligned mallocs that make interactions with the tightly coupled networks easier/more-efficient. I'm open to alternative suggestions.
-eric
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Michael NeulingQuoted 28 lines · Michael Neuling
Quoted 13 lines
arch/powerpc/include/asm/ppc_asm.h +1
-5+#define SAVE_2GPRS (n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)#define SAVE_4GPRS (n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)#define SAVE_8GPRS (n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)@@ -97,18 +104,26 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)#define REST_8GPRS (n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)#define REST_10GPRS (n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) -#define SAVE_FPR (n, base) stfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define SAVE_2FPRS (n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) -#define SAVE_4FPRS (n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) -#define SAVE_8FPRS (n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base) -#define SAVE_16FPRS (n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 109
Quoted 10 lines
arch/powerpc/include/asm/ppc_asm.h +3
-7-#define SAVE_32FPRS (n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base) -#define REST_FPR (n, base) lfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base) -#define REST_2FPRS (n, base) REST_FPR(n, base); REST_FPR(n+1, base) -#define REST_4FPRS (n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base) -#define REST_8FPRS (n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base) -#define REST_16FPRS (n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) -#define REST_32FPRS (n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) +#ifdef CONFIG_BGP +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b)16*? Are these FP regs 64 or 128 bits wide? If 128 you are doing to have to play with
TS_WIDTHto get the size of the FPs correct in thethread_struct.
Quoted 1 line
I think there's a bug here.
Regardless of that, btw, I don't think it's very sane to change those macros that way. I'd rather have a separate set to save/restore the BG stuff and separate code alltogether for loading/saving/flushing/etc... like FSP SPE. The FPU save/restore code is already too complex as it is.
Also, should we aim to have this co-exist with other 4xx platforms in a multiplatform kernel ? In that case it should not break the normal FP case. Feel free to use CPU feature bits, there are 2 or 3 left available in the 32-bit space, maybe pick a "combo" one for BGP (or one for hummer and a MMU bit for the odd SMP tricks).
Hrm... thinking of which, what about doing it using the alternate feature section ? This allows two "alternate" piece of codes to overlay, the kernel will replace the original one with the alternative one if the feature bits match. That way you can just stick an alternate around SAVE/REST_32FPRS that replace them with your new SAVE/REST_32HFPRS (or whatever you want to call you new set of macros).
Of course you'll probably need a separate area in the thread struct/pt_regs etc... which mean a userspace ABI change, a change of the sig context etc etc ....
Cheers,
Ben.
Re: [PATCH 3/7] [RFC] add support for BlueGene/P FPU
In reply to Eric Van HensbergenQuoted 6 lines · Eric Van Hensbergen
Quoted 5 lines · Michael Neuling
Eric,
Quoted 2 lines
This patch adds save/restore register support for the BlueGene/P double hummer FPU.
Quoted 8 lines
Quoted 2 lines
What does this mean? Needs more details here.
Hi Mikey,
any specific details you are looking for here? AFAIK these patches are required for the kernel to save/restore the double hummer properly.
A description of the double hummer would be good.
Cheers,
Ben.
Quoted 82 lines
Quoted 11 lines
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 96
Quoted 7 lines
arch/powerpc/include/asm/ppc_asm.h +6
-0+#ifdef CONFIG_BGP +#define LFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(462<<1) +#define STFPDX (frt, ra, rb) .long (31<<26)|((frt)<<21)|((ra)<<16)| \ + ((rb)<<11)|(974<<1) +#endif /* CONFIG_BGP */ Put these in
arch/powerpc/include/asm/ppc-opcode.hand reformat to fit whats there already.Quoted 2 lines
Also, don't need to put these defines inside a #ifdef.
Sure, I'll fix that up.
Quoted 10 lines
arch/powerpc/include/asm/ppc_asm.h END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) · line 109
Quoted 3 lines
arch/powerpc/include/asm/ppc_asm.h +3
-0+#ifdef CONFIG_BGP +#define SAVE_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); STFPDX(n, base, b) +#define REST_FPR (n, b, base) li b, THREAD_FPR0+(16*(n)); LFPDX(n, base, b)16*? Are these FP regs 64 or 128 bits wide? If 128 you are doing to have to play with
TS_WIDTHto get the size of the FPs correct in thethread_struct.I think there's a bug here.
I actually have three different versions of this code from different source patches that I'm drawing from - so your help in figuring out the best way to approach this is appreciated. The kittyhawk version of the code has 8* instead of 16*. According to the docs:
"Each of the two FPU units contains 32 64-bit floating point registers for a total of 64 FP registers per processor." which would seem to point to the kittyhawk version - but they have a secondSAVE_32SFPRSfor the second hummer. What wasn't clear to me with this version of the code was whether or not they were doing something clever like saving the pair of the 64-bit FPU registers in a single 128-bit slot (seems plausible). If this is not the way to go, I can certainly switch the kittyhawk version of the patch with the *, the extra SAVE32SFPR and the extra double hummer specific storage space in thethread_struct. If it would help I can post an alternate version of the patch for discussion with the kittyhawk version.Quoted 16 lines
arch/powerpc/platforms/44x/
Quoted 2 lines
/*
arch/powerpc/platforms/44x/ renamed from arch/powerpc/platforms/44x/Kconfig +0
-0
Kconfigarch/powerpc/platforms/44x/Kconfig config YOSEMITE · line 172
Quoted 8 lines
index f485fc5f..24a515e 100644
arch/powerpc/platforms/44x/Kconfig +1
-0@@ -169,6 +169,15 @@ config YOSEMITE help This option enables support for the AMCC PPC440EP evaluation board. +config BGPDoes this FPU feature have a specific name like double hammer? I'd rather have the BGP defconfig depend on
PPC_FPU_DOUBLE_HUMMER, or something like that...Quoted 9 lines
arch/powerpc/platforms/44x/Kconfig config YOSEMITE · line 177
Quoted 5 lines
arch/powerpc/platforms/44x/Kconfig +5
-0+ bool "Blue Gene/P" + depends on 44x + default n + select PPC_FPU + select PPC_DOUBLE_FPU... in fact, it seem you are doing something like these here but you don't use
PPC_DOUBLE_FPUanywhere?A fair point. I'm fine with calling it
DOUBLE_HUMMER, but I wasn't sure if that was "too internal" of a name for the kernel. Let me know and I'll fix it up.
I'll also change theCONFIG_BGPdefines in the FPU code toPPC_DOUBLE_FPUorPPC_DOUBLE_HUMMERdepending on what the community decides.Thanks for the feedback!
-eric
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/7] [RFC] enable L1_WRITETHROUGH mode for BG/P
In reply to Eric Van HensbergenQuoted 18 lines · Eric Van Hensbergen
BG/P nodes need to be configured for writethrough to work in SMP configurations. This patch adds the right hooks in the MMU code to make sure
L1_WRITETHROUGHconfigurations are setup for BG/P./* Storage attribute and access control fields */
#definePPC44x_TLB_ATTR_MASK0x0000ff80arch/powerpc/include/asm/mmu-44x.h +1
-0+#define PPC44x_TLB_WL1 0x00100000/* Write-through L1 */ #define PPC44x_TLB_U0 0x00008000/* User 0 */ #define PPC44x_TLB_U1 0x00004000/* User 1 */ #define PPC44x_TLB_U2 0x00002000/* User 2 */ arch/powerpc/kernel/head_44x.S +0
-0@@ -429,7 +429,16 @@ finish_tlb_load_44x: andi. r10,r12,_PAGE_USER /* User page ? */ beq 1f /* nope, leave U bits empty */ rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
arch/powerpc/kernel/head_44x.S finish_tlb_load_44x: · line 440
Quoted 10 lines
arch/powerpc/kernel/head_44x.S +9
-1-1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ +1: +#ifdef CONFIG_L1_WRITETHROUGH + andi. r10, r11, PPC44x_TLB_I + bne 2f + oris r11,r11,PPC44x_TLB_WL1@h /* Add coherency for */ + /* non-inhibited */ + ori r11,r11,PPC44x_TLB_U2|PPC44x_TLB_M +2: +#endif /* CONFIG_L1_WRITETHROUGH */
Make it an MMU feature so it's done at runtime rather than compile time.
Also, you should aim toward avoiding that conditional branch in such a critical hot path :-) A way to do so would be to shove these in the PTE instead, there's plenty of unused bits in the top part for example.
Quoted 44 lines
arch/powerpc/kernel/head_44x.S +13
-1+ tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */ /* Done...restore registers and get out of here. */@@ -799,7 +808,11 @@ skpinv: addi r4,r4,1 /* Increment */ sync /* Initialize MMUCR */ +#ifdef CONFIG_L1_WRITETHROUGH + lis r5, PPC44x_MMUCR_U2@h +#else li r5,0 +#endif /* CONFIG_L1_WRITETHROUGH */ mtspr SPRN_MMUCR,r5 sync@@ -814,7 +827,14 @@ skpinv: addi r4,r4,1 /* Increment */ /* attrib fields */ /* Added guarded bit to protect against speculative loads/stores */ li r5,0 - ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G) +#ifdef CONFIG_L1_WRITETHROUGH + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G | PPC44x_TLB_U2) + oris r5,r5,PPC44x_TLB_WL1@h +#else + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | \ + PPC44x_TLB_G) +#endif /* CONFIG_L1_WRITETHROUGH li r0,63 /* TLB slot 63 */arch/powerpc/kernel/misc_32.S +4
-0@@ -506,7 +506,20 @@ _GLOBAL(clear_pages) li r0,PAGE_SIZE/L1_CACHE_BYTES slw r0,r0,r4 mtctr r0 +#ifdef CONFIG_L1_WRITETHROUGH + /* assuming 32 byte cacheline */ + li r4, 0 +1: stw r4, 0(r3)
arch/powerpc/kernel/misc_32.S _GLOBAL(clear_pages) · line 522
Quoted 10 lines
arch/powerpc/kernel/misc_32.S +9
-0+ stw r4, 4(r3) + stw r4, 8(r3) + stw r4, 12(r3) + stw r4, 16(r3) + stw r4, 20(r3) + stw r4, 24(r3) + stw r4, 28(r3) +#else 1: dcbz 0,r3 +#endif /* CONFIG_L1_WRITETHROUGH */
wtf ? dcbz doesn't work ? yuck ! This isn't a HW design, it's a hack :-)
make it an mmu feature btw, as I said, I'd like to keep it a unified kernel.
Quoted 102 lines
arch/powerpc/kernel/misc_32.S +2
-0addi r3,r3,L1_CACHE_BYTES bdnz 1b blr@@ -550,7 +563,9 @@ _GLOBAL(copy_page) mtctr r0 1: dcbt r11,r4 +#ifndef CONFIG_L1_WRITETHROUGH dcbz r5,r3 +#endif COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTESarch/powerpc/lib/copy_32.S +10
-0@@ -98,7 +98,11 @@ _GLOBAL(cacheable_memzero) bdnz 4b 3: mtctr r9 li r7,4 +#ifdef CONFIG_L1_WRITETHROUGH +10: +#else 10: dcbz r7,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ addi r6,r6,CACHELINE_BYTES bdnz 10b clrlwi r5,r8,32-LG_CACHELINE_BYTES@@ -187,7 +191,9 @@ _GLOBAL(cacheable_memcpy) mtctr r0 beq 63f 53: +#ifndef CONFIG_L1_WRITETHROUGH dcbz r11,r6 +#endif /* CONFIG_L1_WRITETHROUGH */ COPY_16_BYTES #if L1_CACHE_BYTES >= 32 COPY_16_BYTES@@ -368,7 +374,11 @@ _GLOBAL(__copy_tofrom_user) mtctr r8 53: dcbt r3,r4 +#ifdef CONFIG_L1_WRITETHROUGH +54: +#else 54: dcbz r11,r6 +#endif .section __ex_table,"a" .align 2 .long 54b,105farch/powerpc/mm/44x_mmu.c +5
-2@@ -80,9 +80,12 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys) :#ifdef CONFIG_PPC47x : "r" (PPC47x_TLB2_S_RWX), -#else +#elseif CONFIG_L1_WRITETHROUGH + : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_WL1 \ + | PPC44x_TLB_U2 | PPC44x_TLB_M), +#else /* neither CONFIG_PPC47x or CONFIG_L1_WRITETHROUGH */ : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), -#endif +#endif /* CONFIG_PPC47x */ "r" (phys),"r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M), "r" (entry),arch/powerpc/platforms/Kconfig +5
-0@@ -348,4 +348,9 @@ config XILINX_PCI bool "Xilinx PCI host bridge support" depends on PCI && XILINX_VIRTEX +config L1_WRITETHROUGH + bool "Blue Gene/P enabled writethrough mode" + depends on BGP + default y + endmenuarch/powerpc/platforms/Kconfig.cputype +4
-0@@ -329,9 +329,13 @@ config NOT_COHERENT_CACHE bool depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON default n if PPC_47x + default n if BGP default y config CHECK_CACHE_COHERENCY bool +config L1_WRITETHROUGH + bool + endmenu
Re: [PATCH 7/7] [RFC] SMP support code
In reply to Eric Van Hensbergenarch/powerpc/mm/fault.c static int store_updates_sp(struct pt_regs *regs)
Quoted 13 lines · Eric Van Hensbergen
arch/powerpc/mm/fault.c +13
-0+#ifdef CONFIG_BGP +/* +* The icbi instruction does not broadcast to all cpus in the ppc450 +* processor used by Blue Gene/P. It is unlikely this problem will +* be exhibited in other processors so this remains ifdef'ed for BGP +* specifically. +* +* We deal with this by marking executable pages either writable, or +* executable, but never both. The permissions will fault back and +* forth if the thread is actively writing to executable sections. +* Each time we fault to become executable we flush the dcache into +* icache on all cpus. +*
I know that hack :-) I think I wrote it even (or a version of it, that was a long time ago) ;-) That doesn't make it pretty tho ...
Quoted 32 lines
arch/powerpc/mm/fault.c +30
-0+struct bgp_fixup_parm { +struct page *page; +unsigned long address; +struct vm_area_struct *vma; +}; + +static void bgp_fixup_cache_tlb (void *parm) +{ +struct bgp_fixup_parm *p = parm; + +if (!PageHighMem (p->page)) +flush_dcache_icache_page (p->page); +local_flush_tlb_page (p->vma, p->address); +} + +static void bgp_fixup_access_perms (struct vm_area_struct *vma, +unsigned long address, +int is_write,int is_exec) +{ +struct mm_struct *mm = vma->vm_mm; +pte_t *ptep =NULL ; +pmd_t *pmdp; + +if (get_pteptr (mm, address, &ptep, &pmdp)) { +spinlock_t *ptl =pte_lockptr (mm, pmdp); +pte_t old; + +spin_lock (ptl); + old = *ptep; +if (pte_present (old)) {
arch/powerpc/mm/fault.c static int store_updates_sp(struct pt_regs *regs) · line 158
Quoted 10 lines
arch/powerpc/mm/fault.c +10
-0+struct page *page =pte_page (old); + +if (is_exec) { +struct bgp_fixup_parm param = { + .page = page, + .address = address, + .vma = vma, + }; +pte_update (ptep, _PAGE_HWWRITE,0 ); +on_each_cpu (bgp_fixup_cache_tlb, ¶m,1 );
Gotta be very careful with on_each_cpu() done within a lock. I wonder if we could fast-path & simplify that using crits, is there a way to shoot criticial IPIs to the other cores ? Might even be able in this case to do it entirely in asm in the page fault path.
Quoted 47 lines
arch/powerpc/mm/fault.c +24
-0+pte_update (ptep,0 , _PAGE_EXEC); +pte_unmap_unlock (ptep, ptl); + return; + } +if (is_write && + (pte_val (old) & _PAGE_RW) && + (pte_val (old) & _PAGE_DIRTY) && + !(pte_val (old) & _PAGE_HWWRITE)) { +pte_update (ptep, _PAGE_EXEC, _PAGE_HWWRITE); + } + } +if (!pte_same (old, *ptep)) +flush_tlb_page (vma, address); +pte_unmap_unlock (ptep, ptl); + } +} +#endif /* CONFIG_BGP */ +/* * For 600- and 800-family processors, the error_code parameter is DSISR * for a data fault, SRR1 for an instruction fault. For 400-family processors @@ -333,6 +404,12 @@ good_area:perf_sw_event (PERF_COUNT_SW_PAGE_FAULTS_MIN ,1 ,0 , regs, address); } + +#ifdef CONFIG_BGP +/* Fixup _PAGE_EXEC and _PAGE_HWWRITE if necessary */ +bgp_fixup_access_perms (vma, address, is_write, is_exec); +#endif /* CONFIG_BGP */ +up_read (&mm->mmap_sem);return 0 ;arch/powerpc/platforms/Kconfig.cputype +1
-1@@ -300,7 +300,7 @@ config PPC_PERF_CTRS This enables the powerpc-specific perf_event back-end. config SMP - depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x + depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE || PPC_47x || BGP bool "Symmetric multi-processing support" ---help--- This enables support for systems with more than one CPU. If you have
Re: [PATCH 2/7] [RFC] add bluegene entry to cputable
In reply to Benjamin HerrenschmidtQuoted 6 lines · Benjamin Herrenschmidt
Quoted 2 lines · Eric Van Hensbergen
+ .dcache_bsize = 32,
+ .cpu_setup =__setup_cpu_460gt,^^^^^^^^^^^^^^^^^^ Are you sure ?
That surprised me too, I figured it must have been a close enough match (at least in the 2.6.29.1 time frame which is where I'm trying to merge the BG/P patches up from. The kittyhawk patches don't even use this, so its possible we could just remove it.
_GLOBAL(__setup_cpu_460ex)_GLOBAL(__setup_cpu_460gt)
mflr r4
bl __init_fpu_44x
bl __fixup_440A_mcheck
mtlr r4blr
Looks like the 460 setup invokes a bunch of 440 calls! Would you prefer I setup my own entry point (setup_cpu_bgp or setup_cpu_450) which makes the same calls?
-eric
Re: [PATCH 6/7] [RFC] enable early TLBs for BG/P
In reply to Benjamin HerrenschmidtQuoted 8 lines · Benjamin Herrenschmidt
Quoted 1 line · Eric Van Hensbergen
BG/P maps firmware with an early TLB
That's a bit gross. How often do you call that firmware in practice ? Aren't you better off instead inserting a TLB entry for it when you call it instead ? A simple tlbsx. + tlbwe sequence would do. That would free up a TLB entry for normal use.
Well, it depends on who you talk to. The production software BG/P guys use the firmware
constantly, its the primary interface to the networks, the console, and the management software
which runs the machine. As such the IO Node guys, the Compute Node Kernel guys and the
ZeptoOS guys use it quite a bit. The kittyhawk guys on the other hand barely use it at all, in fact
I believe they do all the interaction with it during uboot and then shut it off.
IIRC, the sticky question is RAS support, there are certain things it wants to jump to firmware
to deal with and expects things to be mapped an pinned into memory. Furthermore, I think it
may make assumptions about where in the TLB the mappings are. Since the kittyhawk guys
obviously ignore this by shutting it down, its not clear just how important this is. I'm game to
try the dynamic mapping as you suggest if you would prefer it.
Its worth mentioning that I believe with BG/Q, the plan is to rely on the firmware even more
extensively, but I haven't looked at any of the code yet to verify whether or not this is true.
-eric
Re: [bg-linux] [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Benjamin HerrenschmidtQuoted 16 lines · Benjamin Herrenschmidt
Quoted 14 lines · Eric Van Hensbergen
For BGP, it is convenient for 'kmalloc' to come back with 32-byte aligned units for torus DMA
Signed-off-by Eric Van Hensbergen<[email protected]>--- arch/powerpc/include/asm/page_32.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/powerpc/include/asm/page_32.h +0
-0@@ -9,7 +9,7 @@
Quoted 9 lines
arch/powerpc/include/asm/page_32.h line 15
Quoted 7 lines
arch/powerpc/include/asm/page_32.h +1
-1#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 -#ifdef CONFIG_NOT_COHERENT_CACHE +#if defined(CONFIG_NOT_COHERENT_CACHE ) || defined(CONFIG_BGP )#define ARCH_DMA_MINALIGN L1_CACHE_BYTES#endif Is DMA cache coherent on BG/P ? That's odd for a 4xx base :-)
Actually DMA sends invalidate requests to the snoop unit(L2 level). BGP SoC is a bit different from other 4xx base.
Some details can be found in
www.scc.acad.bg/documentation/team.pdf
- kaz
Quoted 11 lines
Cheers,
Ben._______________________________________________
bg-linux mailing list
[email protected]
https://lists.anl-external.org/mailman/listinfo/bg-linux
http://bg-linux.anl-external.org/wiki
Re: [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Eric Van HensbergenQuoted 12 lines · Eric Van Hensbergen
Quoted 9 lines · Benjamin Herrenschmidt
arch/powerpc/include/asm/page_32.h line 14
Quoted 5 lines · Eric Van Hensbergen
arch/powerpc/include/asm/page_32.h +1
-1-#ifdef CONFIG_NOT_COHERENT_CACHE +#if defined(CONFIG_NOT_COHERENT_CACHE ) || defined(CONFIG_BGP )#define ARCH_DMA_MINALIGN L1_CACHE_BYTES#endif Is DMA cache coherent on BG/P ? That's odd for a 4xx base :-)
Quoted 7 lines
My understanding of things (which could be totally wrong) is that the DMA we care about on BG/P (namely the Torus and Collective networks) is coherent at the L2. Of course the change in question is talking about
L1_CACHE_BYTES, so my reading of this is that its a sleazy way of getting aligned mallocs that make interactions with the tightly coupled networks easier/more-efficient. I'm open to alternative suggestions.
But if it's not coherent with L1, then you sould have CONFIG_NOT_COHERENT_CACHE set and not need that patch... or am I missing something ?
One thing we should do some day as well is make that whole non-coherent be runtime selected, on the list of things to fix 440+47x in the same kernel. Pfiew....
Cheers,
Ben.
Re: [PATCH 2/7] [RFC] add bluegene entry to cputable
In reply to Eric Van HensbergenQuoted 20 lines · Eric Van Hensbergen
Quoted 6 lines · Benjamin Herrenschmidt
arch/powerpc/kernel/cputable.c static struct cpu_spec __initdata cpu_specs[] = { · line 1745
Quoted 2 lines · Eric Van Hensbergen
arch/powerpc/kernel/cputable.c +2
-0+ .dcache_bsize = 32, + .cpu_setup = __setup_cpu_460gt,^^^^^^^^^^^^^^^^^^Are you sure ?
That surprised me too, I figured it must have been a close enough match (at least in the 2.6.29.1 time frame which is where I'm trying to merge the BG/P patches up from. The kittyhawk patches don't even use this, so its possible we could just remove it.
_GLOBAL(__setup_cpu_460ex)_GLOBAL(__setup_cpu_460gt)mflr r4 bl __init_fpu_44x bl __fixup_440A_mcheck mtlr r4
Quoted 5 lines
blr
Looks like the 460 setup invokes a bunch of 440 calls! Would you prefer I setup my own entry point (
setup_cpu_bgporsetup_cpu_450) which makes the same calls?
Yes, add an entry. 460's are just 440's btw :-)
Cheers,
Ben.
Re: [PATCH 6/7] [RFC] enable early TLBs for BG/P
In reply to Eric Van HensbergenQuoted 11 lines · Eric Van Hensbergen
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 1 line · Eric Van Hensbergen
BG/P maps firmware with an early TLB
That's a bit gross. How often do you call that firmware in practice ? Aren't you better off instead inserting a TLB entry for it when you call it instead ? A simple tlbsx. + tlbwe sequence would do. That would free up a TLB entry for normal use.
Quoted 3 lines
Well, it depends on who you talk to. The production software BG/P
guys use the firmware constantly, its the primary interface to the networks, the console, and the management software which runs the machine.
Yuck.
Quoted 4 lines
As such the IO Node guys, the Compute Node Kernel guys and the ZeptoOS guys use it quite a bit. The kittyhawk guys on the other hand barely use it at all, in fact I believe they do all the interaction with it during uboot and then shut it off.
I would prefer that approach.
Quoted 6 lines
IIRC, the sticky question is RAS support, there are certain things it wants to jump to firmware to deal with and expects things to be mapped an pinned into memory.
Furthermore, I think it may make assumptions about where in the TLB the mappings are.
This is gross, especially on a system with only 64 SW loaded TLB entries :-(
Quoted 4 lines
Since the kittyhawk guys
obviously ignore this by shutting it down, its not clear just how important this is. I'm game to
try the dynamic mapping as you suggest if you would prefer it.
I would yes, we can sort things out later for RAS.
Quoted 3 lines
Its worth mentioning that I believe with BG/Q, the plan is to rely on
the firmware even more extensively, but I haven't looked at any of the code yet to verify whether or not this is true.
This is tantamount to linking a binary blob with the kernel ... it's a fine line. At some point we might refuse the patches if they go too far in that direction.
Cheers,
Ben.
Quoted 6 lines
-eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [bg-linux] [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Kazutomo YoshiiQuoted 3 lines · Kazutomo Yoshii
Actually DMA sends invalidate requests to the snoop unit(L2 level). BGP SoC is a bit different from other 4xx base.
Well, some other 44x also have a snooping L2 (more or less), but L1 is usually the problem.
Cheers,
Ben.
Re: [bg-linux] [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 3 lines · Kazutomo Yoshii
Actually DMA sends invalidate requests to the snoop unit(L2 level). BGP SoC is a bit different from other 4xx base.
Well, some other 44x also have a snooping L2 (more or less), but L1 is usually the problem.
Hrm... looking at the doco you pointed me to, it looks like the L1 -is- coherent, it gets snoop kills from the L2.
Ok so we do need to make this non-coherent cache stuff a runtime option (well, we need that for 440+476 too anyways so may as well do it now).
As for the alignment of kmalloc, it looks like a hack that should be done in the torus code itself.
Cheers,
Ben.
Re: [bg-linux] [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Kazutomo YoshiiQuoted 8 lines · Kazutomo Yoshii
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 5 lines · Benjamin Herrenschmidt
Quoted 3 lines · Kazutomo Yoshii
Actually DMA sends invalidate requests to the snoop unit(L2 level). BGP SoC is a bit different from other 4xx base.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Well, some other 44x also have a snooping L2 (more or less), but L1 is usually the problem.
Hrm... looking at the doco you pointed me to, it looks like the L1 -is- coherent, it gets snoop kills from the L2.
Right, L1D is coherent if write throug is set.
L1I(virtually tagged) is not coherent, btw.
Yes, I wrote the horrid hack to ping pong the pages between writable and executable afaik :-)
Quoted 4 lines
Quoted 3 lines
Ok so we do need to make this non-coherent cache stuff a runtime option (well, we need that for 440+476 too anyways so may as well do it now).
What sort of runtime option do you mean?
I've asked Tony to give it a go since he's taking over the 476 stuff. The idea is to make it a MMU feature and call into the cache flush conditionally on it rather than under the control of a ifdef.
I want it to be possible to build a unified kernel that supports multiple 44x and 47x platforms including BGP if we can make it happen.
There's still some roadblocks to support 47x and 44x in the same kernel, most notably the cache line size, but I have hopes I'll get Tony to fix them soon :-)
Cheers,
Ben.
Quoted 13 lines
- kaz
Quoted 12 lines
As for the alignment of kmalloc, it looks like a hack that should be done in the torus code itself.
Cheers,
Ben._______________________________________________
bg-linux mailing list
[email protected]
https://lists.anl-external.org/mailman/listinfo/bg-linux
http://bg-linux.anl-external.org/wiki
Re: [bg-linux] [PATCH 5/7] [RFC] force 32-byte aligned kmallocs
In reply to Benjamin HerrenschmidtQuoted 4 lines · Benjamin Herrenschmidt
Quoted 2 lines · Benjamin Herrenschmidt
On Thu, 2011-05-19 at 20:32 -0500, Kazutomo Yoshii wrote:
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Actually DMA sends invalidate requests to the snoop unit(L2 level). BGP SoC is a bit different from other 4xx base.
Well, some other 44x also have a snooping L2 (more or less), but L1 is usually the problem.
Hrm... looking at the doco you pointed me to, it looks like the L1 -is- coherent, it gets snoop kills from the L2.
Right, L1D is coherent if write throug is set.
L1I(virtually tagged) is not coherent, btw.
Quoted 3 lines
Ok so we do need to make this non-coherent cache stuff a runtime option (well, we need that for 440+476 too anyways so may as well do it now).
What sort of runtime option do you mean?
- kaz
Quoted 12 lines
As for the alignment of kmalloc, it looks like a hack that should be done in the torus code itself.
Cheers,
Ben._______________________________________________
bg-linux mailing list
[email protected]
https://lists.anl-external.org/mailman/listinfo/bg-linux
http://bg-linux.anl-external.org/wiki
Re: [bg-linux] [PATCH 6/7] [RFC] enable early TLBs for BG/P
In reply to Benjamin HerrenschmidtQuoted 15 lines · Benjamin Herrenschmidt
Quoted 13 lines · Eric Van Hensbergen
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 2 lines · Eric Van Hensbergen
BG/P maps firmware with an early TLB
That's a bit gross. How often do you call that firmware in practice ? Aren't you better off instead inserting a TLB entry for it when you call it instead ? A simple tlbsx. + tlbwe sequence would do. That would free up a TLB entry for normal use.
Quoted 6 lines
Quoted 4 lines
Well, it depends on who you talk to. The production software BG/P
guys use the firmware constantly, its the primary interface to the networks, the console, and the management software which runs the machine.Yuck.
Unfortunately, the firmware is also required:
- to configure Blue Gene Interrupt Controller(BIC)
- to configure Torus DMA unit. e.g. fifo
- to configure global interrupt (even we don't use, we need to disable some channel correctly)
- to access node personality information (node id, DDR size, HZ, etc) or maybe we can directly access SRAM? etc, etc.
Quoted 6 lines
Quoted 5 lines
As such the IO Node guys, the Compute Node Kernel guys and the ZeptoOS guys use it quite a bit. The kittyhawk guys on the other hand barely use it at all, in fact I believe they do all the interaction with it during uboot and then shut it off.
(I'm one of the ZeptoOS guys, btw)
As a regular ppc linux usage, our firmware dependency is minimum as well. However, with our HPC extension, the firmware functions are called when it configures BGP specific network hardware.
We are not planning to submit our HPC extension here anytime soon because our work is very special purpose and includes lots of dirty hack right now.
Thanks,
Kaz
Quoted 48 lines
I would prefer that approach.
Quoted 7 lines
IIRC, the sticky question is RAS support, there are certain things it wants to jump to firmware to deal with and expects things to be mapped an pinned into memory.
Furthermore, I think it may make assumptions about where in the TLB the mappings are.
This is gross, especially on a system with only 64 SW loaded TLB entries :-(
Quoted 5 lines
Since the kittyhawk guys
obviously ignore this by shutting it down, its not clear just how important this is. I'm game to
try the dynamic mapping as you suggest if you would prefer it.I would yes, we can sort things out later for RAS.
Quoted 4 lines
Its worth mentioning that I believe with BG/Q, the plan is to rely on
the firmware even more extensively, but I haven't looked at any of the code yet to verify whether or not this is true.This is tantamount to linking a binary blob with the kernel ... it's a fine line. At some point we might refuse the patches if they go too far in that direction.
Cheers,
Ben.Quoted 7 lines
-eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/_______________________________________________
bg-linux mailing list
[email protected]
https://lists.anl-external.org/mailman/listinfo/bg-linux
http://bg-linux.anl-external.org/wiki
Re: [bg-linux] [PATCH 6/7] [RFC] enable early TLBs for BG/P
Quoted 2 lines
Unfortunately, the firmware is also required:
- to configure Blue Gene Interrupt Controller(BIC)
Can't we just write bare metal code for that ?
Quoted 1 line
- to configure Torus DMA unit. e.g. fifo
Same
Quoted 2 lines
- to configure global interrupt (even we don't use, we need to disable some channel correctly)
Same
Quoted 2 lines
- to access node personality information (node id, DDR size, HZ, etc) or maybe we can directly access SRAM?
That should be turned into device-tree at boot, possibly from a bootloader or from the zImage wrapper.
Quoted 9 lines
etc, etc.
Quoted 6 lines
Quoted 5 lines
As such the IO Node guys, the Compute Node Kernel guys and the ZeptoOS guys use it quite a bit. The kittyhawk guys on the other hand barely use it at all, in fact I believe they do all the interaction with it during uboot and then shut it off.
(I'm one of the ZeptoOS guys, btw)
Heh ok.
Quoted 7 lines
As a regular ppc linux usage, our firmware dependency is minimum as well. However, with our HPC extension, the firmware functions are called when it configures BGP specific network hardware.
We are not planning to submit our HPC extension here anytime soon because our work is very special purpose and includes lots of dirty hack right now.
Ok.
Cheers,
Ben.
Quoted 50 lines
Thanks,
KazQuoted 48 lines
I would prefer that approach.
Quoted 7 lines
IIRC, the sticky question is RAS support, there are certain things it wants to jump to firmware to deal with and expects things to be mapped an pinned into memory.
Furthermore, I think it may make assumptions about where in the TLB the mappings are.
This is gross, especially on a system with only 64 SW loaded TLB entries :-(
Quoted 5 lines
Since the kittyhawk guys
obviously ignore this by shutting it down, its not clear just how important this is. I'm game to
try the dynamic mapping as you suggest if you would prefer it.I would yes, we can sort things out later for RAS.
Quoted 4 lines
Its worth mentioning that I believe with BG/Q, the plan is to rely on
the firmware even more extensively, but I haven't looked at any of the code yet to verify whether or not this is true.This is tantamount to linking a binary blob with the kernel ... it's a fine line. At some point we might refuse the patches if they go too far in that direction.
Cheers,
Ben.Quoted 7 lines
-eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/_______________________________________________
bg-linux mailing list
[email protected]
https://lists.anl-external.org/mailman/listinfo/bg-linux
http://bg-linux.anl-external.org/wiki
Re: [bg-linux] [PATCH 6/7] [RFC] enable early TLBs for BG/P
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 5 lines
Unfortunately, the firmware is also required:
- to configure Blue Gene Interrupt Controller(BIC)
- to configure Torus DMA unit. e.g. fifo
- to configure global interrupt (even we don't use, we need to disable some channel correctly)Can't we just write bare metal code for that ?
The kittyhawk code has the bare-metal equivalents for all of these. When I get to the drivers, I'll favor the kittyhawk versions for submission and then we'll see if it would be possible to adapt the HPC extensions to use the bare-metal versions of the drivers versus the firmware interface.
Quoted 6 lines
Quoted 2 lines
- to access node personality information (node id, DDR size, HZ, etc) or maybe we can directly access SRAM?
That should be turned into device-tree at boot, possibly from a bootloader or from the zImage wrapper.
This is the approach is used by the kittyhawk u-boot approach. However, it would also be just as easy to construct an in-memory device-tree within Linux by mapping the personality page and copying the relevant bits out. This has the advantage of being able to boot Linux directly on the nodes without an intermediary boot loader (which kittyhawk uses just to allow us customize which kernel boots on a node-to-node basis whereas the stock system boots the same kernel on all the nodes within a partition allocation (64-40,000 nodes)).
-eric
Re: [bg-linux] [PATCH 6/7] [RFC] enable early TLBs for BG/P
Quoted 8 lines · Eric Van Hensbergen
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 5 lines
Unfortunately, the firmware is also required:
- to configure Blue Gene Interrupt Controller(BIC)
- to configure Torus DMA unit. e.g. fifo
- to configure global interrupt (even we don't use, we need to disable some channel correctly)
Quoted 8 lines
Quoted 2 lines
Can't we just write bare metal code for that ?
The kittyhawk code has the bare-metal equivalents for all of these. When I get to the drivers, I'll favor the kittyhawk versions for submission and then we'll see if it would be possible to adapt the HPC extensions to use the bare-metal versions of the drivers versus the firmware interface.
Ok. We can also start with using the FW and then migrate to bare metal.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
- to access node personality information (node id, DDR size, HZ, etc) or maybe we can directly access SRAM?
That should be turned into device-tree at boot, possibly from a bootloader or from the zImage wrapper.
Quoted 8 lines
This is the approach is used by the kittyhawk u-boot approach. However, it would also be just as easy to construct an in-memory device-tree within Linux by mapping the personality page and copying the relevant bits out. This has the advantage of being able to boot Linux directly on the nodes without an intermediary boot loader (which kittyhawk uses just to allow us customize which kernel boots on a node-to-node basis whereas the stock system boots the same kernel on all the nodes within a partition allocation (64-40,000 nodes)).
We can do that from the zImage wrapper... that would be nicer than doing it from the kernel itself unless there's good reasons to do so like iSeries.
Cheers,
Ben.