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: 10682653 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 0E74017F3 for ; Wed, 14 Nov 2018 13:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 013EA2B4AB for ; Wed, 14 Nov 2018 13:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E96CD2B4E0; Wed, 14 Nov 2018 13:39:50 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9410F2B4AB for ; Wed, 14 Nov 2018 13:39:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C902F6B000E; Wed, 14 Nov 2018 08:39:46 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C3F036B0010; Wed, 14 Nov 2018 08:39:46 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B572C6B0266; Wed, 14 Nov 2018 08:39:46 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by kanga.kvack.org (Postfix) with ESMTP id 810B66B000E for ; Wed, 14 Nov 2018 08:39:46 -0500 (EST) Received: by mail-oi1-f198.google.com with SMTP id n196so4772398oig.15 for ; Wed, 14 Nov 2018 05:39:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=LZUXOQ5gU5hJdYZ4+hY3y1P8u/D2Cn13qO85pnKw4dI=; b=e4UtffnaAdF92zzTx/r6Z6BluTZRSWHbtnnlAA8Uyeq6yUh9cVXoP9EUxxAWU6/aAC BCDKR/2hoJUWZBlcBvawppow52nAK3j3c3r+3KZ1+UbCoSRCC7blXG1maQYOcHSoESQL +/CkX4wc+QlpBPtdO8Qod77BaxmLiy5c2FvbyWud0QtC3rQC/jsvkgou21Gey2ZQq222 gOyZgcNi6+Gm+ZHbX8Q9PBZmIdc81WgrmlMdLVbKi+KZkM0Pspv8K6d+ij8Z6kVcTSS9 sauMuQlurUj0a/mD8si1TOWZmUh47zGn/f7kEGxGnGwRnmbgz5aJd2URDUvaym05ZpSJ +FjA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com X-Gm-Message-State: AGRZ1gLlgGFU5HDZc4fFP4V/jeDsYGEST/OVP2AOTDuDTIllgBUUo4+m MdIuaMffAXKGfRNpMhF3bp67smlbRUCJYnvNc/+2rOXT+oazViTT2dNGOmRpiVT97m1LD+tKhBz c4l93UAaIKwSRLaPvenPoyHcPsCq336FhwGG4wQCF9Wzh6qxbO/Wfih156HedU/13Cw== X-Received: by 2002:aca:d00c:: with SMTP id h12-v6mr1009496oig.138.1542202786204; Wed, 14 Nov 2018 05:39:46 -0800 (PST) X-Google-Smtp-Source: AJdET5dwLvEz2P4novcrOIj/3a1LPp/dFRrTMlUrvxkIZu+oKrMGpyV/meE6diljVib+zKujxw/H X-Received: by 2002:aca:d00c:: with SMTP id h12-v6mr1009467oig.138.1542202785277; Wed, 14 Nov 2018 05:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542202785; cv=none; d=google.com; s=arc-20160816; b=UNsgLM5XKTLSvUCRt/swMvrq70xNcq8KMDzrbzVC/Acd10jRaSTQca+kwu6iJOZYHn +ED1BZFnlJ4Yv8B6lvuxpJn27LsTcMaSubRweLX9xduDrOMM85SCa+LEmxhbGoHKl8iA EsfvhrvT3wMsWL7TFTmuLIF274gRJqC7smhi0xMRaKp7eUxQe2f4Q0jQ8zAk7fdmrBZp ClkEqW8MoXGkfA2xrnCfA0VstzF88DJtbKhCJmeEefJ7OVcf1y3IS4GFNKA3zc2EcYXX +z45QBvb9VxrGA4AlCwAr7Qigb64mwWh+3xzFW6d+vsn6WJuq5/Xo+bhdod7CEx8a0YD g/3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=LZUXOQ5gU5hJdYZ4+hY3y1P8u/D2Cn13qO85pnKw4dI=; b=PU0nV1VX2fGgjQ7Alb3H7KAN5ajFixyly9l5/xQ7YgiF14+VrOyyQ6cdF10KlRYYIc ebq/8UR65arK2DZC0stSkzxcmuGwqWFR0SNLjOo64ly1eMsoBFyq1cpfC0gg1SGh2s7y 7rTCpQ/WVCwJneSKXXtqdiywNtZX4SRIHYvsKRsH2csvLOG7Gvc5mKTd78KYVTgu0ndN fW1yDM1pv0M+zzePet8cZnmBj1Nx7NJf8DsExtUb2hkpkFdycHiZW6qLPAwGDQGiZHhi SYOMMGj9jNVyKOVOzN4WEWRfuySrFAxyl8fnoIV4K9ebQ/2wLSZCtBajGvoQd55jSBGQ Sd+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id t53si9828697oti.205.2018.11.14.05.39.45 for ; Wed, 14 Nov 2018 05:39:45 -0800 (PST) Received-SPF: pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com 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 Cc: catalin.marinas@arm.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, jcm@redhat.com, Steve Capper 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)