Message ID | 20190808061756.19712-13-alex@ghiti.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C2631399 for <patchwork-linux-riscv@patchwork.kernel.org>; Thu, 8 Aug 2019 06:31:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB1D828AC1 for <patchwork-linux-riscv@patchwork.kernel.org>; Thu, 8 Aug 2019 06:31:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDC5128AC6; Thu, 8 Aug 2019 06:31:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87BF528AC1 for <patchwork-linux-riscv@patchwork.kernel.org>; Thu, 8 Aug 2019 06:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M8VQmVFleowUBRgfi8Kdv1BDEX8Pxk+69b7+pC4hALU=; b=R9HoBvKbc0vf2i uELaMjjPgOhYJbuyFjQeP7MlLKY0F3HHTaeq3lxFHZw9HnOysakwDQWwes/2QaT4EQWa8fbZloBjm wHq2JhNyQiicU16nnt80prG8rOEPWEQKePa7GJywKVZt64Wo7C413Hx00bVZEvhxDE/F5GYaLS4FB LKkFhiCNAbHT31A3ybiMxhQXzQOtvjPhbmgd0XWUdGCuSBg/afHoHZSVojGQRq7Ue96vdeHzmpeye DegwTQchksxfgxW1dbRKF3IYbPj4SUw5qwGN8XKeHQ5YxQOuY/N6B1p5aLGfGCImMBto92RkyhCCD 6nxQViWEQUENWM2vskUg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvbxc-0004IU-4A; Thu, 08 Aug 2019 06:31:40 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvbxL-00045I-3b; Thu, 08 Aug 2019 06:31:24 +0000 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 <alex@ghiti.fr> To: Andrew Morton <akpm@linux-foundation.org> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190807_233123_314864_23630E03 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Cc: Albert Ou <aou@eecs.berkeley.edu>, Kees Cook <keescook@chromium.org>, Alexandre Ghiti <alex@ghiti.fr>, linux-mm@kvack.org, Catalin Marinas <catalin.marinas@arm.com>, Palmer Dabbelt <palmer@sifive.com>, Will Deacon <will.deacon@arm.com>, Russell King <linux@armlinux.org.uk>, Ralf Baechle <ralf@linux-mips.org>, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Luis Chamberlain <mcgrof@kernel.org>, Paul Burton <paul.burton@mips.com>, Paul Walmsley <paul.walmsley@sifive.com>, James Hogan <jhogan@kernel.org>, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Christoph Hellwig <hch@lst.de>, linux-arm-kernel@lists.infradead.org, Alexander Viro <viro@zeniv.linux.org.uk> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Provide generic top-down mmap layout functions
|
expand
|
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 <linux/sched/signal.h> #include <linux/sched/mm.h> #include <linux/sizes.h> +#include <linux/compat.h> 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);