Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp65764rdb; Thu, 21 Dec 2023 03:01:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2LMqR0qcE2yG6vJSJ41iirp3xcp2fTv3gCd8f5VFf9wrs30RgU7SRxFR4y8XM4HKcUzH+ X-Received: by 2002:a05:620a:2209:b0:780:e1d5:642e with SMTP id m9-20020a05620a220900b00780e1d5642emr7569796qkh.36.1703156510903; Thu, 21 Dec 2023 03:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703156510; cv=none; d=google.com; s=arc-20160816; b=rk3J5IDz4akQiPnfJZgW41Hn5l1v1H9FdpV7lzck01a6zf7k62nmRjILkWgChkdP1r Ld9aumjRBZsk17W1B2pgumF5bd6X5FOlmq/3N3z73DxIw4ZnRdwIfXkocJ7UwhJF7C3B RbtReDBrUVCdqMENkc2yhzLXz9jATUlVqJ+3/CCc+A/Bxg1qYQPHmapqeIBOl8Rul8Ja 2pgGrrjLkBXf2JU+pSXcIUOPWetGk00MtAC2GqhbqGf3D554RZcaDwIo4MQSPBuYCfJG dXQ/Y6qIWnyqTx2gh/lfAYE1JEEzhE6xwX/0tcOEZeUaCTBO5ssgp5Aoia4DyQmQBsK6 oWIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=+TibQ0uxUkijooGtMKYAaDLwa092QwF9fbGGUiPQviE=; fh=DHEMuZO50Ax5xBtjxa5sqB9Udspp1xRBp9zNoCKdeN4=; b=z1oOSToi91Gqk2opV9DzIragPbLGhYCAW8lLtUDb+d4ZuYGxSwWqc6oPE8AV25Yq0o HyxDrLgWbFYsvSJItZoeHZnfSp6+MrnzAelPC9vjClstB7F9Ga3UJKXaTYRCIbpr/W58 Ysvdkk/CknLDqpJqrvZH0PWucdPo4K8nKguoHMjPQtxrorMjqbR+EW2xvKXKjA/to8dp GVcZLxcOJb7LZd3ir6LNEeKrwlZM7Py7Vxucos/7BwUM3UDDy7gY89lXzuE1yWCUuwwl 5vFnmk/GPfjw49zIM6EWd1Cr/E1+Puzob16NbYgk6EFqEsphIh7sk6iSgB/MUeRjG5fs 12Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8257-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8257-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k12-20020a05620a414c00b007811351dcb7si1980296qko.288.2023.12.21.03.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 03:01:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8257-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8257-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8257-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A68BF1C24595 for ; Thu, 21 Dec 2023 11:01:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D6816ABAB; Thu, 21 Dec 2023 11:01:42 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 278226A32D; Thu, 21 Dec 2023 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 6D419101E3643; Thu, 21 Dec 2023 12:01:38 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 400BA4BB67; Thu, 21 Dec 2023 12:01:38 +0100 (CET) Date: Thu, 21 Dec 2023 12:01:38 +0100 From: Lukas Wunner To: Ethan Zhao Cc: bhelgaas@google.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, will@kernel.org, robin.murphy@arm.com, linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected Message-ID: <20231221110138.GA27755@wunner.de> References: <20231220005153.3984502-1-haifeng.zhao@linux.intel.com> <20231220005153.3984502-3-haifeng.zhao@linux.intel.com> <20231221103940.GA12714@wunner.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231221103940.GA12714@wunner.de> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Dec 21, 2023 at 11:39:40AM +0100, Lukas Wunner wrote: > On Tue, Dec 19, 2023 at 07:51:53PM -0500, Ethan Zhao wrote: > > For those endpoint devices connect to system via hotplug capable ports, > > users could request a warm reset to the device by flapping device's link > > through setting the slot's link control register, as pciehpt_ist() DLLSC > > interrupt sequence response, pciehp will unload the device driver and > > then power it off. thus cause an IOMMU devTLB flush request for device to > > be sent and a long time completion/timeout waiting in interrupt context. > > I think the problem is in the "waiting in interrupt context". I'm wondering whether Intel IOMMUs possibly have a (perhaps undocumented) capability to reduce the Invalidate Completion Timeout to a sane value? Could you check whether that's supported? Granted, the Implementation Note you've pointed to allows 1 sec + 50%, but that's not even a "must", it's a "should". So devices are free to take even longer. We have to cut off at *some* point. Thanks, Lukas