From patchwork Fri Sep 9 15:18:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 75902 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp401181qgf; Fri, 9 Sep 2016 08:20:34 -0700 (PDT) X-Received: by 10.66.82.42 with SMTP id f10mr7584374pay.17.1473434426738; Fri, 09 Sep 2016 08:20:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x80si4301624pff.224.2016.09.09.08.20.26; Fri, 09 Sep 2016 08:20:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754116AbcIIPUR (ORCPT + 27 others); Fri, 9 Sep 2016 11:20:17 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38395 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753613AbcIIPT2 (ORCPT ); Fri, 9 Sep 2016 11:19:28 -0400 Received: by mail-wm0-f49.google.com with SMTP id 1so38977698wmz.1 for ; Fri, 09 Sep 2016 08:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NaoT74pHYDlObAcMx6lObO/Oyn/Hi7PGpiBPnwxqfaA=; b=yhiBV3sswcvCRWncsA4gaH2dDdDuZn/S76zJUKi+iBVg28Az0YvxECJ8ptIuQnVYPG ndNdaBSGZePcW9s0iJ1ACaQC6iLXe84Iqwj2uJDBEBgDfUCcD7LZdBg1IZiY78jIAt8U bJMyBbYc3VeqgGygMWunNZjS01kentsQci0uLZhFj5S/yN6vi3snBUYGeS7hu5ZbsUug Ilc/zIj4JHoLkM9RV0GIdJ630wW4n4oqyTwXIBgm8PDgLlZtOYlIrRTVOVIrWiiSlwft Myht6w6MPfUIoo0BW3L6jY1I9dk4tY85Ir/teAoMYYKIsF+UTJxSCuIPKOEy7PNbb3/A NRZQ== 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=NaoT74pHYDlObAcMx6lObO/Oyn/Hi7PGpiBPnwxqfaA=; b=ldXZjcxbpfkW2FAYIWxIAlq2USBht1MCgj/oRlR2RTL14Ojam/JtXEyViblZ1hyeAg mr2YXLWn9kDWt3WUaUQUiyfCDe6JsYfa5KRb8ue/alXCboHmflKBlmuWKuzS4IigQdYG e9NlH6Vuwsl0jpIwLu0HRmdlwY03UKwVQ/1Bfb/SbCGlx60rFfdKllHYZd/hcWAltaxX U/PXB/SasW32ygEFzxVc+wITKc0wOknvSQ99s6V5JzieD5xXzGjZeVa0aWqisrTMdMyo 92ETXoUEiqYXvhALO7YrNeHs7YHHhBfa/bRXl5Gibo0XdgXSArpueD03OsikPENfjwD4 GCtw== X-Gm-Message-State: AE9vXwMxFLKz/sr1RGdVuApm4CTJ8Rj/mpjbZAKx5bAmUxmyLhyAjoUwvd04H2S2HA4CmA== X-Received: by 10.28.198.130 with SMTP id w124mr3365159wmf.63.1473434361909; Fri, 09 Sep 2016 08:19:21 -0700 (PDT) Received: from localhost ([2a02:c7f:9225:4100:de53:60ff:fe39:5599]) by smtp.gmail.com with ESMTPSA id v2sm3870633wmf.3.2016.09.09.08.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 08:19:21 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Leif Lindholm , Mark Rutland Subject: [PATCH 23/29] efi/arm64: Add debugfs node to dump UEFI runtime page tables Date: Fri, 9 Sep 2016 16:18:45 +0100 Message-Id: <20160909151851.27577-24-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909151851.27577-1-matt@codeblueprint.co.uk> References: <20160909151851.27577-1-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel 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. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Cc: Leif Lindholm Signed-off-by: Matt Fleming --- drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.9.3 diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index ae001450545f..7c75a8d9091a 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;