From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29F98C433DB for ; Fri, 15 Jan 2021 15:22:29 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A4E52389B for ; Fri, 15 Jan 2021 15:22:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A4E52389B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0FEDC86BC6; Fri, 15 Jan 2021 15:22:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gae3c6n9euNj; Fri, 15 Jan 2021 15:22:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A8D286AC7; Fri, 15 Jan 2021 15:22:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0922CC088B; Fri, 15 Jan 2021 15:22:27 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3A39CC013A for ; Fri, 15 Jan 2021 15:22:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1E74520442 for ; Fri, 15 Jan 2021 15:22:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TbIeXoRgEbzJ for ; Fri, 15 Jan 2021 15:22:24 +0000 (UTC) X-Greylist: delayed 00:08:09 by SQLgrey-1.7.6 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) by silver.osuosl.org (Postfix) with ESMTPS id BBB6B20381 for ; Fri, 15 Jan 2021 15:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GcJq7gJcR8wGrxirpS7YgCH4oSZ0tPUnT6P18IedXe8=; b=HC/dbq+U8x8b6ApN9wq3/+KMa 1DkEFnV9V67022GmrLF4V0dTmTPtKRHK3+l2RiRj73GzJ6+hmcivNMhj91+GhwpcsixXqafkOgMQe C5ELjmoxpCJaxxiwADge7gYaIKE0yfBABw/675IirMTagdIVwZbrdd7svGF+2GMAUF7Ftbms77YMU 0gl3QdE8eLhhqH9Ov23nEBTFDVLmha3LRn9SSXkiDw22HFu3eFH/G01xlayfrSJMWL5TFhrFPDd8V jd8rilZ3Wx5LtFhi+dOTNXsJqQggBqLcqs77ar8EOGkXCBf9PfVB4y5vbDt7JUzmA3ShDya0xYvw3 9BSZE9axQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48344) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0Qnf-0003vO-Uo; Fri, 15 Jan 2021 15:14:07 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1l0Qnc-00013o-7F; Fri, 15 Jan 2021 15:14:04 +0000 Date: Fri, 15 Jan 2021 15:14:04 +0000 From: Russell King - ARM Linux admin To: Robin Murphy Subject: Re: Consult on ARM SMMU debugfs Message-ID: <20210115151403.GZ1551@shell.armlinux.org.uk> References: <9a23610f-e0b4-92e6-6da6-3182d481db92@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a23610f-e0b4-92e6-6da6-3182d481db92@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: iommu@lists.linux-foundation.org, will@kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Jan 11, 2021 at 08:01:48PM +0000, Robin Murphy wrote: > On 2021-01-07 02:45, chenxiang (M) wrote: > > Hi Will,=A0 Robin or other guys, > > = > > When debugging SMMU/SVA issue on huawei ARM64 board, we find that it > > lacks of enough debugfs for ARM SMMU driver (such as > > = > > the value of STE/CD which we need to check sometimes). Currently it > > creates top-level iommu directory in debugfs, but there is no debugfs > > = > > for ARM SMMU driver specially. Do you know whether ARM have the plan to > > do that recently? > = > FWIW I don't think I've ever felt the need to need to inspect the Stream > Table on a live system. So far the nature of the STE code has been simple > enough that it's very hard for any given STE to be *wrong* - either it's = set > up as expected and thus works fine, or it's not initialised at all and you > get C_BAD_STE, where 99% of the time you then just cross-reference the > Stream ID against the firmware and find that the DT/IORT is wrong. > = > Similarly I don't think I've even even *seen* an issue that could be > attributed to a context descriptor, although I appreciate that as we start > landing more PASID and SVA support the scope for that starts to widen > considerably. > = > Feel free to propose a patch if you believe it would be genuinely useful = and > won't just bit-rot into a maintenance burden, but it's not something that= 's > on our roadmap here. I do think that the IOMMU stuff needs better debugging. I've hit the WARN_ON() in __arm_lpae_map(), and it's been pretty much undebuggable, so I've resorted to putting the IOMMU into bypass mode permanently to work around the issue. The reason that it's undebuggable is if one puts printk() or trace statements in the code, boots the platform, you get flooded with those debugging messages, because every access to the rootfs generates and tears down a mapping. It would be nice to be able to inspect the IOMMU page tables and state of the IOMMU, rather than having to resort to effectively disabling the IOMMU. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 050FBC433DB for ; Fri, 15 Jan 2021 15:15:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF6B223888 for ; Fri, 15 Jan 2021 15:15:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF6B223888 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0bKnQcHkRk5Et4n9+3bg7pMx8ByOhNlSg4o5ByuBFzo=; b=FJVj/qJE28xW7v2QSLWT6MCCa HZfgRQF/CyxXuIPZWDT9awYqEuWqA+8WVuApQQ2bOZPmDt7J2rKjP1Lo472Uhrr3uWuRKVMhtXnJr Sdz7kX+rn4iVGJOD1Zl9pdG4BPvk3/Up5V3FRBYW0q1LHwLPw9L90JxhqJM/ZU09bn9fcBFYXCqga CL196ZGzpEP/cyuPDU8+5EPo3wY6/+o79uOMFHmJP45TdmJZTzdSk9iJw5pXWOX6KsID7YHKRdFKW ghvAuyXEvnIxM7r8r9ENn4RDCLd6J1bAfTARmMNx+SWJaqCs5uUtugZ2LuabK9xehmKITAwD10Q8R j9+Ct4kCA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Qnw-0002MK-IQ; Fri, 15 Jan 2021 15:14:24 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Qnu-0002Lr-Sw for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 15:14:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GcJq7gJcR8wGrxirpS7YgCH4oSZ0tPUnT6P18IedXe8=; b=HC/dbq+U8x8b6ApN9wq3/+KMa 1DkEFnV9V67022GmrLF4V0dTmTPtKRHK3+l2RiRj73GzJ6+hmcivNMhj91+GhwpcsixXqafkOgMQe C5ELjmoxpCJaxxiwADge7gYaIKE0yfBABw/675IirMTagdIVwZbrdd7svGF+2GMAUF7Ftbms77YMU 0gl3QdE8eLhhqH9Ov23nEBTFDVLmha3LRn9SSXkiDw22HFu3eFH/G01xlayfrSJMWL5TFhrFPDd8V jd8rilZ3Wx5LtFhi+dOTNXsJqQggBqLcqs77ar8EOGkXCBf9PfVB4y5vbDt7JUzmA3ShDya0xYvw3 9BSZE9axQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48344) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0Qnf-0003vO-Uo; Fri, 15 Jan 2021 15:14:07 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1l0Qnc-00013o-7F; Fri, 15 Jan 2021 15:14:04 +0000 Date: Fri, 15 Jan 2021 15:14:04 +0000 From: Russell King - ARM Linux admin To: Robin Murphy Subject: Re: Consult on ARM SMMU debugfs Message-ID: <20210115151403.GZ1551@shell.armlinux.org.uk> References: <9a23610f-e0b4-92e6-6da6-3182d481db92@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a23610f-e0b4-92e6-6da6-3182d481db92@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_101422_952303_FC636ACE X-CRM114-Status: GOOD ( 23.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: iommu@lists.linux-foundation.org, John Garry , will@kernel.org, linux-arm-kernel@lists.infradead.org, "chenxiang \(M\)" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 11, 2021 at 08:01:48PM +0000, Robin Murphy wrote: > On 2021-01-07 02:45, chenxiang (M) wrote: > > Hi Will,=A0 Robin or other guys, > > = > > When debugging SMMU/SVA issue on huawei ARM64 board, we find that it > > lacks of enough debugfs for ARM SMMU driver (such as > > = > > the value of STE/CD which we need to check sometimes). Currently it > > creates top-level iommu directory in debugfs, but there is no debugfs > > = > > for ARM SMMU driver specially. Do you know whether ARM have the plan to > > do that recently? > = > FWIW I don't think I've ever felt the need to need to inspect the Stream > Table on a live system. So far the nature of the STE code has been simple > enough that it's very hard for any given STE to be *wrong* - either it's = set > up as expected and thus works fine, or it's not initialised at all and you > get C_BAD_STE, where 99% of the time you then just cross-reference the > Stream ID against the firmware and find that the DT/IORT is wrong. > = > Similarly I don't think I've even even *seen* an issue that could be > attributed to a context descriptor, although I appreciate that as we start > landing more PASID and SVA support the scope for that starts to widen > considerably. > = > Feel free to propose a patch if you believe it would be genuinely useful = and > won't just bit-rot into a maintenance burden, but it's not something that= 's > on our roadmap here. I do think that the IOMMU stuff needs better debugging. I've hit the WARN_ON() in __arm_lpae_map(), and it's been pretty much undebuggable, so I've resorted to putting the IOMMU into bypass mode permanently to work around the issue. The reason that it's undebuggable is if one puts printk() or trace statements in the code, boots the platform, you get flooded with those debugging messages, because every access to the rootfs generates and tears down a mapping. It would be nice to be able to inspect the IOMMU page tables and state of the IOMMU, rather than having to resort to effectively disabling the IOMMU. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel