Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3068360ybt; Mon, 29 Jun 2020 14:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcgVuvZmQWGty8nwc+cmxb3dYyK6MQLS4Tw+iGzrM4R/2DF7Xvz3szNo4h3dqHq+FYpANM X-Received: by 2002:a17:906:1e85:: with SMTP id e5mr7933067ejj.76.1593466040723; Mon, 29 Jun 2020 14:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593466040; cv=none; d=google.com; s=arc-20160816; b=IfsaLirD0+QUccxJn6UKxCG12eYEHgJh0p/y+Wx1H+YExuMTn6bcYCgK28f+SA6JLc wsEJu+LajIxwZks3SsGlLhJaDUqeBkJhqmykuNB/yJeNVe3HiI2BNMpIU4ekPDfbdwIL 9HcG/qOxEh/mkdl3UgtZagyNq6OoDvqBCHm7svqU8TZgACtUpAssG8KrJXBSRVH5OcJe IYbSlyV+nOychQr3uqb4WgIZ5MD1niu/fPCrB3FaetoLreBBfkMxSC4xnTL0LfKNx0U6 MkAc28si7MLDkj0AV3Fp8F1+vqPSmIN70dhMJvJhEqFyW2xZYh8AT6uaQMD2GSXxd1FQ PAbQ== 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; bh=qjSDuUI8xjhgKz4mLAxRndf03o50xla3nI2igSi4wD0=; b=PsXP1cjr1IqRknb9qrn5gIIMfV1k+Z6MeQQAre8TLFxSQe2i1q2iAL/r5TC59J4DvF MeKYTbyfaP4eBNrahQAt0/EW1OzVsEirLz9l/w8nxpgFKsk/YN5pCpt63h7KNTCkS3+v JKWLYybTciU8Wi3UqMjA7MXcYoKWxlEjMNnNGf9Y1m8SlQ+4L5Rx/iTh1slLPmZDhgQ8 hlZsfUabrX0Xz/Oz9kM70kOw/KIl5f5nYASLtFNQjXPdegG3HAr7FiyLvGz9gAJ6xqt1 Mm+O5EibmeW/Ez03bWaVcTf57ZIyxm6OnbjzEVDU3GCEyVjfKEnBd2thQWTXiNiGkW/s xvkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jt19si502642ejb.389.2020.06.29.14.26.58; Mon, 29 Jun 2020 14:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbgF2SvH (ORCPT + 99 others); Mon, 29 Jun 2020 14:51:07 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:1073 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbgF2Su4 (ORCPT ); Mon, 29 Jun 2020 14:50:56 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 49wPzT6MWWz9tyrL; Mon, 29 Jun 2020 13:15:17 +0200 (CEST) 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 MTFRV6BJdewt; Mon, 29 Jun 2020 13:15:17 +0200 (CEST) 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 49wPzT5F5Yz9tyqw; Mon, 29 Jun 2020 13:15:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1785E8B79E; Mon, 29 Jun 2020 13:15:24 +0200 (CEST) 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 KIh9pwSoMCUv; Mon, 29 Jun 2020 13:15:24 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.105]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ECE6B8B799; Mon, 29 Jun 2020 13:15:23 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id EC4CE65B29; Mon, 29 Jun 2020 11:15:23 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 4/6] powerpc/32: Set user/kernel boundary at TASK_SIZE instead of PAGE_OFFSET To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 29 Jun 2020 11:15:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org User space stops at TASK_SIZE. At the moment, kernel space starts at PAGE_OFFSET. In order to use space between TASK_SIZE and PAGE_OFFSET for modules, make TASK_SIZE the limit between user and kernel space. Note that fault.c already considers TASK_SIZE as the boundary between user and kernel space. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/page.h | 4 +++- arch/powerpc/mm/ptdump/ptdump.c | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index a63fe6f3a0ff..254687258f42 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -255,8 +255,10 @@ static inline bool pfn_valid(unsigned long pfn) */ #ifdef CONFIG_PPC_BOOK3E_64 #define is_kernel_addr(x) ((x) >= 0x8000000000000000ul) -#else +#elif defined(CONFIG_PPC_BOOK3S_64) #define is_kernel_addr(x) ((x) >= PAGE_OFFSET) +#else +#define is_kernel_addr(x) ((x) >= TASK_SIZE) #endif #ifndef CONFIG_PPC_BOOK3S_64 diff --git a/arch/powerpc/mm/ptdump/ptdump.c b/arch/powerpc/mm/ptdump/ptdump.c index de6e05ef871c..9d942136c7be 100644 --- a/arch/powerpc/mm/ptdump/ptdump.c +++ b/arch/powerpc/mm/ptdump/ptdump.c @@ -348,7 +348,11 @@ static void populate_markers(void) { int i = 0; +#ifdef CONFIG_PPC64 address_markers[i++].start_address = PAGE_OFFSET; +#else + address_markers[i++].start_address = TASK_SIZE; +#endif address_markers[i++].start_address = VMALLOC_START; address_markers[i++].start_address = VMALLOC_END; #ifdef CONFIG_PPC64 @@ -385,7 +389,7 @@ static int ptdump_show(struct seq_file *m, void *v) struct pg_state st = { .seq = m, .marker = address_markers, - .start_address = PAGE_OFFSET, + .start_address = IS_ENABLED(CONFIG_PPC64) ? PAGE_OFFSET : TASK_SIZE, }; #ifdef CONFIG_PPC64 @@ -429,7 +433,7 @@ void ptdump_check_wx(void) .seq = NULL, .marker = address_markers, .check_wx = true, - .start_address = PAGE_OFFSET, + .start_address = IS_ENABLED(CONFIG_PPC64) ? PAGE_OFFSET : TASK_SIZE, }; #ifdef CONFIG_PPC64 -- 2.25.0