ACK: [Xenial PATCH 1/3] s390/mm: no local TLB flush for clearing-by-ASCE IDTE

Colin Ian King colin.king at canonical.com
Tue Sep 12 11:52:19 UTC 2017


On 12/09/17 10:45, Stefan Bader wrote:
> From: Martin Schwidefsky <schwidefsky at de.ibm.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1708399
> 
> The local-clearing control of the IDTE instruction does not have any effect
> for the clearing-by-ASCE operation. Only the invalidation-and-clearing
> operation respects the local-clearing bit.
> 
> Remove __tlb_flush_idte_local and simplify the batched TLB flushing code.
> 
> Reviewed-by: Heiko Carstens <heiko.carstens at de.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky at de.ibm.com>
> (backported from commit d5dcafee5f183e9aedddb147a89cb46ab038f26b)
> [Kept MACHINE_HAS_TLB_LC checks as 64f31d5802af11fd is not applied.]
> Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>  arch/s390/include/asm/tlbflush.h | 46 +++++++++-------------------------------
>  1 file changed, 10 insertions(+), 36 deletions(-)
> 
> diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h
> index 0a20316..80868c84 100644
> --- a/arch/s390/include/asm/tlbflush.h
> +++ b/arch/s390/include/asm/tlbflush.h
> @@ -25,17 +25,6 @@ static inline void __tlb_flush_idte(unsigned long asce)
>  		: : "a" (2048), "a" (asce) : "cc");
>  }
>  
> -/*
> - * Flush TLB entries for a specific ASCE on the local CPU
> - */
> -static inline void __tlb_flush_idte_local(unsigned long asce)
> -{
> -	/* Local TLB flush for the mm */
> -	asm volatile(
> -		"	.insn	rrf,0xb98e0000,0,%0,%1,1"
> -		: : "a" (2048), "a" (asce) : "cc");
> -}
> -
>  #ifdef CONFIG_SMP
>  void smp_ptlb_all(void);
>  
> @@ -86,24 +75,15 @@ static inline void __tlb_flush_full(struct mm_struct *mm)
>   */
>  static inline void __tlb_flush_asce(struct mm_struct *mm, unsigned long asce)
>  {
> -	int active, count;
> -
>  	preempt_disable();
> -	active = (mm == current->active_mm) ? 1 : 0;
> -	count = atomic_add_return(0x10000, &mm->context.attach_count);
> -	if (MACHINE_HAS_TLB_LC && (count & 0xffff) <= active &&
> -	    cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) {
> -		__tlb_flush_idte_local(asce);
> -	} else {
> -		if (MACHINE_HAS_IDTE)
> -			__tlb_flush_idte(asce);
> -		else
> -			__tlb_flush_global();
> -		/* Reset TLB flush mask */
> -		if (MACHINE_HAS_TLB_LC)
> -			cpumask_copy(mm_cpumask(mm),
> -				     &mm->context.cpu_attach_mask);
> -	}
> +	atomic_add(0x10000, &mm->context.attach_count);
> +	if (MACHINE_HAS_IDTE)
> +		__tlb_flush_idte(asce);
> +	else
> +		__tlb_flush_global();
> +	/* Reset TLB flush mask */
> +	if (MACHINE_HAS_TLB_LC)
> +		cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask);
>  	atomic_sub(0x10000, &mm->context.attach_count);
>  	preempt_enable();
>  }
> @@ -124,18 +104,12 @@ static inline void __tlb_flush_kernel(void)
>   */
>  static inline void __tlb_flush_asce(struct mm_struct *mm, unsigned long asce)
>  {
> -	if (MACHINE_HAS_TLB_LC)
> -		__tlb_flush_idte_local(asce);
> -	else
> -		__tlb_flush_local();
> +	__tlb_flush_local();
>  }
>  
>  static inline void __tlb_flush_kernel(void)
>  {
> -	if (MACHINE_HAS_TLB_LC)
> -		__tlb_flush_idte_local(init_mm.context.asce);
> -	else
> -		__tlb_flush_local();
> +	__tlb_flush_local();
>  }
>  #endif
>  
> 
Acked-by: Colin Ian King <colin.king at canonical.com>




More information about the kernel-team mailing list