From patchwork Mon Apr 3 02:23:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9658723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3823760353 for ; Mon, 3 Apr 2017 02:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2973F26E5D for ; Mon, 3 Apr 2017 02:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DE5827FA6; Mon, 3 Apr 2017 02:21:19 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 A66FF26E5D for ; Mon, 3 Apr 2017 02:21:18 +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=8rl8PWjhx1PrC7U5LAk9DPk09DM630dE/538Hjhtjmw=; b=TqycEl1YrXRYqENiIeAuxuUXUC 8rzbKAPC39S9454n9uYJHSun+yip9uHmHReL68r/4p1kddeyvc0orDdI80NpJVjsI5WmhAdaiwqWm XS0rgp0GYXWXbsEyLtA3Z/BFxXJXVN2pGGxwZ02suSGQF7rhtDENNLoBcyZn9rNgSog2tWnhOebx9 mnZufOU918HMxJ85HJiGMooVCiBRnRiYi6ZDaY4P0j/va0HCN8reKyhRWeplyEm3A13SlvU5kzYN3 pALKJdJZjdur6hHw4EjfaSOdih5AZXDhkcpdcD2gfOwbGBihaf816G92j9wAqXxS4DgasFozQFLXK li7X9ByA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1curcM-0004B2-7z; Mon, 03 Apr 2017 02:21:18 +0000 Received: from mail-pg0-x231.google.com ([2607:f8b0:400e:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1curcI-00048l-1F for linux-arm-kernel@lists.infradead.org; Mon, 03 Apr 2017 02:21:15 +0000 Received: by mail-pg0-x231.google.com with SMTP id g2so104372515pge.3 for ; Sun, 02 Apr 2017 19:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0iB3LohWJC8kICFbW6qCFPZc+ysxD1OuTwBc4cLSYk8=; b=ifFwE+lOuUHiggK4k5J9UO0GbMuP1M4UqJWvH7zfjXCSY4p4nwdAIz2wwjsc1J0F8C HL3ravBQXaBOowoUrPDYxkWiVLCBMR28yfi3CWxNQDx6Ycbd9SCi7N1+u0XZvsuP93w3 tfKOcyVWimC+32jXM5bdThJ5Nh7baAoeQArNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0iB3LohWJC8kICFbW6qCFPZc+ysxD1OuTwBc4cLSYk8=; b=uesO07jQQAhMeuM7FJP3SC4qrh0x5GBgBoYJHrCdPIUoebbCmTqV5qwbC67QIonTaV tpg3hunbCZREwhnhD/D3PTFKv2T9JCvhVGcQfSSYMDhxgGyR3OuHdnx5M+JjYrTjgZ6Z u7BuoOOT9F0xZuvppXCTS4Q9tVeHiePOaAueuBGnMpusS5Rfyu0qsqAmT7qEa2DDRrvH /yUYndfAcPUn8SVhvVrEuqNploim/Vod0dZBWKRo8ejiSoQqzlW0ZeU2GPQ6n9xphOvf F6UYvx5EW6zyWbBaoj7IPAR3GwyEPoSJ1nNaGplCJZc1UYW/S5wUGqeqX0JaXyeG3y6r ahJQ== X-Gm-Message-State: AFeK/H1NpsRgWOt9/8thhO258vfYacQDLyYtFg+WE5jMhF/SkU5TPGnddxcgvUvSOmcBiVJx X-Received: by 10.98.74.9 with SMTP id x9mr13983364pfa.29.1491186053234; Sun, 02 Apr 2017 19:20:53 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id u64sm22126426pfk.113.2017.04.02.19.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Apr 2017 19:20:52 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org Subject: [PATCH v35 01/14] memblock: add memblock_clear_nomap() Date: Mon, 3 Apr 2017 11:23:54 +0900 Message-Id: <20170403022355.12463-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170403022139.12383-1-takahiro.akashi@linaro.org> References: <20170403022139.12383-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170402_192114_114484_8071D6FE X-CRM114-Status: GOOD ( 11.88 ) 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: mark.rutland@arm.com, panand@redhat.com, ard.biesheuvel@linaro.org, geoff@infradead.org, dwmw2@infradead.org, AKASHI Takahiro , kexec@lists.infradead.org, linux-mm@kvack.org, james.morse@arm.com, bauerman@linux.vnet.ibm.com, sgoel@codeaurora.org, dyoung@redhat.com, linux-arm-kernel@lists.infradead.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 This function, with a combination of memblock_mark_nomap(), will be used in a later kdump patch for arm64 when it temporarily isolates some range of memory from the other memory blocks in order to create a specific kernel mapping at boot time. Signed-off-by: AKASHI Takahiro Reviewed-by: Ard Biesheuvel --- include/linux/memblock.h | 1 + mm/memblock.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index bdfc65af4152..e82daffcfc44 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -93,6 +93,7 @@ int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size); int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size); int memblock_mark_mirror(phys_addr_t base, phys_addr_t size); int memblock_mark_nomap(phys_addr_t base, phys_addr_t size); +int memblock_clear_nomap(phys_addr_t base, phys_addr_t size); ulong choose_memblock_flags(void); /* Low level functions */ diff --git a/mm/memblock.c b/mm/memblock.c index 696f06d17c4e..2f4ca8104ea4 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -805,6 +805,18 @@ int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size) } /** + * memblock_clear_nomap - Clear flag MEMBLOCK_NOMAP for a specified region. + * @base: the base phys addr of the region + * @size: the size of the region + * + * Return 0 on success, -errno on failure. + */ +int __init_memblock memblock_clear_nomap(phys_addr_t base, phys_addr_t size) +{ + return memblock_setclr_flag(base, size, 0, MEMBLOCK_NOMAP); +} + +/** * __next_reserved_mem_region - next function for for_each_reserved_region() * @idx: pointer to u64 loop variable * @out_start: ptr to phys_addr_t for start address of the region, can be %NULL