From patchwork Tue Feb 2 17:56:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61036 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp884757lbb; Tue, 2 Feb 2016 09:58:26 -0800 (PST) X-Received: by 10.98.76.80 with SMTP id z77mr49252079pfa.121.1454435906408; Tue, 02 Feb 2016 09:58:26 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id cx6si3141857pad.130.2016.02.02.09.58.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 09:58:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQfCe-0005mo-5i; Tue, 02 Feb 2016 17:57:24 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQfCS-0005iw-VW for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2016 17:57:13 +0000 Received: by mail-wm0-x230.google.com with SMTP id p63so34771635wmp.1 for ; Tue, 02 Feb 2016 09:56:52 -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=Hm9nWxZs6+oCAx2KAg+wIVrNaJUpeIUjXAt+o3uVtW8=; b=MnOaRueHsuvlxgIrOoduGMnip38/LoqkuIg8EE2O5KDtK/IeVffJcv32AFJkVe3xKa XyO7pHX5jlB4SD2WnQXm56L1f6UZBiBoqwrXuhPLhvcU+LH0vJlhdaJ1zhn8l2CLnnxt VOPs9Eq1cOW4kr0lLnokjOK50KF+JrFg7NM0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hm9nWxZs6+oCAx2KAg+wIVrNaJUpeIUjXAt+o3uVtW8=; b=nKj2FZQIvYfe3vZWy2ltRhnXpZ9p3sD3MfM67183WaPhxY7+yMx/LNIvi8DSk2aVuB wqVmXL0oMdSR5e6sUiKZ5sF4CuHJnCMh5DzxuN5w0vxMVQTbcPjDoJy7DCPE4KE9evYD uFgZ3WMCB7O1xzFSmq2uYv21zKejbuVDx7n2Mxgq4kY8eb5TUpgTrQMXUNOcaD8LAfta PP9MnmTt473kb9e58UcZdEFaY4FkO4aKC6d4wlZeXw3FxlIeE3P7Tij5Z7eKzRLNzrIW QqRjnZt8NGDhDiC3y8+2yYFpnd/qz1uX0OkKnTgsDaXCY60Hj6KYm6rwOC12mRkpP7yt ivGg== X-Gm-Message-State: AG10YOQQBlbyC5Vj7tDfjjuDArsVrgWy1AOZ2EHMesSsfLF318IbqC4Y5yWqE1SSplI4ZkFR X-Received: by 10.194.89.72 with SMTP id bm8mr29321859wjb.60.1454435811475; Tue, 02 Feb 2016 09:56:51 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id z127sm17556513wme.2.2016.02.02.09.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 09:56:50 -0800 (PST) From: Ard Biesheuvel To: msalter@redhat.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 1/3] memblock: add routine to clear the MEMBLOCK_NOMAP flag for a region Date: Tue, 2 Feb 2016 18:56:40 +0100 Message-Id: <1454435802-7604-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454435802-7604-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454435802-7604-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160202_095713_210205_8180FC24 X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org In addition to the existing memblock_mark_nomap(), this implements memblock_clear_nomap() to do the converse. Signed-off-by: Ard Biesheuvel --- include/linux/memblock.h | 1 + mm/memblock.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 3106ac1c895e..f7d2c8dc2f0d 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 335a145b75cd..ffa7ab127641 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -835,6 +835,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