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