Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6420797ybh; Wed, 7 Aug 2019 23:46:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyphQkOmO12V0MHZOWRKhjYbw/EoJNCA2VuZB1s32ZLgWaNKmrWweR2lq34/5bMmAaE9OxC X-Received: by 2002:a65:6093:: with SMTP id t19mr11218787pgu.79.1565246797100; Wed, 07 Aug 2019 23:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565246797; cv=none; d=google.com; s=arc-20160816; b=V6X0etrUDVCrxsQKnE4cd/II4D1vIj+zaGAKGgiILsssEOe/fzzzJe5ByeLHzmXQDQ E3l0UGGWh1vOZO3LmUR+w4VGZ3DofvyWbZZ3hGiw0OvKHbuPkVNjMsPh3R3KaVkFeDJG vBz/VcZl0tlkr633l+drUOQg12WKqeypwz/fVO/fg1I5sNI91rGCs+uE6nNYHr/hzG5e RsvfvWLc/n7CwERYblbFLeGYAJ6p8+ZqUUf4DVe62oOsOa58yQze5eqoDYaPxBBjUVdP WwK8elHBibM8VVrVIITBQRtE0YZftN5qeUTQgXA1R9yaU8cGOu5nAUU2hsnPpg+k7I33 PvWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=juJS37x5CM43D+6DWMHhdR9jUChuu/SEXc2RnrYUv1M=; b=0tKkLk4SqrIM+5igrWIuR10kc62Hf0yVEHMRpJbM21slLtdD1DC9hyp6jmNQXoLdRv e6+Hcq+R+nVzWd0l6CLacvrocPJmjeBDUQtaqi5k4yjr3LiDman+BuQufvMd37AJS0wA 5DJ3SmKgauyQ3BjQ7PHh/aRkE5ICeqpXbVYZSkcBtGB1lUlXRDpoljZTZT/uJvN4Ug5S +UbW1EyF9yMVzZEkFgwPKX6D4JVqgy9Dq0zm+uZ5SrcrZ9EajNBtea3X5nJbxc+MxO7U QfwKzTyz8KIbqEdug10E6ph5YNxFMW7irNbMMAyUVY9DrjXqN8xvfggeYhx07j3p/GEx GsaQ== 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 i188si51460643pfe.96.2019.08.07.23.46.22; Wed, 07 Aug 2019 23:46:37 -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 S1731394AbfHHGbR (ORCPT + 99 others); Thu, 8 Aug 2019 02:31:17 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35259 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730678AbfHHGbR (ORCPT ); Thu, 8 Aug 2019 02:31:17 -0400 X-Originating-IP: 79.86.19.127 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 60503FF802; Thu, 8 Aug 2019 06:31:07 +0000 (UTC) From: Alexandre Ghiti To: Andrew Morton Cc: Paul Walmsley , Luis Chamberlain , Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Kees Cook , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Alexandre Ghiti Subject: [PATCH v6 12/14] mips: Replace arch specific way to determine 32bit task with generic version Date: Thu, 8 Aug 2019 02:17:54 -0400 Message-Id: <20190808061756.19712-13-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190808061756.19712-1-alex@ghiti.fr> References: <20190808061756.19712-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Paul Burton Reviewed-by: Kees Cook Reviewed-by: Luis Chamberlain --- 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 ff6ab87e9c56..d5106c26ac6a 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 - 1); else rnd = rnd & (SZ_1G - 1); -- 2.20.1