From patchwork Tue Aug 16 12:13:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 74012 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1965985qga; Tue, 16 Aug 2016 05:14:57 -0700 (PDT) X-Received: by 10.98.204.74 with SMTP id a71mr63769980pfg.149.1471349696939; Tue, 16 Aug 2016 05:14:56 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ut2si31944639pac.226.2016.08.16.05.14.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 05:14:56 -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.85_2 #1 (Red Hat Linux)) id 1bZdFg-0001iH-NE; Tue, 16 Aug 2016 12:13:52 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZdFc-0001dP-LO for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2016 12:13:49 +0000 Received: by mail-wm0-x235.google.com with SMTP id q128so140011263wma.1 for ; Tue, 16 Aug 2016 05:13:28 -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; bh=gq17N6KJTpkMnDi2OwRHasLqprXu0cwP/9qzkeEPSR8=; b=GzjU6htHwgXRFLZLxPoElhGyAQTow4en5zYiYw4BD5UMQRAyUhJCCInFFlAey3xkWm 09hLixbfi7XIu04JBpe05gbh5+uSGDh8SnvDY2nT4/wpjNaJhCFANj4tsqFB7I++JXI7 q4Th2BdTnKoU+5eWnsdSujC1Hvmhu4BsywwV8= 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; bh=gq17N6KJTpkMnDi2OwRHasLqprXu0cwP/9qzkeEPSR8=; b=lye8z3lBGoXQF1m9m1zOPdrnuKq/yzIgbiKKmjR/PtpaFOD+6e3KekJcLLSSwG0UqZ WnfKdNYsWmoqLXc0gH82m4NrzvXXNT1eQmbekDeDVGobf3ZAwWEnOiemnCvTjl0+PCXe JGIo2vqlvz1bZ5yaQGdR1srVxR7Qri5GUW7MDMuvGPUOjuHhW5X3B0958tMNS8yiusYN wBqZqRR4dLDK/xH5sLURqw4uYIkO7morpPpBpRyktorZrys4jeOqiQbbciJ0mWZ6VVG/ FP3qgFN/5uPWdqU+55EW8uhLKGIJerVqlQwbqcQusdHODA5usjZy1drRuxbKyxP4Nn8L xRDQ== X-Gm-Message-State: AEkoouuvNnXDhQd2gaIKS1AIIYp+n2AZKZPVefVWzDk0pHteY8LrG0TGcBbZ0ckgjuwRa6tM X-Received: by 10.194.116.1 with SMTP id js1mr3239702wjb.183.1471349606873; Tue, 16 Aug 2016 05:13:26 -0700 (PDT) Received: from localhost.localdomain (46.red-81-37-107.dynamicip.rima-tde.net. [81.37.107.46]) by smtp.gmail.com with ESMTPSA id s6sm26398086wjm.25.2016.08.16.05.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 05:13:25 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, mark.rutland@arm.com Subject: [PATCH v2] efi: arm64: add debugfs node to dump UEFI runtime page tables Date: Tue, 16 Aug 2016 14:13:21 +0200 Message-Id: <1471349601-31257-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160816_051349_028301_5EF93978 X-CRM114-Status: GOOD ( 10.94 ) 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:235 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 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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Register the debugfs node 'efi_page_tables' to allow the UEFI runtime page tables to be inspected. Note that ARM does not have 'asm/ptdump.h' [yet] so for now, this is arm64 only. Acked-by: Mark Rutland Signed-off-by: Ard Biesheuvel --- v2: test for CONFIG_ARM64_PTDUMP rather than CONFIG_ARM64 add Mark's ack drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++ 1 file changed, 20 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 c394b81fe452..7ff61749acef 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -39,6 +39,26 @@ static struct mm_struct efi_mm = { .mmlist = LIST_HEAD_INIT(efi_mm.mmlist), }; +#ifdef CONFIG_ARM64_PTDUMP +#include + +static struct ptdump_info efi_ptdump_info = { + .mm = &efi_mm, + .markers = (struct addr_marker[]){ + { 0, "UEFI runtime start" }, + { TASK_SIZE_64, "UEFI runtime end" } + }, + .base_addr = 0, +}; + +static int __init ptdump_init(void) +{ + return ptdump_register(&efi_ptdump_info, "efi_page_tables"); +} +device_initcall(ptdump_init); + +#endif + static bool __init efi_virtmap_init(void) { efi_memory_desc_t *md;