From patchwork Fri Apr 22 16:48:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66466 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp826964qge; Fri, 22 Apr 2016 09:50:29 -0700 (PDT) X-Received: by 10.66.26.110 with SMTP id k14mr29875055pag.66.1461343829582; Fri, 22 Apr 2016 09:50:29 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id dg10si8527953pad.42.2016.04.22.09.50.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 09:50:29 -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 1ateGw-0002zB-5L; Fri, 22 Apr 2016 16:49:38 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ateG7-0001p2-OL for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2016 16:48:48 +0000 Received: by mail-wm0-x22b.google.com with SMTP id n3so35830075wmn.0 for ; Fri, 22 Apr 2016 09:48:27 -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=JGVgtD9QHJUiBUUT44GMUCgn01JtOtvPKlqq7qImE+I=; b=bIKpvBM1xCzHGUWf1hIwyITWgIDeAGfsvGjIb1HJIsTw6BaNe/D/hd1L1hyrDdgoQC XuAvAxnGRZ/aV/oqlL+xrhttULy6I/PbjHJezlInukgAB1YhMKFbCvVm55fr+yPgXJQ3 M+vaAGonbJyZRvIL4/U+YjG8TU4PpwxGqJ/uM= 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=JGVgtD9QHJUiBUUT44GMUCgn01JtOtvPKlqq7qImE+I=; b=YEyMbTmz2vMzlV7HZCrguqg9w5Yv11W4UOZnnH+Rhy0B3HsvpPb0v24oLuFxohXLYs B/YbKh/iCFLRGF7kE23GvmKfFVQYn1RaH8D6CLhof2oVECoV5loKmLhH4RwWABZXfKX6 h8Sxz8PE70XcdKpMCnHNtc3cXDYDyE0dTNUwZfcHjLsBGXdLiCiwXOeRBZzhAA0+93eE 8EgY4VJSRU1RLfJQGTHPyKv6zlyGoNZytVaL43hA+oT62CSlBtEK9FdfUjCEe3KfoFnu 5mfuCnFFkqODu0EndzqlfzblFTKHE3o9tMy5hMBX854KXtUQUFE6zPWxFb5/uBbyMSos vNyw== X-Gm-Message-State: AOPr4FUBYXsNv7ELEb4M1WCBELz4HaNNnzAxirMPYYgq+Z+1Pf7mZ5uDj1VzHNAsGvkMTe/g X-Received: by 10.194.248.135 with SMTP id ym7mr21231305wjc.174.1461343706111; Fri, 22 Apr 2016 09:48:26 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id h8sm4256015wmd.2.2016.04.22.09.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 09:48:25 -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 6/6] efi/arm*: add support to dump the EFI page tables Date: Fri, 22 Apr 2016 18:48:08 +0200 Message-Id: <1461343688-8552-7-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_094847_945609_BA244976 X-CRM114-Status: GOOD ( 12.68 ) 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:22b 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 From: Mark Rutland Occasionally it's useful to inspect the page tables used for EFI runtime services, similarly to those cases where it's useful to be able to inspect the kernel page tables. Now that the kernel page table dump code has been made generic, use it to export the EFI runtime services page tables under debugfs (as "efi_page_tables"). Signed-off-by: Mark Rutland [ ardb: mildly refactored for compatibility with ARM ] Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/arm-runtime.c | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 6ae21e41a429..c48fc2f5413b 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -27,6 +27,7 @@ #include #include #include +#include extern u64 efi_system_table; @@ -133,3 +134,23 @@ void efi_virtmap_unload(void) efi_set_pgd(current->active_mm); preempt_enable(); } + +static const struct addr_marker efi_addr_markers[] = { + { 0, "EFI runtime services" }, + { -1 }, +}; + +static struct ptdump_info efi_ptdump_info = { + .mm = &efi_mm, + .markers = efi_addr_markers, + .base_addr = 0, + .max_addr = SZ_1G, +}; + +static int efi_ptdump_init(void) +{ + if (!efi_enabled(EFI_RUNTIME_SERVICES)) + return 0; + return ptdump_register(&efi_ptdump_info, "efi_page_tables"); +} +device_initcall(efi_ptdump_init);