[Skiboot] [PATCH 21/24] Add "cleanup_global_tlb" for P9 and later

Michael Neuling mikey at neuling.org
Sun Jun 25 04:06:36 AEST 2017


On Thu, 2017-06-22 at 11:22 -0500, Benjamin Herrenschmidt wrote:
> Uses broadcast TLBIE's to cleanup the TLB on all cores and on
> the nest MMU
> 
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
>  asm/misc.S        | 41 +++++++++++++++++++++++++++++++++++++++++
>  include/skiboot.h |  1 +
>  2 files changed, 42 insertions(+)
> 
> diff --git a/asm/misc.S b/asm/misc.S
> index 4c9eee9..d8745c8 100644
> --- a/asm/misc.S
> +++ b/asm/misc.S
> @@ -63,3 +63,44 @@ cleanup_local_tlb:
>  	bdnz	1b
>  	ptesync
>  	blr
> +
> +	.global cleanup_global_tlb
> +cleanup_global_tlb:
> +
> +	/* Only supported on P9 for now */
> +	mfspr	%r3,SPR_PVR
> +	srdi	%r3,%r3,16
> +	cmpwi	cr0,%r3,PVR_TYPE_P9
> +	bnelr
> +
> +	/* Sync out previous updates */
> +	ptesync
> +
> +	.machine "power9"
> +
> +	/* Lead RB with IS=11 */
> +	li	%r3,3
> +	sldi	%r3,%r3,10
> +	li	%r0,0
> +
> +	/* Blow up radix partition scoped translations */
> +	tlbie	%r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 1 /* r */


This is fine but breaks compiling on older bin utils and hence travis CI is
blowing up. 

I'll repost with something backwards compatible.


> +	eieio
> +	tlbsync
> +	ptesync
> +	tlbie	%r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 1 /* r */
> +	eieio
> +	tlbsync
> +	ptesync
> +
> +	/* Blow up hash partition scoped translations */
> +	tlbie	%r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 0 /* r */
> +	eieio
> +	tlbsync
> +	ptesync
> +	tlbie	%r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 0 /* r */
> +	eieio
> +	tlbsync
> +	ptesync
> +
> +	blr
> diff --git a/include/skiboot.h b/include/skiboot.h
> index 87d8503..1a153b0 100644
> --- a/include/skiboot.h
> +++ b/include/skiboot.h
> @@ -204,6 +204,7 @@ extern void fast_reboot(void);
>  extern void __noreturn __secondary_cpu_entry(void);
>  extern void __noreturn load_and_boot_kernel(bool is_reboot);
>  extern void cleanup_local_tlb(void);
> +extern void cleanup_global_tlb(void);
>  extern void init_shared_sprs(void);
>  extern void init_replicated_sprs(void);
>  extern bool start_preload_kernel(void);


More information about the Skiboot mailing list