Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4842567rdh; Wed, 29 Nov 2023 12:13:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFX6CFAxjd/n+Th2kRfBUzhNLwuV4KsWlO9JmRfL+JHRa2/db5T+1ydEVnbCdYyChaEGpcZ X-Received: by 2002:a05:6a20:3952:b0:18c:2315:d5a6 with SMTP id r18-20020a056a20395200b0018c2315d5a6mr19263017pzg.51.1701288818079; Wed, 29 Nov 2023 12:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701288818; cv=none; d=google.com; s=arc-20160816; b=c0D3P3Zi1WjBZY4IqUhOKISvdiQbBDjPmKK7P963/mP1M1xFeUBWq1ehwQUoj+LfB9 gOi4Q0dIJSPbFbh8ODsqXvBK5fEi6lb1hmNWhzN4CgtruQMY96KWn2hnpsjX2qEiE+G2 UhFyMJOhtR2p9dRC9HWlxpmaUAdBY5La3KC+qI786ewnd1uvvhh91fAbGHHUzTJ4MmFN 6Bx4e4Z4p0oRkyTGjvDyQlDZvh9g8fZNRflmsIR1KYWa4m3T/tsIgmUyqybojHrRWz6x Urb+XzTI8+MJPo3hEF3bOx1zHIjeVSe8tYXa3dkgtJ1bAS8GoVKFuYyAMFyTksVS5ho+ qSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bmvK7iHRPD4drkhDHPt0FzrLQ9Gqv9eBxE9BLp7oDgo=; fh=mz5QG6NCZDzlWIGIimZMfP2nAtOfXpxtZg78m7qqDKQ=; b=n/akdWRA/tf8sXAGQ0XxJ5hOf/a7Uh3Xuh9AG5JRcVKn2tbGa4ofXdLJQ6zOR5D6cU z69uZsyGVqjZRyhJs/rcPWe2goCl36lWEE0tJiU6Q/Ad9iwJ1R48Co3w+G5C9eqaGSTY 9LmU/oZpxqqM2LRa1ZKO3D/i+hyc22F08tI8mOGaFQUW/CGM/WIGyxuyWp0/j/21/N8f 5WEz5knGq2u7zYhJpVrGpdm95od8pnImewgdQ54LQNBTdB7WyZ6Ol4naktT//CVzWa7P 00DlMrZcQDmwuvMFeR39fKaXwW+/6wv8VVLH3DhOiKcCq2020WoYpUlGYXRDIpTUGpmN zllQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ENFWgvo3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id k3-20020aa788c3000000b006cdaac97b57si3660800pff.213.2023.11.29.12.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ENFWgvo3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CD052801C1EA; Wed, 29 Nov 2023 12:13:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbjK2UNV (ORCPT + 99 others); Wed, 29 Nov 2023 15:13:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjK2UNU (ORCPT ); Wed, 29 Nov 2023 15:13:20 -0500 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0972D67 for ; Wed, 29 Nov 2023 12:13:26 -0800 (PST) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1f9decb7446so49127fac.2 for ; Wed, 29 Nov 2023 12:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701288806; x=1701893606; darn=vger.kernel.org; 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=bmvK7iHRPD4drkhDHPt0FzrLQ9Gqv9eBxE9BLp7oDgo=; b=ENFWgvo3fwf80ZbQRvuBEqdA/QoMEZHjYYTy0dLvz2Bl2DrHTqLK8hg2mNiUK4IgEm FZlNKGbZhvZfz6MUFMH0sQ1CGN3CvWc947QBtgi3PIwKWY1tsikIAzhe473ZT7bav9jd s7m4F9OaWkhJDoTkhd3AeUu2ueW0bFgEZB3QrAmhaL31KfMYbW6fQWNWWK747jNxWJpT ci1oUQRzdn9zIDKb1WH0NkFvw2M95kThZ3t6ADsgd8a4Poaogw7kAIerTG3YS9Db5AXq Wb16y3Rlh/cly56esjGoENLAySICrPTG2VNsKamU1IauUV88tH2cSU0mpqFUMouwGDkE aFng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701288806; x=1701893606; 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=bmvK7iHRPD4drkhDHPt0FzrLQ9Gqv9eBxE9BLp7oDgo=; b=aMepXQnBtwBh77oVBvltSVA2q8qWFjcRyv/Y52MHF0GQKHUdgLYEcEvO5JcMRob0t9 qFiWBvBTT9/KTDMLRccXPWT3zncEgMYRkdeytuGP2WsHig2yytM3+qi/iGxO9bihZkvF 9MnG5k6nngKcHJw9T7FI4HKpYLKE0ZpTNk+XxUNrPfIF5aGXe50E1xjxYQfwtPgdsisB is2vNTUhzji8sVACowBra7xU/sWlaCJUtqi0YiFVhpeqRvAuFD+jzMOiiZyo5TNb2UO9 GfrQqRoB1DLGSlLV6jOrGiXDJdObSGKJJwuCHS0XVAGyDeoiKyXEbZ/249PDbrF1cWw1 jdAg== X-Gm-Message-State: AOJu0YzTR+wS/5AW8YBUxb5FaA1HxotSnvQ4ZE2frfGn+3hB5qjSBJen sE4AiU++Ancv3hqcUkw2qO0GRg== X-Received: by 2002:a05:6870:d88d:b0:1fa:25df:4031 with SMTP id oe13-20020a056870d88d00b001fa25df4031mr20698625oac.4.1701288805852; Wed, 29 Nov 2023 12:13:25 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-134-23-187.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.134.23.187]) by smtp.gmail.com with ESMTPSA id lk7-20020a0568703e0700b001fa35df2cb7sm2226220oab.6.2023.11.29.12.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:13:25 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r8Qw0-005pRb-Cz; Wed, 29 Nov 2023 16:13:24 -0400 Date: Wed, 29 Nov 2023 16:13:24 -0400 From: Jason Gunthorpe To: Lu Baolu Cc: Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] iommu/vt-d: Disable PCI ATS in legacy passthrough mode Message-ID: <20231129201324.GL1312390@ziepe.ca> References: <20231114011036.70142-1-baolu.lu@linux.intel.com> <20231114011036.70142-3-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114011036.70142-3-baolu.lu@linux.intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 12:13:35 -0800 (PST) On Tue, Nov 14, 2023 at 09:10:35AM +0800, Lu Baolu wrote: > When IOMMU hardware operates in legacy mode, the TT field of the context > entry determines the translation type, with three supported types (Section > 9.3 Context Entry): > > - DMA translation without device TLB support > - DMA translation with device TLB support > - Passthrough mode with translated and translation requests blocked > > Device TLB support is absent when hardware is configured in passthrough > mode. > > Disable the PCI ATS feature when IOMMU is configured for passthrough > translation type in legacy (non-scalable) mode. Oh.. That is the same horrible outcome that ARM has :( The issue is what to do if the RID translation is in identity but a PASID is attached that should be using ATS - eg do you completely loose SVA support if the RID is set to the optimized identity mode? I vote no. We should make the drivers aware that they should not use ATS on their RIDs instead :( Jason