Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp402507img; Wed, 20 Mar 2019 03:08:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsHdff0q/gLfXZRcGXTnziPRS5vVSSagsjfWnynqkGAMRzENx4I9FWNMzMoi2OWPwZSpTO X-Received: by 2002:a17:902:aa92:: with SMTP id d18mr6799836plr.278.1553076520518; Wed, 20 Mar 2019 03:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076520; cv=none; d=google.com; s=arc-20160816; b=tmzM126OwwY3C6CphFS9kjUudxB5Fo79yUkWC4E7AC75rPvMhlTptfFTpWrfrvGJYH S51Ph3om1fDjBfPcwMpd/iOfEx3JweXejjnYBP/OCo0EbC6P3CnG71SS0VbOD+K8NGeT uLyMFQCL+66yZFp9RdVAQiLnXyh0Tzen6vryzzn65MJN65pz0i24obJ+MuvAesoVyNGK zsSZ33XtholukRN3RY9kzr1zFHCrwdYFaHy0NZ/BFnJ7fM4Snx7zYA25Vkvtf82oQW4X n8ob++sLgm0CpkRrloXf+WU3CqvCxhiKgdeYgqLMpdl4nR7ZT/UJIh+mY1n5N7Lbzt6t zupQ== 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=p1320MT2AD9wARLRu0EAvOL85pBiGOIq1EL25ZZos+M=; b=L94/Swh2d3d5xQr5smk3GV154hGvyOMFWONCih4xhmG2PXP3AEPVKXeRe6pKIj3Gja vqVTs5hHc/W4V74NVL6KQ/JukntKJWNvd6j1EThkowTBlbaD446+RtQq7MAOg1eV6lHq f2fzIfNg9wBD+5OUxNLM8ezvE1h9RCyonUys6mDL8hA5zG8+paOj54svTmkCEo9VUckq vzab27rkMQNkmdta+kaDxsQlUkD3Rm3S2NSQjA6eM/nJq2Iu41YgN/2hgGnT6WwDIYgu U32VFr/ZKHb9kIs50xPt0WKQAMJ/LVqfIrMyn14tVZ8Kz144wU8+qffiFjKoUe6yKOKk ic9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=ayFt+6Uy; 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 b4si1313619pgq.50.2019.03.20.03.08.25; Wed, 20 Mar 2019 03:08:40 -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=ayFt+6Uy; 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 S1727915AbfCTKHF (ORCPT + 99 others); Wed, 20 Mar 2019 06:07:05 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:43859 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727882AbfCTKHD (ORCPT ); Wed, 20 Mar 2019 06:07:03 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQZD4Ldlz9vC00; Wed, 20 Mar 2019 11:07:00 +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=ayFt+6Uy; 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 P1HEMYxrAL9q; Wed, 20 Mar 2019 11:07:00 +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 44PQZD303zz9vByx; Wed, 20 Mar 2019 11:07:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076420; bh=p1320MT2AD9wARLRu0EAvOL85pBiGOIq1EL25ZZos+M=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=ayFt+6UyoxOAduX1bKC6O73mvPx5zmDGzi/A/+cTjwyP4t+t68f5uuF8an+4k/xVq a3WISzlIy11T1AkAQ8+qNXE1x+KX1sFT5Vq7qRh6LvPGqhzNF3AuKsc7/PqqQYzK8b e5fQExZI7oPLBZDkzRMuLUKdjKldQu5V02aJ+vec= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 48C248B918; Wed, 20 Mar 2019 11:07:01 +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 RYiFnsfE_Rw0; Wed, 20 Mar 2019 11:07:01 +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 00F048B911; Wed, 20 Mar 2019 11:07:00 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C2AB163AEF; Wed, 20 Mar 2019 10:07:00 +0000 (UTC) Message-Id: <728efa7f67c335835b91fc45cc1eed724541febd.1553076180.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 24/27] powerpc: define subarch SLB_ADDR_LIMIT_DEFAULT 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:07:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch defines a subarch specific SLB_ADDR_LIMIT_DEFAULT to remove the #ifdefs around the setup of mm->context.slb_addr_limit 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/kernel/setup-common.c | 8 +------- arch/powerpc/mm/slice.c | 6 +----- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/slice.h b/arch/powerpc/include/asm/book3s/64/slice.h index af498b0da21a..8da15958dcd1 100644 --- a/arch/powerpc/include/asm/book3s/64/slice.h +++ b/arch/powerpc/include/asm/book3s/64/slice.h @@ -13,6 +13,8 @@ #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 + #else /* CONFIG_PPC_MM_SLICES */ #define get_slice_psize(mm, addr) ((mm)->context.user_psize) 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/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2e5dfb6e0823..af2682d052a2 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -948,14 +948,8 @@ void __init setup_arch(char **cmdline_p) init_mm.brk = klimit; #ifdef CONFIG_PPC_MM_SLICES -#ifdef CONFIG_PPC64 if (!radix_enabled()) - init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64; -#elif defined(CONFIG_PPC_8xx) - init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW; -#else -#error "context.addr_limit not initialized." -#endif + init_mm.context.slb_addr_limit = SLB_ADDR_LIMIT_DEFAULT; #endif #ifdef CONFIG_SPAPR_TCE_IOMMU diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 50b1a5528384..64513cf47e5b 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c @@ -652,11 +652,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->context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64; -#else - mm->context.slb_addr_limit = DEFAULT_MAP_WINDOW; -#endif + mm->context.slb_addr_limit = SLB_ADDR_LIMIT_DEFAULT; mm->context.user_psize = psize; -- 2.13.3