From patchwork Tue Feb 7 08:08:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9559335 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 79A9160216 for ; Tue, 7 Feb 2017 08:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CCD1204C2 for ; Tue, 7 Feb 2017 08:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61BA428178; Tue, 7 Feb 2017 08:08:12 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no 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 76247204C2 for ; Tue, 7 Feb 2017 08:08:11 +0000 (UTC) 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 1cb0oq-0003VD-Fc; Tue, 07 Feb 2017 08:08:08 +0000 Received: from mail-pg0-f48.google.com ([74.125.83.48]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cb0ol-0003FV-RW for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 08:08:05 +0000 Received: by mail-pg0-f48.google.com with SMTP id 14so36719813pgg.1 for ; Tue, 07 Feb 2017 00:07:43 -0800 (PST) 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=xqSWOFD11j+2bP6n6AFhTBIb8kiLTSEtNb45urynhnw=; b=MAXrO/jtvFfk2WJ4c/RC2fTmotZERuJ+hTY0gvPZ26y8K5szKqW2zPq745XxkXH3WG RSumgNIiY2et45EvifYCNZP4N9IW+beiMrQkMNGriAC6rCZ66hgsIrwz8EGwLe82yqgz MYvPJpNJWh2gTBTkPkD07gjpDG6mtHGw75SPI= 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=xqSWOFD11j+2bP6n6AFhTBIb8kiLTSEtNb45urynhnw=; b=uM1mSJsUBMCCenL2gQRmKC1obBtAx+fll/xjIvDABtGSCUX1cUTx8E1JjUsMgrNLEZ TOv5q3jradYXf42PSh7PAlpJmvp8DZ/OEEsYNzHEyN2+pRjE5Pf5NppMoKllICPxn5Ow oOg5U1M+gZM/zPRRuYeFFnQx7Fu0mZsU4h8gUdQOj7xfg3CQ4OEPoJ0KwfuliSOhYQKf yx6XEYITDFDi5fNxSWtRQaENWdz8Nz4T47PN+DbKofiWYCFZ3zXCce01dt19LARAhbDv yP3feI3vEYR5PLRmidyHJIr6wb2HriwWjwzQnrsf2bHV1NvePuqfrc3+PHZ0WY9xtLmS O50Q== X-Gm-Message-State: AIkVDXKPSAaTtRsj2k0O1TGVKb1vnaMjVd82pI2TNf9fEKeeLsWLRPjAHhHl7zcavXKhSSJP X-Received: by 10.98.20.81 with SMTP id 78mr18108471pfu.171.1486454803020; Tue, 07 Feb 2017 00:06:43 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id l12sm8544866pfj.37.2017.02.07.00.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 00:06:42 -0800 (PST) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org Subject: [PATCH v32 01/13] memblock: add memblock_clear_nomap() Date: Tue, 7 Feb 2017 17:08:09 +0900 Message-Id: <20170207080810.5890-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170207080601.5816-1-takahiro.akashi@linaro.org> References: <20170207080601.5816-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_000803_956322_79C9AAB4 X-CRM114-Status: GOOD ( 12.20 ) 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, AKASHI Takahiro , geoff@infradead.org, kexec@lists.infradead.org, linux-mm@kvack.org, james.morse@arm.com, bauerman@linux.vnet.ibm.com, 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 --- 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 5b759c9acf97..5f7825752b15 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -92,6 +92,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 7608bc305936..07c85ec2c035 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -814,6 +814,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