Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4273286ybi; Mon, 29 Jul 2019 22:59:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxs35ECKWvXqjTmv23MPYKHnbuURQQ7oJaU8YMCfVKLs76RxPtYt1ZcGjzkfOTZ8griqMft X-Received: by 2002:a17:902:ac87:: with SMTP id h7mr117435998plr.36.1564466348944; Mon, 29 Jul 2019 22:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564466348; cv=none; d=google.com; s=arc-20160816; b=xOB6lKUW4YCxLzsmIo1CiMA94JA7CQVyo6JKFJxfhZqNWTss7SGT7/TLIab1KYl73P Taae6Xqaik2ktbbCYN2rId8/JxgaWtsRmA6DHgYaBS4tgcIcj1qWR5pBeHbHqplhc5fC aG1SjyGHwkyIE0VNPoty3HMWOsXc3JeHe0693H0WajzAE9OG+dgitg+/g9IcI3iOZB8j /KRogne4XpyYsjyEVrrugcQAkWljknyQH7JoVvzDTCx37yw7OyoXSUkkYTl7zgbwQecO yiTkaf4rkwi1pTjwsM4pPqXJFbMoYn5HeFkU/yWKt+3odYHjIMl8KA65HPyFxNLJlELy uUtQ== 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=LklZI+jjNy9P/Vf1oDAlKWfBdOZ3w4ODTtcULXIYH+w=; b=kUQQvNMIXwS9hqwmsO+pV9mYW3KkCm5Yr8RDDG8HSGz6+2UNyBGalvDrCS0LIKPqlu IKL6Lp42U+whvgL6gtG9oLg1ZABtaVo5/vTDo9G1J7iDcL/1VYZgpgDbIK6goGQMiZOF jg0n6KOaRlQ+FMIVfE0MUcSrPioNF5SO4jBp4TCwq7ujRYrjSmi6PloM3PX7EyoSI5mx NiH26X78Xktan5cwpeg7Lb+e+Ts2R+ZONSOroOrqpgTbdJSnxy8enzfADzfzExws5oqg RZxH5srYvhqiuLZffdat+k++qOv9/+RgQJAhaaEyOSKchxJZMKTYxFvPTJQodUt9qJ3H gcxA== 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 f5si28354836pgk.184.2019.07.29.22.58.54; Mon, 29 Jul 2019 22:59:08 -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 S1728422AbfG3Fxo (ORCPT + 99 others); Tue, 30 Jul 2019 01:53:44 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:33621 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfG3Fxo (ORCPT ); Tue, 30 Jul 2019 01:53:44 -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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8A9D220002; Tue, 30 Jul 2019 05:53:36 +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 02/14] arm64: Make use of is_compat_task instead of hardcoding this test Date: Tue, 30 Jul 2019 01:51:01 -0400 Message-Id: <20190730055113.23635-3-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 Each architecture has its own way to determine if a task is a compat task, by using is_compat_task in arch_mmap_rnd, it allows more genericity and then it prepares its moving to mm/. Signed-off-by: Alexandre Ghiti Acked-by: Catalin Marinas Acked-by: Kees Cook Reviewed-by: Christoph Hellwig Reviewed-by: Luis Chamberlain --- arch/arm64/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c index b050641b5139..bb0140afed66 100644 --- a/arch/arm64/mm/mmap.c +++ b/arch/arm64/mm/mmap.c @@ -43,7 +43,7 @@ unsigned long arch_mmap_rnd(void) unsigned long rnd; #ifdef CONFIG_COMPAT - if (test_thread_flag(TIF_32BIT)) + if (is_compat_task()) rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1); else #endif -- 2.20.1