Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp403180img; Wed, 20 Mar 2019 03:09:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRIiIS1hRiZ59Ts31fzd0kIbngJfuaX8frr3gj6bJmV8suftEhZckWUyaAqEqBeSUTrOeo X-Received: by 2002:a62:4e8e:: with SMTP id c136mr6868239pfb.254.1553076562491; Wed, 20 Mar 2019 03:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076562; cv=none; d=google.com; s=arc-20160816; b=WGN0bDhj6X5/V6jVhi8Vje9QG3/gTNI+YHoDl7wl2pwJaCLcIqFmkT6J6x7n7DKBkT Tw+VBIFXnEVZL8X3Pe0sj9bR1hspMkZrFgCZ2uY4XJpZ0wqaSR/WnYXVV7Ov6/77c01o n/n0NbcnLxHqaWEBOtsCAgEOdjdToxAG8qOFZE1l5D95KZfiwwg58tqCag/LbPjqd4LI CxMICP/GHFrRDKp9CpRnc2xNTmJScM2vC7Zljx91wXKJjHgrC69kegLH/PpWiJmRaaVc 0WVj1Qc7SfVzvizwYiWZQNcrDb23J0TfeOd8Ah7HaIKydQexD3Q8SNVSlZYdK0U204YG 8XOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=Guh3jdarvREMy9XI7NXgO+/Y6kZ5VjrGMUUFuRWHaI4=; b=NT4fFuwwbasvQF3BTTf946CORv0s9DFJRZwTtVcv4JX8jVo+eLLqQUroHi4lTgL46q OLOzUu+lUu0+lSwJrEtNUfA4nqOPepleiSeunIVEdzUxMmv3+k/kA1P2sfjKK2k2h5IF XWJNrlCuodVdf2V0C0Bnc2StdVSdKz/2OW8rjDfA77B24fk5j8nMxR30niGeMZKTX/vL 6MxF+qkQNRIrW/pEnjm3iABcQVpYRKe39GpIBFUJJn8plI3hTMXpS31piJXZUV2DexVF qtZtxCJYCxeyJKVib7V/0mpLm/zsqKw9h2Rp/2o4n4kH1j0nJNtVskvUJXa3kLHyvnKM 3agA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=PwU+T+Y6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si1429552pgn.138.2019.03.20.03.09.07; Wed, 20 Mar 2019 03:09:22 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=PwU+T+Y6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727745AbfCTKGw (ORCPT + 99 others); Wed, 20 Mar 2019 06:06:52 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:30197 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727732AbfCTKGu (ORCPT ); Wed, 20 Mar 2019 06:06:50 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQZ04RDgz9vByy; Wed, 20 Mar 2019 11:06:48 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=PwU+T+Y6; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id PX6hGgKCuwLw; Wed, 20 Mar 2019 11:06:48 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44PQZ03G8Sz9vByx; Wed, 20 Mar 2019 11:06:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076408; bh=Guh3jdarvREMy9XI7NXgO+/Y6kZ5VjrGMUUFuRWHaI4=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=PwU+T+Y6NUJXTR3ei3rw5qVGoMy5/nImwOjN7JP9KlI0uri24NBmy6SMEZ+XNWTTd 4nJ9KlVFbDjLcRfafr3CF6IlaZKfHcH7V96w2jRwx0bQUQbsheXX/WYE6my0xqQ0bH un0S76OJp8DoM9cSWqUAdKizmSy+Vu+x7G1Ywrm4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8C59B8B911; Wed, 20 Mar 2019 11:06:49 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id MEak5RtUmh9U; Wed, 20 Mar 2019 11:06:49 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 61C1D8B918; Wed, 20 Mar 2019 11:06:49 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 3CDB463AEF; Wed, 20 Mar 2019 10:06:49 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 13/27] powerpc/mm: define get_slice_psize() all the time To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Mar 2019 10:06:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_slice_psize() can be defined regardless of CONFIG_PPC_MM_SLICES to avoid ifdefs Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/slice.h | 4 ++++ arch/powerpc/mm/hugetlbpage.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/slice.h b/arch/powerpc/include/asm/slice.h index 44816cbc4198..d85c85422fdf 100644 --- a/arch/powerpc/include/asm/slice.h +++ b/arch/powerpc/include/asm/slice.h @@ -38,6 +38,10 @@ void slice_setup_new_exec(void); static inline void slice_init_new_context_exec(struct mm_struct *mm) {} +#ifndef get_slice_psize +#define get_slice_psize(mm, addr) MMU_PAGE_4K +#endif + #endif /* CONFIG_PPC_MM_SLICES */ #endif /* __ASSEMBLY__ */ diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 26a57ebaf5cf..87358b89513e 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -540,14 +540,12 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) { -#ifdef CONFIG_PPC_MM_SLICES /* With radix we don't use slice, so derive it from vma*/ - if (!radix_enabled()) { + if (IS_ENABLED(CONFIG_PPC_MM_SLICES) && !radix_enabled()) { unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start); return 1UL << mmu_psize_to_shift(psize); } -#endif return vma_kernel_pagesize(vma); } -- 2.13.3