Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4840978rdh; Wed, 29 Nov 2023 12:10:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOYk5zg3qd0l7JfNEaBkbLH8z6ixcmCmqvWOI9TNOtLIxANk3V6ElAzCXe7nXrxqcINatb X-Received: by 2002:a17:903:246:b0:1cf:6453:b268 with SMTP id j6-20020a170903024600b001cf6453b268mr19026610plh.53.1701288645313; Wed, 29 Nov 2023 12:10:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701288645; cv=none; d=google.com; s=arc-20160816; b=PD7cxB8PR/PzaU1JrGAI7zXZHg+quX15mzPgJc9iu/OifxliUbwkkyXPrbS26c8pdL zGZKrZie42tex8zXDnyMseFnCB89JxtBDyf6TMoD4eOAlCbGg/gq8ZwGTRfjpQmd0YBv 9Rca9tcymsPDitzUeqW1TbzOgknGHUD5YiDBr6fhQ6RLvFZGbKWD0TZpHxqle97vJsGV qOaMbaCQ+wj6tEypmSWFaa3VsDTH1O9ISuEku0swk4uvOz8w8rSc+6SV9Qy6nU7M8gqV rY/N6V2NDYDL+G5GRvf09q+Uf8Oz0RFsycQ3hpDfAsTB5tTG8Ib6mMY+p+xW+9RFRK53 lJXA== 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=rHJA5Yeky915FldzKVWXmcEmJkb/NyXXE4CZH+o9wtk=; fh=mz5QG6NCZDzlWIGIimZMfP2nAtOfXpxtZg78m7qqDKQ=; b=FNdiucegu6vFmsRiYcWqxqzm2P8innk15IdiGZ49UaPyMOyztQmGRemumr+FmIiOGt z0VJVvtbbVbddOub63dtoSMYm7K48glch7UVofBBMvnjEKrIMPp/gUS/IClE31ScpQ+D zOr2HiXbco13x3ewKrzybhhvP+or0+ZYDQ+daiNpuBiODEXiezZN9r8oPSliPcYoHcOI bTvZ6IZbhc2AkBYkwm89JbaoMHipD1nCvoECYVbPAtfr4O0QbKM4Wod+8zwULsip6krd cqwyWiJCnwcOaouCuFdCaojoOGH8WFcjaV4GUy+8Pw95RgGDqysFLACrSOZNi4TZ76Qz ZBDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="TMX/b42Y"; 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 k2-20020a634b42000000b005641315d956si15361317pgl.147.2023.11.29.12.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:10:45 -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="TMX/b42Y"; 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 EC06580440EA; Wed, 29 Nov 2023 12:10:42 -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 S233773AbjK2UKV (ORCPT + 99 others); Wed, 29 Nov 2023 15:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbjK2UKS (ORCPT ); Wed, 29 Nov 2023 15:10:18 -0500 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4052610C0 for ; Wed, 29 Nov 2023 12:10:22 -0800 (PST) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6d817ccaa6dso134750a34.2 for ; Wed, 29 Nov 2023 12:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701288621; x=1701893421; 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=rHJA5Yeky915FldzKVWXmcEmJkb/NyXXE4CZH+o9wtk=; b=TMX/b42YSqQWGRv8SJ31XUxjsROrb0nVxWAOAzXJM5oU7AGvONOikPI0gg4q+AkmdQ dJhxzBaSJvn9pZCBZJtONFFfTF8ilewvl0USnvsI9z8wBLBB34zy+CBDqqg7G7277H2m RQYlT+IBbJxzZslEgv640Ec0+Y/tGTtEDp2+uzrpkJwFJsp7UTfGxqlCy/YYuAqWKj7K 7PofxekIH+NL/O2eoKxaNcZl9u1+zM8eekqPU94xK5MTvW8FKH3NYnwQe3JiKWMUueGh zsgLx6FU+7f5FhQmq2iy75ABqqaoKhCH10Kcz26a/bnSvUMHkdkS/NP2yv/I/M3xdYxu carQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701288621; x=1701893421; 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=rHJA5Yeky915FldzKVWXmcEmJkb/NyXXE4CZH+o9wtk=; b=XOZgaLMyEDsZ1uIEl6q0RyKPM9xHEq7aobG06CMyUBRpYDWCOo567yYoGKc7rK4dfZ z3swdfanQDMLn82ClRhpsYLbWZJB3inlio0+i0mEoLxBwHP6JRa4m5n1OnSpGDErFLJi bhwzyqlXb0ONjEqqGlUmA++k3MO3IwGPjaEPH16wUu4AP+IfFHm1KkplXrF98R2+HXln MyPwr6lU9cba5zIPABp0bHP4HXfUtfQnsaKE41zMN91T3HdG9lXRxTnSOdHBmAKoyY0Y 57vlzdAifJUoWfW7rTWnNjl42zWPO1DJ5Js692/bZF9oZLDP6APg5vT+P9my1xOxDXR2 6ugw== X-Gm-Message-State: AOJu0Yy31Ab/4dTIdL0kZG3x+S0Vn7DsOWYM93RUONA2Now1bbfBqsKz CCEMJxqPajFxC56tfB6NQTZVTg== X-Received: by 2002:a9d:6f01:0:b0:6bd:93e:460b with SMTP id n1-20020a9d6f01000000b006bd093e460bmr21088456otq.19.1701288621545; Wed, 29 Nov 2023 12:10:21 -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 s8-20020a9d7588000000b006b753685cc5sm2083142otk.79.2023.11.29.12.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:10:21 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r8Qt2-005pR2-Ao; Wed, 29 Nov 2023 16:10:20 -0400 Date: Wed, 29 Nov 2023 16:10:20 -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: Omit devTLB invalidation requests when TES=0 Message-ID: <20231129201020.GK1312390@ziepe.ca> References: <20231114011036.70142-1-baolu.lu@linux.intel.com> <20231114011036.70142-2-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114011036.70142-2-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:10:43 -0800 (PST) On Tue, Nov 14, 2023 at 09:10:34AM +0800, Lu Baolu wrote: > The latest VT-d spec indicates that when remapping hardware is disabled > (TES=0 in Global Status Register), upstream ATS Invalidation Completion > requests are treated as UR (Unsupported Request). > > Consequently, the spec recommends in section 4.3 Handling of Device-TLB > Invalidations that software refrain from submitting any Device-TLB > invalidation requests when address remapping hardware is disabled. > > Verify address remapping hardware is enabled prior to submitting Device- > TLB invalidation requests. > > Fixes: 792fb43ce2c9 ("iommu/vt-d: Enable Intel IOMMU scalable mode by default") > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel/dmar.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) How did you get to the point where flush_dev_iotlb could even be called if the iommu has somehow been globally disabled? Shouldn't the attach of the domain compeltely fail if the HW is disabled? If the domain is not attached to anything why would flushing happen? Jason