Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4280358ybi; Mon, 29 Jul 2019 23:05:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+SCJWVVeHojYMZ6k3BsdruhF+fQMg46s0kfHld8dsxNq1aELhjOIqX8mjhAgiqliaC5a9 X-Received: by 2002:a17:902:9688:: with SMTP id n8mr111200274plp.227.1564466755527; Mon, 29 Jul 2019 23:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564466755; cv=none; d=google.com; s=arc-20160816; b=lYsxOcVwKlfsu8TtlDkkKDScxkMp7gIya7xFygVlX3pL7TENJAsed8s2sOdOiY08wd Nq85WUCceEYIWrxzmvqr87PtMkVslkPP6WkoMQfizlsK2MNYMUNCldJTstHaP14VUS7i PuMax+512ds5zdnUkLeSaKUej0KB1LQR5gzSBO0u03WZuqG+aFDVlGTXwg/9seevPo+T 8l9L93jGoVbAUAls8sJzi+r11FuZKtVAIqrAePBorN4KUDBOKLX8C1dfBlbMpdA38Osj jO874kX9mKZ4MnsluvDh1qu+9nJtcsVM9RDL8ySMOHMZVJIzjH6cHDADyQ7to77jJ5ik pZiA== 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=ko2rRrfRCWui9LVAU/xMHpo51BcapuH+0RwvIJhyJ6u8f+b8y77CUEDscw0rORDkU1 AJbNdVJsAPdYnvO/OCS3I95uoN0eFVMzbNI+FMT8DyQrVx673wGStBOLIzTlkYNYbV1H 1eGOPlAvoZgcvOarBmEIa/fvmqUSmeWJw79libNrq5U+sIQEG9qsTjRdm03X/fOiPYa2 xJNTxPEDu0svlzDCvqGkXSZ0W8ufdgglXZUsG7iXM30+TdCub4FSqWaJSXLELy4Ra/fe K5JC815TlVsX+pizHBXPeI1L/Lu6hcqYHplg1XQIst6KEACiBLOKV4Bs8tFVRrmOP0mM bp7g== 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 9si29039140pgo.283.2019.07.29.23.05.40; Mon, 29 Jul 2019 23:05:55 -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 S1727576AbfG3GEd (ORCPT + 99 others); Tue, 30 Jul 2019 02:04:33 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51251 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbfG3GEd (ORCPT ); Tue, 30 Jul 2019 02:04:33 -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 relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 94A64E0005; Tue, 30 Jul 2019 06:04:26 +0000 (UTC) From: Alexandre Ghiti To: Andrew Morton Cc: 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 v5 12/14] mips: Replace arch specific way to determine 32bit task with generic version Date: Tue, 30 Jul 2019 01:51:11 -0400 Message-Id: <20190730055113.23635-13-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190730055113.23635-1-alex@ghiti.fr> References: <20190730055113.23635-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