From patchwork Fri Apr 22 16:48:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66461 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp826629qge; Fri, 22 Apr 2016 09:49:48 -0700 (PDT) X-Received: by 10.98.101.193 with SMTP id z184mr29596674pfb.142.1461343788897; Fri, 22 Apr 2016 09:49:48 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id c19si8473530pal.183.2016.04.22.09.49.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 09:49:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for 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; dmarc=fail (p=NONE dis=NONE) header.from=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 1ateGA-00021t-61; Fri, 22 Apr 2016 16:48:50 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ateFy-0001kc-2f for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2016 16:48:38 +0000 Received: by mail-wm0-x231.google.com with SMTP id n3so35824158wmn.0 for ; Fri, 22 Apr 2016 09:48:17 -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=xL/KeKR8R8lSK1a4a5v25l41VJpnfjy1cUpzKEyovPY=; b=SgYsjjuDvZU0qrZVoIis+PMylz8T5SWH8t3prXtGhsQDu0PeiwDsQj+92DO9YhifWi AA4DOIUGgp7CsVUCncap6HcQYQCHCebiOPMbs55GpUM9VMTKvwF8EIcbF+gQ4s+DytAa qNXUPLqUI9IrorJez8hwQdHcToRqzylsXB7zU= 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=xL/KeKR8R8lSK1a4a5v25l41VJpnfjy1cUpzKEyovPY=; b=i9IayeSg0BGRiPNzjTvBCcWSldohbd9ATUnkcJtYbhkgXD84iZJbkY0V4R0GlNilOM DCHAGw0cTw4kV9/QZ/N/X6iWjqFiNhvTfQQzzk53Oa9gjWPHKfb4T9Fi3sCtB2UwW7gA SeyK4krCERtdCnekQoIi0ne01J1YSZsVryLcuzrSAT6HjGEIR1rNUQWhXxQMQLhUq8JW blf7Vq63RMhLFIiK8EsO6lMa+ksOPnrYPbRC1Wp0NZNwCzz4QkusdzFhcsTNyRi+bA3O Y1YPTCxW3xcrjjNZu58dSUbnJIcqJikGqtuTHP5pqYetvqkhtJgs5YOiKxtuDNqN5ICD /ctA== X-Gm-Message-State: AOPr4FX/svtpu1kgJPosTuBZJrnXDrIwLm1gilg9BhuAYBTVNnTYVxRlD0Xj3TnSwLTlBvUU X-Received: by 10.194.74.231 with SMTP id x7mr20849418wjv.60.1461343696435; Fri, 22 Apr 2016 09:48:16 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id h8sm4256015wmd.2.2016.04.22.09.48.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 09:48:15 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, linux@arm.linux.org.uk Subject: [PATCH v2 1/6] arm64: ptdump: use static initializers for vmemmap region boundaries Date: Fri, 22 Apr 2016 18:48:03 +0200 Message-Id: <1461343688-8552-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.org> References: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160422_094838_326290_8825569B X-CRM114-Status: GOOD ( 11.67 ) 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:231 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: will.deacon@arm.com, keescook@chromium.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org There is no need to initialize the vmemmap region boundaries dynamically, since they are compile time constants. So just add these constants to the global struct initializer, and drop the dynamic assignment and related code. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/dump.c | 49 ++++++-------------- 1 file changed, 13 insertions(+), 36 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel Acked-by: Mark Rutland diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index a21f47421b0c..493461159462 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -32,37 +32,21 @@ struct addr_marker { const char *name; }; -enum address_markers_idx { - MODULES_START_NR = 0, - MODULES_END_NR, - VMALLOC_START_NR, - VMALLOC_END_NR, - FIXADDR_START_NR, - FIXADDR_END_NR, - PCI_START_NR, - PCI_END_NR, +static const struct addr_marker address_markers[] = { + { MODULES_VADDR, "Modules start" }, + { MODULES_END, "Modules end" }, + { VMALLOC_START, "vmalloc() Area" }, + { VMALLOC_END, "vmalloc() End" }, + { FIXADDR_START, "Fixmap start" }, + { FIXADDR_TOP, "Fixmap end" }, + { PCI_IO_START, "PCI I/O start" }, + { PCI_IO_END, "PCI I/O end" }, #ifdef CONFIG_SPARSEMEM_VMEMMAP - VMEMMAP_START_NR, - VMEMMAP_END_NR, + { VMEMMAP_START, "vmemmap start" }, + { VMEMMAP_START + VMEMMAP_SIZE, "vmemmap end" }, #endif - KERNEL_SPACE_NR, -}; - -static struct addr_marker address_markers[] = { - { MODULES_VADDR, "Modules start" }, - { MODULES_END, "Modules end" }, - { VMALLOC_START, "vmalloc() Area" }, - { VMALLOC_END, "vmalloc() End" }, - { FIXADDR_START, "Fixmap start" }, - { FIXADDR_TOP, "Fixmap end" }, - { PCI_IO_START, "PCI I/O start" }, - { PCI_IO_END, "PCI I/O end" }, -#ifdef CONFIG_SPARSEMEM_VMEMMAP - { 0, "vmemmap start" }, - { 0, "vmemmap end" }, -#endif - { PAGE_OFFSET, "Linear Mapping" }, - { -1, NULL }, + { PAGE_OFFSET, "Linear Mapping" }, + { -1, NULL }, }; /* @@ -347,13 +331,6 @@ static int ptdump_init(void) for (j = 0; j < pg_level[i].num; j++) pg_level[i].mask |= pg_level[i].bits[j].mask; -#ifdef CONFIG_SPARSEMEM_VMEMMAP - address_markers[VMEMMAP_START_NR].start_address = - (unsigned long)virt_to_page(PAGE_OFFSET); - address_markers[VMEMMAP_END_NR].start_address = - (unsigned long)virt_to_page(high_memory); -#endif - pe = debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops); return pe ? 0 : -ENOMEM;