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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0D134C05027 for ; Fri, 3 Feb 2023 12:06:21 +0000 (UTC) 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:In-Reply-To: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-Owner; bh=kRgB1GTqeH7uTdliSXD26leP0cmbiKJs7yowq/pKVnQ=; b=D1+gjOdF63DYOZ uioABAzMYcIgPg4J9IkhbF4BzpskuCGmf9gySq9V+bht0YGSwE9YPjH5QSsCzvZY1DHgGkXRtFHUM QzPv2/EekQcyHjMZm68owbq4iThUf+OlE2fAE/pM0ErkCenWiU2CVqMeLag1yxkQaBgSJ9vi4CWaz a9yRogNafl4pwgfR3/EZ3kYmYjiKmBOE20bPgwp+zxtCitx3U0Dc9nNBf3C+EV5nyGTHwSDYcQtv/ KyLzqpvAb72Zud25jA7YTQPYeX1g4twk83IHkwNSftQxwcvICotlZr8GPYTGG1t6SxO+WdUimAZuG VMWa5TBWUL9OR4WAImCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNuon-001gOB-Jg; Fri, 03 Feb 2023 12:05:25 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNuok-001gM9-GF for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 12:05:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B5E7B82A85; Fri, 3 Feb 2023 12:05:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76D4BC433EF; Fri, 3 Feb 2023 12:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675425917; bh=0lFtytynqLkq8kJIpsrWpdqTQgna4urzc2JF1yxsxnQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f7LxKwIiJWDREcPzlQp1Nkr+1E8PUzD8RvgkDrmri/8BGgRxfmZZimGAEqBclIh5I zbzwUvBvW7UzIhIQqprXumtriCc06ocpOHEMEQ+KyAo6s5uLjOlOhw+je87zQFS6vd EmLglq/qb/MZD1/rX+U+WeRfI5BdgeG5/815jRCBAkI2zSXdPzy2gNlGjiv2eKB6ei +kxZARRrrwiDwHcy+VmM9G7v1aUQp3evao/BqzVe+qQDQwN3gE2mijzgvYu2g6gKPz tRSlmdT+XOD7p7PVi0wvUQNIwhr7DWTjVpeNKKleNRDPeZKABj9iLjzDd16z/YFchJ UoxYycFh9AapA== Date: Fri, 3 Feb 2023 12:05:11 +0000 From: Will Deacon To: Jean-Philippe Brucker Cc: Ganapatrao Kulkarni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, robin.murphy@arm.com, joro@8bytes.org, darren@os.amperecomputing.com, scott@os.amperecomputing.com Subject: Re: [PATCH] iommu/arm-smmu-v3: Enable PCI ATS in passthrough mode as well Message-ID: <20230203120511.GA6274@willie-the-truck> References: <20230202124053.848792-1-gankulkarni@os.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20230203_040522_707031_90BB84B2 X-CRM114-Status: GOOD ( 23.73 ) 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 Fri, Feb 03, 2023 at 12:00:16PM +0000, Jean-Philippe Brucker wrote: > On Thu, Feb 02, 2023 at 04:40:53AM -0800, Ganapatrao Kulkarni wrote: > > The current smmu-v3 driver does not enable PCI ATS for physical functions > > of ATS capable End Points when booted in smmu bypass mode > > (iommu.passthrough=1). This will not allow virtual functions to enable > > ATS(even though EP supports it) while they are attached to a VM using > > VFIO driver. > > > > This patch adds changes to enable ATS support for physical functions > > in passthrough/bypass mode as well. > [...] > > @@ -2453,8 +2458,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) > > > > master->domain = smmu_domain; > > > > - if (smmu_domain->stage != ARM_SMMU_DOMAIN_BYPASS) > > - master->ats_enabled = arm_smmu_ats_supported(master); > > + master->ats_enabled = arm_smmu_ats_supported(master); > > I should have added a comment for this. Only found the reason in an old > cover letter [1]: > > "When no translation stages are enabled (0b100), ATS Translation Requests > (and Translated traffic, if SMMU_CR0.ATSCHK == 1) are denied as though > EATS == 0b00; the actual value of the EATS field is IGNORED. Such a > Translation Request causes F_BAD_ATS_TREQ and Translated traffic causes > F_TRANSL_FORBIDDEN." > > (See 3.9.1.1 "Responses to ATS Translation Requests and Translated > transactions" and 5.2 "Stream Table Entry") > > So I don't think we can enable ATS for bypass domains :/ The PF needs to > be in translated mode in that case. > > I can send a patch adding the comment next cycle. Yes, please! Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel