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 52812C05027 for ; Fri, 3 Feb 2023 12:01:29 +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=Z76CxBQqpsj/lOhq5mSrFilv38Zzyc14oEsju9bpDDg=; b=OT1xvin17uHjD4 Hk9LWQlhuD7SQRIYrmtgDDR3LhW4EMYGLyQcJcbZIlZsp7kOGsQBK6hA0aiXCF+EEz5PJlRd4Qg/n cI4h2qQ5t3lXCzwrYL9XdLscOtKvl+XcQL/xs7Nls3lZYokwkcKU05aPY/2fShej61gr79wQ9zhGg VuS0gIlJY/6r8zrc/Cf7UwsbNNAz8RWlzulAJDfyc8TdfT24xBFUZrqchAiWj3NnZKt7H8CzQJDQ+ IjX3wd6D2dMCtehw+kSX6AOc2wvcyHCsONOm12spEn1bGEo1FW8lABpKYXAWhOOLgKOZQGmNH4fNA ieWQUo/hDf05VXoejTpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNujx-001flN-W0; Fri, 03 Feb 2023 12:00:26 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNuju-001fkv-88 for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 12:00:23 +0000 Received: by mail-wr1-x436.google.com with SMTP id ba1so370624wrb.5 for ; Fri, 03 Feb 2023 04:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/egjzh03ngyXJ8FHTTg/0bQYtASQpdNMJv1hdvpB/Fc=; b=EZJDKhZi6FDDw/5bMJrAjrDxipE8DFd4zSfg7Is8OgI1Syp1Unmg9+kCVyntpI9Ah8 ms1cK9oYqiMuEW8lJoL3+Pbky2PD7mVp7aCorL7I14++GZy3QAwRI33FG0ElzDNr0PWT vFaFCf+A0VIEt5SvaJNxmj6f+O0/MIz1hDNSX2iAm3KOxwx5TzVaYaspIpvrmIrRxkc7 Yp+Ds1CPencAXduMvqvFaxN4/f87pC/z0lkpKQUXD9JWVr+yyj2quMcvN2sm1IFksFM9 Gv02UHnSF9DL2lRRzKxSoQ/u3Enj0Y2GUc/NOe7C2vTDyZi/mLZQgKapmggqUNV9lM7K 7JMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/egjzh03ngyXJ8FHTTg/0bQYtASQpdNMJv1hdvpB/Fc=; b=p5t0oqumWhvE8eleKTWWMdUOO9Gz7nIJqcr/npUm6cwCnKi10zRIR17sbuQnjrNKuu alHE3FfWux+aSCg9d9/E2Dzwz2ffO3QBZ+65fs8FxNaZOVJGQNWl5gpk+MMoCbrXXw0/ ZOzsCpaukum5zPFmJ1w/YISrKiKwmZ1h0f0pY0pgFTaSYI9Rg52THa4UUk44J9m0orKV kuEUsfg7Y2EBa4bcSO9SyFI+zlcYO+vSpVttiqKbY2BWCUtaTw/ALD2pFVG7jxPDaH5D zBScRfMEYZKlk36m2UZNjtonUI9Yg4ryskwypxSNDvjJQ19+dtbZfpUOTY+CVHcJiav0 mDVA== X-Gm-Message-State: AO0yUKXtBHUI9lN8VThOqODNg5b6wdBwv2QITucKZQ5W1rI+R5arlwBj 8zUESpANQ0JfBZb6d02d2L2vFxUOgtRAxRqv X-Google-Smtp-Source: AK7set8T8aMKg8ONn/ET9eKan7YGhEXPRxUtteeiVs5nS/u1CsnX5oz+t6Ydy0xu8bDo1Ib8w1xRcQ== X-Received: by 2002:adf:e5c9:0:b0:2bf:ede3:988a with SMTP id a9-20020adfe5c9000000b002bfede3988amr10663907wrn.22.1675425619996; Fri, 03 Feb 2023 04:00:19 -0800 (PST) Received: from myrica (054592b0.skybroadband.com. [5.69.146.176]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b002be15ee1377sm1486750wrq.22.2023.02.03.04.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 04:00:19 -0800 (PST) Date: Fri, 3 Feb 2023 12:00:16 +0000 From: Jean-Philippe Brucker To: Ganapatrao Kulkarni Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, robin.murphy@arm.com, will@kernel.org, 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: References: <20230202124053.848792-1-gankulkarni@os.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230202124053.848792-1-gankulkarni@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230203_040022_364397_CFB00D03 X-CRM114-Status: GOOD ( 17.75 ) 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 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. Thanks, Jean [1] https://lore.kernel.org/linux-iommu/20190409165245.26500-1-jean-philippe.brucker@arm.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel