Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10777003ybi; Thu, 25 Jul 2019 05:06:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjPSXGu0yU22FyoF0daHCvgIE0o8hfhtxnWmaFTXrTIKxnb8+ikjyZ4a7I+XUP1WWywYV9 X-Received: by 2002:a17:902:4623:: with SMTP id o32mr89165420pld.112.1564056406438; Thu, 25 Jul 2019 05:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564056406; cv=none; d=google.com; s=arc-20160816; b=zFcZRhsoUWBbwEz11wW2khDeMO7MnxKxb/AR5eAV+j5qjG+hWU4DXq2kU6ZSOXuN7v rRonJrSks51+rDRuMnUQPeTR2NPS9WNydSNUNJ8fUWgkf1ob88L4pAsNOEsFkJKNj1nT hzysWwVslMBSOMNBPgWLcgZyjWrBlfKHrMJWcbT8OMTzkumNq21sXlVTS3GBGCAoZwJa pvzv+UXmPS9YBwg1fRhBHASrat5Ih47tqHL82iDXKzhQelUNRPJ0g5vcbULcyKNFLQ/4 6KLFOkMmzn/8oSFgkIYzNE5+SaWcwxEeP/yROv32cAJMf8mJpY3F39h7pHigaZj78GDt R8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XrWh+rmPVAFrRcmqorS5a5ycL9qqh9BHPu7/J2lO+Zs=; b=hJiDTSM4ZnHlVIK3LZ7GirHTiHNOQPX5Wivx5ySy7DWSleuc+KKiyzahjEQijxVxuS sQdVUvB3TavG8MfbdqjFuDpvWovg1Lzla4klLBkvP8w4Lj38ksQJT44laxUJyOSeDh1i bqpLW7boIFumc6Z5vd87U+Il9gyeMcO+eFgOIh6rYg6qHPtJUGDLAglHnV3RwGZqQ7jm S910SSUEhmNrAxS389oapaXzn3eNHVOvmjLNk1PvZCo31mH74pRek4jduFwG8JcKw13l R7hBIz/Yzpuy7MulBuTSLxzlqmdye92/QKkLsz/q22VHcozepHvtU1Ex/XZcYI7SAfqT zOUQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si16072168pld.231.2019.07.25.05.06.29; Thu, 25 Jul 2019 05:06:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbfGYGJU (ORCPT + 99 others); Thu, 25 Jul 2019 02:09:20 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:40071 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbfGYGJU (ORCPT ); Thu, 25 Jul 2019 02:09:20 -0400 X-Originating-IP: 81.250.144.103 Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 761F0E0008; Thu, 25 Jul 2019 06:09:11 +0000 (UTC) Subject: Re: [PATCH REBASE v4 12/14] mips: Replace arch specific way to determine 32bit task with generic version To: Luis Chamberlain Cc: Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Burton , linux-riscv@lists.infradead.org, Alexander Viro , James Hogan , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-mips@vger.kernel.org, Christoph Hellwig , linux-arm-kernel@lists.infradead.org References: <20190724055850.6232-1-alex@ghiti.fr> <20190724055850.6232-13-alex@ghiti.fr> <20190724171648.GW19023@42.do-not-panic.com> From: Alexandre Ghiti Message-ID: <17fa5d60-2417-70cb-36b0-203b30b27624@ghiti.fr> Date: Thu, 25 Jul 2019 08:09:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190724171648.GW19023@42.do-not-panic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/19 7:16 PM, Luis Chamberlain wrote: > On Wed, Jul 24, 2019 at 01:58:48AM -0400, Alexandre Ghiti wrote: >> Mips uses TASK_IS_32BIT_ADDR to determine if a task is 32bit, but >> this define is mips specific and other arches do not have it: instead, >> use !IS_ENABLED(CONFIG_64BIT) || is_compat_task() condition. >> >> Signed-off-by: Alexandre Ghiti >> Reviewed-by: Kees Cook >> --- >> arch/mips/mm/mmap.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c >> index faa5aa615389..d4eafbb82789 100644 >> --- a/arch/mips/mm/mmap.c >> +++ b/arch/mips/mm/mmap.c >> @@ -17,6 +17,7 @@ >> #include >> #include >> #include >> +#include >> >> unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ >> EXPORT_SYMBOL(shm_align_mask); >> @@ -191,7 +192,7 @@ static inline unsigned long brk_rnd(void) >> >> rnd = rnd << PAGE_SHIFT; >> /* 32MB for 32bit, 1GB for 64bit */ >> - if (TASK_IS_32BIT_ADDR) >> + if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task()) >> rnd = rnd & SZ_32M; >> else >> rnd = rnd & SZ_1G; >> -- > Since there are at least two users why not just create an inline for > this which describes what we are looking for and remove the comments? Actually this is a preparatory patch, this will get merged with the generic version in the next patch. Alex > > Luis > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv