Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp304795yba; Thu, 25 Apr 2019 23:49:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSYSRTA3zcR9pYF/Bt56wwgtb7E1rB3ClcslpTgwxM8oBlwcsWte2Ttv14JmoPvDISEURD X-Received: by 2002:a63:1b11:: with SMTP id b17mr2771944pgb.207.1556261346276; Thu, 25 Apr 2019 23:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556261346; cv=none; d=google.com; s=arc-20160816; b=hhzV9hM/xIjEYWv9L1KMmD4/nzOVqQ4Of4tmDYmzmLs0PMPKE0zBnL3ZballRO1vI+ jfuj5hLdwfHIwdJM3kJXIDDahfMYSEqYArpe3/Ftna/j8DaB2TARkXgHHQR9rkEmkv4p W3jRfODZ88ORmOKoLiCMWCW0r2UE5ymGailmlpmCFnYH9J/j83wq0OfFhV5UorxR17ec argQSCXlzS74r6f7QiFwJDo9vo/4zG1alHBNn/Zvmwm5agbXZ+NxjY6Hn6uB69naFUe5 gm2GjlLWp4Z7bNWMLTaED2uC/aYJBRBLRbo7aEGuOD9trqCKo/NRq2G0s5QHF/UNSNwn ZiJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from; bh=gItsTjoXhmUL+Lozglv/sRJPPxBK2/k68doIudIZPLc=; b=qUA8F/0mNO1HIBqKmuD2d7ntRFvj55z+qmbexvIXmicDtEO6j+PVy1zGCu8+FzMvbC 9ZD5zMxlIuTA80Fs1JNdamfXY3PrF3l6+FW3tshqaS6AZNN+4guJvzNTVLPX4kmeL9rY qaaTLb/MOm/6RrT2Wy5Ttd3idHkE8NiKeHwVACudDpoI6bPcKOuXKUbXLvPqOvXBnHNs P64PnP9rTLAbm6SR81yxhCrWvExzTVhdRJRmK9EKM4xH1WaUmY/FjOIxzYRvbRYpmhJD Zv0Z6f4QdtA/W3pKEO66I1+kuL0xsrgL/AoINgHolrDGnsBzQH297rAed4hgK80VBZjl tQnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si16342662plt.83.2019.04.25.23.48.51; Thu, 25 Apr 2019 23:49:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfDZGqP (ORCPT + 99 others); Fri, 26 Apr 2019 02:46:15 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56580 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbfDZGqO (ORCPT ); Fri, 26 Apr 2019 02:46:14 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3Q6chJk075494 for ; Fri, 26 Apr 2019 02:46:13 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s3u2ymnbs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2019 02:46:13 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Apr 2019 07:46:11 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 26 Apr 2019 07:46:08 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3Q6k7DQ57933904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Apr 2019 06:46:07 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29A774C040; Fri, 26 Apr 2019 06:46:07 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A0984C06E; Fri, 26 Apr 2019 06:46:05 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.193.89.254]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 26 Apr 2019 06:46:05 +0000 (GMT) X-Mailer: emacs 26.1 (via feedmail 11-beta-1 Q) From: "Aneesh Kumar K.V" To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 10/11] powerpc/mm: define subarch SLB_ADDR_LIMIT_DEFAULT In-Reply-To: References: Date: Fri, 26 Apr 2019 12:13:34 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19042606-4275-0000-0000-0000032E6D1D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042606-4276-0000-0000-0000383DBC4B Message-Id: <87o94t9sh5.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-26_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904260048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > This patch defines a subarch specific SLB_ADDR_LIMIT_DEFAULT > to remove the #ifdefs around the setup of mm->context.slb_addr_limit > > It also generalises the use of mm_ctx_set_slb_addr_limit() helper. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/book3s/64/slice.h | 2 ++ > arch/powerpc/include/asm/nohash/32/slice.h | 2 ++ > arch/powerpc/mm/hash_utils_64.c | 2 +- > arch/powerpc/mm/slice.c | 6 +----- > arch/powerpc/mm/tlb_nohash.c | 4 +--- > 5 files changed, 7 insertions(+), 9 deletions(-) > > diff --git a/arch/powerpc/include/asm/book3s/64/slice.h b/arch/powerpc/include/asm/book3s/64/slice.h > index 062e11136e9c..f0d3194ba41b 100644 > --- a/arch/powerpc/include/asm/book3s/64/slice.h > +++ b/arch/powerpc/include/asm/book3s/64/slice.h > @@ -11,4 +11,6 @@ > #define SLICE_NUM_HIGH (H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT) > #define GET_HIGH_SLICE_INDEX(addr) ((addr) >> SLICE_HIGH_SHIFT) > > +#define SLB_ADDR_LIMIT_DEFAULT DEFAULT_MAP_WINDOW_USER64 > + > #endif /* _ASM_POWERPC_BOOK3S_64_SLICE_H */ > diff --git a/arch/powerpc/include/asm/nohash/32/slice.h b/arch/powerpc/include/asm/nohash/32/slice.h > index 777d62e40ac0..39eb0154ae2d 100644 > --- a/arch/powerpc/include/asm/nohash/32/slice.h > +++ b/arch/powerpc/include/asm/nohash/32/slice.h > @@ -13,6 +13,8 @@ > #define SLICE_NUM_HIGH 0ul > #define GET_HIGH_SLICE_INDEX(addr) (addr & 0) > > +#define SLB_ADDR_LIMIT_DEFAULT DEFAULT_MAP_WINDOW > + > #endif /* CONFIG_PPC_MM_SLICES */ > > #endif /* _ASM_POWERPC_NOHASH_32_SLICE_H */ > diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c > index f727197de713..884246e3bf0b 100644 > --- a/arch/powerpc/mm/hash_utils_64.c > +++ b/arch/powerpc/mm/hash_utils_64.c > @@ -1050,7 +1050,7 @@ void __init hash__early_init_mmu(void) > htab_initialize(); > > init_mm.context.hash_context = &init_hash_mm_context; > - init_mm.context.hash_context->slb_addr_limit = DEFAULT_MAP_WINDOW_USER64; > + mm_ctx_set_slb_addr_limit(&init_mm.context, SLB_ADDR_LIMIT_DEFAULT); > > pr_info("Initializing hash mmu with SLB\n"); > /* Initialize SLB management */ > diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c > index ace97d953040..97fbf7b54422 100644 > --- a/arch/powerpc/mm/slice.c > +++ b/arch/powerpc/mm/slice.c > @@ -704,11 +704,7 @@ void slice_init_new_context_exec(struct mm_struct *mm) > * case of fork it is just inherited from the mm being > * duplicated. > */ > -#ifdef CONFIG_PPC64 > - mm_ctx_set_slb_addr_limit(&mm->context, DEFAULT_MAP_WINDOW_USER64); > -#else > - mm->context.slb_addr_limit = DEFAULT_MAP_WINDOW; > -#endif > + mm_ctx_set_slb_addr_limit(&mm->context, SLB_ADDR_LIMIT_DEFAULT); > mm_ctx_set_user_psize(&mm->context, psize); > > /* > diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c > index 088e0a6b5ade..ba4bff11191f 100644 > --- a/arch/powerpc/mm/tlb_nohash.c > +++ b/arch/powerpc/mm/tlb_nohash.c > @@ -802,9 +802,7 @@ void __init early_init_mmu(void) > #endif > > #ifdef CONFIG_PPC_MM_SLICES > -#if defined(CONFIG_PPC_8xx) > - init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW; > -#endif > + mm_ctx_set_slb_addr_limit(&init_mm.context, SLB_ADDR_LIMIT_DEFAULT); > #endif > } > #endif /* CONFIG_PPC64 */ > -- > 2.13.3