From patchwork Wed Nov 14 13:39:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 10682671 Return-Path: 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 372DB13B5 for ; Wed, 14 Nov 2018 13:41:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24CE52B6C5 for ; Wed, 14 Nov 2018 13:41:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 193B22B571; Wed, 14 Nov 2018 13:41:13 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 40AFF2B69A for ; Wed, 14 Nov 2018 13:41:11 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=oCeo2mEmfV38drL27vGp4eBV0UXXImbWKD7WdnEDD3c=; b=T4zNPKE5PoEGUNcqPZ5XFwGsQG 1sCFKmd8vUT4egZzHcy/s2t/+jOVHvLaQhYkc5ZCPKWtEhRL84fOJ5mghwhErg/YEOS6KVNu0+hCA v2e9kXTqJusvUllrbc5vqIbwM2FxOGOEA/dFo960sJ2nIN+LZGCELKEG3iXQb3q7l9c/uej5r+lIU OVDTrlCMu3dtv/jRSOioagvX07KRf/GjcAyfbKckwZFsyA0+aTzGlWooa5xtDEfHp3ce5yIBtSN16 Q5/uhZnfoyTap01Jfc0Wh+mRMIDE0hPoWA6VyfVfoFmbOOTVmgMcP4PGkhGCS11ccb2gyvb1z0IEz 22LUsEXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMvPe-0002F4-OY; Wed, 14 Nov 2018 13:40:58 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMvOi-0008LW-4m for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Nov 2018 13:40:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LZUXOQ5gU5hJdYZ4+hY3y1P8u/D2Cn13qO85pnKw4dI=; b=s5d8uS8haR8JW7GdlbCKtUrRX dsc6enJ4Kle/faZz3mn4KDh9/Ra+Aqq5erjciOStN+0/j3nUrmj6rSiUMvslSWgTqFbXCS4Y4K+e+ dJNvdBvbSPexbrvLzjSPxY8KPTApW58UGEjl75w9jL8C2TyCz077mzZ6svcW7yWrLep+5ft9Uvvut dCSv87Yd1/jncMfxe69QqNQXEDT3cjbQcSy7Bvus4JtEXgFIu/ixdfINxhR5C34r79UFfrOb9Nmoj o/2eveA9LEErGBTLhDof4MuL60YxWWHHgK2Qd+xQ0wOCwMp4yakv7rbkhZm0+Oac9HnyMCTjiKwCK JfHPSw3XA==; Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMvOf-0006Ly-4E for linux-arm-kernel@lists.infradead.org; Wed, 14 Nov 2018 13:39:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC32E15BF; Wed, 14 Nov 2018 05:39:44 -0800 (PST) Received: from capper-debian.arm.com (unknown [10.37.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6AB7F3F718; Wed, 14 Nov 2018 05:39:43 -0800 (PST) From: Steve Capper To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V3 3/5] arm64: mm: Define arch_get_mmap_end, arch_get_mmap_base Date: Wed, 14 Nov 2018 13:39:18 +0000 Message-Id: <20181114133920.7134-4-steve.capper@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181114133920.7134-1-steve.capper@arm.com> References: <20181114133920.7134-1-steve.capper@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_083957_241860_01BECB52 X-CRM114-Status: GOOD ( 10.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, Steve Capper , will.deacon@arm.com, jcm@redhat.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have DEFAULT_MAP_WINDOW defined, we can arch_get_mmap_end and arch_get_mmap_base helpers to allow for high addresses in mmap. Signed-off-by: Steve Capper Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/processor.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index da41a2655b69..bbe602cb8fd3 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -72,6 +72,13 @@ #define STACK_TOP STACK_TOP_MAX #endif /* CONFIG_COMPAT */ +#define arch_get_mmap_end(addr) ((addr > DEFAULT_MAP_WINDOW) ? TASK_SIZE :\ + DEFAULT_MAP_WINDOW) + +#define arch_get_mmap_base(addr, base) ((addr > DEFAULT_MAP_WINDOW) ? \ + base + TASK_SIZE - DEFAULT_MAP_WINDOW :\ + base) + extern phys_addr_t arm64_dma_phys_limit; #define ARCH_LOW_ADDRESS_LIMIT (arm64_dma_phys_limit - 1)