From patchwork Sat Nov 18 04:26:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10064327 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 225F16023A for ; Sat, 18 Nov 2017 04:27:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E2112924C for ; Sat, 18 Nov 2017 04:27:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 129022AD54; Sat, 18 Nov 2017 04:27:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDD132924C for ; Sat, 18 Nov 2017 04:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161508AbdKRE1j (ORCPT ); Fri, 17 Nov 2017 23:27:39 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:39310 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161502AbdKRE1i (ORCPT ); Fri, 17 Nov 2017 23:27:38 -0500 Received: by mail-pg0-f44.google.com with SMTP id 70so3403866pgf.6 for ; Fri, 17 Nov 2017 20:27:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=9mJBgg+J1cXo5itCk07sMLppuFCeVe2Fd73hw2PFRc0=; b=C9iK/z8fj2T6BG0sAlLNjTqySifx/MIzzj1IcE73/S/1YqGrJ0GpcTGzmVm3ZlXDap E/7Bb5SwnxqaT7OL5Gzxm7CCcaNgZ6q1v+IrDM1rY9crx3hkC1vr5vqU3hQkb4PL83L0 ieOsyZYd3bb7JsACIiq/EI8RFJRMyvb8H39cbnmwYAWm/oIEvKrXeePp5dukZsFFigTz TV8QCdusfRp4SMs7LA0Mm677F/PI0/kg3x7pmf3mBK/8k8Mi8hxXHOY9HcHnSHGAufGk iwU6pbPu3To684uzvYJxZoBCskTLD0DWy92k0Lu/IQMqKysPFK2l09LNBGEvn65sTs9d 9S2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=9mJBgg+J1cXo5itCk07sMLppuFCeVe2Fd73hw2PFRc0=; b=HT0bJg/TvBN5MbszBgjDslYiaQV9CbLQqZsy8JaPxEA0pkj7XtRUn0ThDYuexuJvHI xiFzAsgIRSUbEs7lsebxx6oIc5kl70s6eRK/Qh1mqubPf7LyRK/sabz46Ir+47TOOwaS ZCZTfbZve/VsCujFAuMPcX0wg1rtRN/PLZkUH/HC0DJ+fDxO2uMzpl/CmkwUeq9RAWp7 HVVKG7B0qjCOf7Wkkezw7CXMU2VtoTAni45MM+v/7MD5RRnj0ZBqaAZDWuOos1QTNVob Vj7gaWGTgh8yNNjx0f2EUDjOfvT5LpuzPa0GF32x1b90Wt8ZpNXngH95Lj74zmk9OSrK FMeg== X-Gm-Message-State: AJaThX50vWz52eYSJW8YZJ5WvWpQlYq0XzUk72dvOgkdCb3gZOQ4yWfB ov7ncvcNuXACoLl+cWi74RM8c9sc X-Google-Smtp-Source: AGs4zMbLchE/1naKo5yB1pESA95Ubgiq+SoM8K+kzg8dcYwGXlQGB+g1DlqKNu5OFaiw5znqSSEYgQ== X-Received: by 10.99.5.200 with SMTP id 191mr7260540pgf.450.1510979257992; Fri, 17 Nov 2017 20:27:37 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id i3sm8372944pgc.88.2017.11.17.20.27.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 20:27:36 -0800 (PST) From: Magnus Damm To: linux-renesas-soc@vger.kernel.org Cc: Magnus Damm Date: Sat, 18 Nov 2017 13:26:08 +0900 Message-Id: <151097916855.24365.7878516664878862365.sendpatchset@little-apple> In-Reply-To: <151097915979.24365.675151091819205104.sendpatchset@little-apple> References: <151097915979.24365.675151091819205104.sendpatchset@little-apple> Subject: [PATCH/RFC 01/04] iommu: Hack to dump page table configuration on boot Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Adjust code to output page table configuration on boot. Not for upstream merge. Not-Yet-Signed-off-by: Magnus Damm --- drivers/iommu/io-pgtable-arm.c | 12 ++++++++++++ drivers/iommu/io-pgtable.c | 4 ++++ 2 files changed, 16 insertions(+) --- 0001/drivers/iommu/io-pgtable-arm.c +++ work/drivers/iommu/io-pgtable-arm.c 2017-11-17 12:44:09.100607110 +0900 @@ -970,6 +970,18 @@ struct io_pgtable_init_fns io_pgtable_ar .free = arm_lpae_free_pgtable, }; +void arm_lpae_dump(struct io_pgtable_ops *ops) +{ + struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops); + struct io_pgtable_cfg *cfg = &data->iop.cfg; + + pr_err("cfg: pgsize_bitmap 0x%lx, ias %u-bit\n", + cfg->pgsize_bitmap, cfg->ias); + pr_err("data: %d levels, 0x%zx pgd_size, %lu pg_shift, %lu bits_per_level, pgd @ %p\n", + data->levels, data->pgd_size, data->pg_shift, + data->bits_per_level, data->pgd); +} + #ifdef CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST static struct io_pgtable_cfg *cfg_cookie; --- 0001/drivers/iommu/io-pgtable.c +++ work/drivers/iommu/io-pgtable.c 2017-11-17 12:44:31.290607110 +0900 @@ -37,6 +37,8 @@ io_pgtable_init_table[IO_PGTABLE_NUM_FMT #endif }; +void arm_lpae_dump(struct io_pgtable_ops *ops); + struct io_pgtable_ops *alloc_io_pgtable_ops(enum io_pgtable_fmt fmt, struct io_pgtable_cfg *cfg, void *cookie) @@ -59,6 +61,8 @@ struct io_pgtable_ops *alloc_io_pgtable_ iop->cookie = cookie; iop->cfg = *cfg; + arm_lpae_dump(&iop->ops); + return &iop->ops; }