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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 3540DC11F65 for ; Wed, 30 Jun 2021 08:56:25 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 D284561CEF for ; Wed, 30 Jun 2021 08:56:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D284561CEF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A194F608CF; Wed, 30 Jun 2021 08:56:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hk04I00M-e-w; Wed, 30 Jun 2021 08:56:23 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8FDE260633; Wed, 30 Jun 2021 08:56:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6947CC001A; Wed, 30 Jun 2021 08:56:23 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id CE9FCC000E for ; Wed, 30 Jun 2021 08:56:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BC22C403AA for ; Wed, 30 Jun 2021 08:56:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xHhepw_kB44H for ; Wed, 30 Jun 2021 08:56:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3D221401E8 for ; Wed, 30 Jun 2021 08:56:21 +0000 (UTC) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EDBED61CD7; Wed, 30 Jun 2021 08:56:20 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lyW14-00AmeG-SE; Wed, 30 Jun 2021 09:56:19 +0100 Date: Wed, 30 Jun 2021 09:56:12 +0100 Message-ID: <87h7hfybmb.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon , Robin Murphy Subject: Re: [PATCH] iommu/arm-smmu-v3: Add default domain quirk for Arm Fast Models In-Reply-To: <20210629173440.GA7556@willie-the-truck> References: <20210629173440.GA7556@willie-the-truck> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, mark.rutland@arm.com, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: mark.rutland@arm.com, andre.przywara@arm.com, iommu@lists.linux-foundation.org, catalin.marinas@arm.com, 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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, 29 Jun 2021 18:34:40 +0100, Will Deacon wrote: > > On Fri, Jun 18, 2021 at 05:24:49PM +0100, Robin Murphy wrote: > > Arm Fast Models are still implementing legacy virtio-pci devices behind > > the SMMU, which continue to be problematic as "real hardware" devices > > (from the point of view of the simulated system) without the mitigating > > VIRTIO_F_ACCESS_PLATFORM feature. > > > > Since we now have the ability to force passthrough on a device-specific > > basis, let's use it to work around this particular oddity so that people > > who just want to boot Linux on a model don't have to fiddle around with > > things to avoid the SMMU getting in the way by default (and I don't have > > to keep telling them which things...) > > > > Signed-off-by: Robin Murphy > > --- > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > Any chance of getting the fastmodels updated instead? It feels like it > has to happen *eventually*, and then there would be no need for this bodge. That'd be ideal. What are the chances of that happening before the Sun turns into a black hole? > Will > > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > index 54b2f27b81d4..13cf16e8f45b 100644 > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > @@ -2649,6 +2649,20 @@ static int arm_smmu_dev_disable_feature(struct device *dev, > > } > > } > > > > +static int arm_smmu_def_domain_type(struct device *dev) > > +{ > > + if (dev_is_pci(dev)) { > > + struct pci_dev *pdev = to_pci_dev(dev); > > + > > + /* Legacy virtio-block devices on Arm Fast Models */ > > + if (pdev->vendor == 0x1af4 && pdev->device == 0x1001 && > > + pdev->subsystem_vendor == 0x00ff && pdev->subsystem_device == 0x0002) > > + return IOMMU_DOMAIN_IDENTITY; > > + } > > + > > + return 0; > > +} Could this be expressed as a PCI quirk instead? It would at least keep the ID matching out of the SMMU driver... Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ 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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 3C784C11F65 for ; Wed, 30 Jun 2021 08:58:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EE25A61CD7 for ; Wed, 30 Jun 2021 08:58:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE25A61CD7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vFHK/8H9106vr+PHUQ6mQz7/1Ykhs/vIlsmfycKYDkk=; b=JOmwHDrUD+HF+B +dXnoFzwvzxjYlAfeU5In2X+lILxmAAGbzhujgGILL+UC+zNWK4NJTpLnu38Y1NLBgIeJVmnGHRL3 hYOLC4bglyJ/ziTl8C3SH4VhUQHTld8QUTWRC9N0c7M5wQS3dsmbYgYskJ3chr40BEG2T8aCE62VM wrGzqSbwMZQwKvpCA49a0kIitEA1xDPTRFmMJNdxwmOXXNbVH/NKaeN8tyJ5dG2w0CiD5VW3Grb0d KyrDsG8+fY8zXLdiFmBTwSnvXBhvuPtO1p4Q45cx2w0xEsNHpisBNSVDX1fbN0jc4uPvweukmgg5h WyDLP8gd6jdDO0moiTIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyW1F-00DNjJ-Rz; Wed, 30 Jun 2021 08:56:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyW17-00DNhr-B2 for linux-arm-kernel@lists.infradead.org; Wed, 30 Jun 2021 08:56:22 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EDBED61CD7; Wed, 30 Jun 2021 08:56:20 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lyW14-00AmeG-SE; Wed, 30 Jun 2021 09:56:19 +0100 Date: Wed, 30 Jun 2021 09:56:12 +0100 Message-ID: <87h7hfybmb.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon , Robin Murphy Cc: joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, mark.rutland@arm.com, catalin.marinas@arm.com Subject: Re: [PATCH] iommu/arm-smmu-v3: Add default domain quirk for Arm Fast Models In-Reply-To: <20210629173440.GA7556@willie-the-truck> References: <20210629173440.GA7556@willie-the-truck> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, mark.rutland@arm.com, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210630_015621_455055_97D497C0 X-CRM114-Status: GOOD ( 33.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 29 Jun 2021 18:34:40 +0100, Will Deacon wrote: > > On Fri, Jun 18, 2021 at 05:24:49PM +0100, Robin Murphy wrote: > > Arm Fast Models are still implementing legacy virtio-pci devices behind > > the SMMU, which continue to be problematic as "real hardware" devices > > (from the point of view of the simulated system) without the mitigating > > VIRTIO_F_ACCESS_PLATFORM feature. > > > > Since we now have the ability to force passthrough on a device-specific > > basis, let's use it to work around this particular oddity so that people > > who just want to boot Linux on a model don't have to fiddle around with > > things to avoid the SMMU getting in the way by default (and I don't have > > to keep telling them which things...) > > > > Signed-off-by: Robin Murphy > > --- > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > Any chance of getting the fastmodels updated instead? It feels like it > has to happen *eventually*, and then there would be no need for this bodge. That'd be ideal. What are the chances of that happening before the Sun turns into a black hole? > Will > > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > index 54b2f27b81d4..13cf16e8f45b 100644 > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > @@ -2649,6 +2649,20 @@ static int arm_smmu_dev_disable_feature(struct device *dev, > > } > > } > > > > +static int arm_smmu_def_domain_type(struct device *dev) > > +{ > > + if (dev_is_pci(dev)) { > > + struct pci_dev *pdev = to_pci_dev(dev); > > + > > + /* Legacy virtio-block devices on Arm Fast Models */ > > + if (pdev->vendor == 0x1af4 && pdev->device == 0x1001 && > > + pdev->subsystem_vendor == 0x00ff && pdev->subsystem_device == 0x0002) > > + return IOMMU_DOMAIN_IDENTITY; > > + } > > + > > + return 0; > > +} Could this be expressed as a PCI quirk instead? It would at least keep the ID matching out of the SMMU driver... Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel