Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp566796rdb; Thu, 21 Dec 2023 19:57:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFdTqMlBCXSjyEZG3g1thm/zXv/3cS+YPmvaZGKxqWaKZ+gW7MyxxRgPxKZZIc4ucLfGpU X-Received: by 2002:a05:622a:312:b0:427:75d9:e653 with SMTP id q18-20020a05622a031200b0042775d9e653mr1037932qtw.127.1703217425089; Thu, 21 Dec 2023 19:57:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703217425; cv=none; d=google.com; s=arc-20160816; b=ngdWn0mR8YZ36+t+TEunwWbS3kf7IeB51c7rCUBSEuiThVUxN5lK2d+B07QnYBBmx2 OwFsmMmDyt67mYCHk+XIhSibyl/Aq3ZaPKzJwaO9hq9QlrEPgg8LAjjx78EM5Qm/WxiH 2/ofYzFylppMt0ydn+vusq/XKHFrx2vCSJaR+t25SG6UqKE8uIbyB1D9+9MmPK2QbIAd yLu00DKR04YnW8XS/tM/x5gpu9k0N8jaQ8ky+Zj0jjGzssDqYz+2Qnmg9ubCj51/TS6l euXqkab9l2rB7JMs8JCmUa9diltGmJu9SVmBzNOIyyehZJFLQekG2knSjUyE38Zsh6g2 yH3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=mLSt0AUdyr0LUftJ27i5H8FECWuNCQW99oTTl5QErxI=; fh=insgpi8mLyog24ZK1Ss2PzYOd3Fy4/Lyd79+JXD6XOc=; b=BmYsFkWlY42kmsyjG5KyaFFmReiQ7Ltfich6tT4ioztYmu7uEqgX/E+v0R0s5/lBBd lrACwDldTKkkCTJDTTi9jUZ10iOksq/a4jvbMcIK09gocHlnr6dCeJvnCQIZQxGCOxHD AsfrfqRO8xK/IjOt8YXuaAypbYyRRM8R1Cj2ktQP78kguRUPsEkNpaIDVjVbCcXrwyTs NXDz/7VbZTvniJEpdkDdb5n1GtSD6K0/56EPElh5NaPcGeYrs5KYLUWqMDbFX+8dBhG+ MEGF4HCQRQqv6gHSytzephBV6qbZnT7+8q2CSVMyBLNAZsJaytHnPhtyduQdMgs+sqeb p6PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aRdWCV88; spf=pass (google.com: domain of linux-kernel+bounces-9300-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ge24-20020a17090b0e1800b0028b83e1ca17si5985313pjb.61.2023.12.21.19.57.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 19:57:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9300-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aRdWCV88; spf=pass (google.com: domain of linux-kernel+bounces-9300-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B0047282654 for ; Fri, 22 Dec 2023 03:57:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4346563B5; Fri, 22 Dec 2023 03:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aRdWCV88" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (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 D806A6132; Fri, 22 Dec 2023 03:56:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703217397; x=1734753397; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=o7QSLUEbtgt1NDLSckikpa9KW0RO6SIhmgcDLdrx9To=; b=aRdWCV88/gnSN0wNudTrT4wjogy+FjjHhayo+tcWJf6Z2Eqb2SBlHk2D AOimk6SKHY3ncUd2iAwcI7X9tsDMuQN+0bzw7IDqHiYVXd8vzHuBJ2x1w ADvcqv8ly/8kWUHPa9TP+FuxVWdcUJEKrLkHgWKMBhqEygd6WLE/jhXAc oBTevF0Vc91gkFTJf6AgS2NOf4+zkH+cVfqyPscznMxszweWInhr1DBB0 9G0SCE8CUz2oOob1rki3cMjAAWtDmCNbdKTMSciJIBeZy+lG6s3ZrHSYG aRHbLty//0dzt4qDZSEwOVZ7rL+Y4tjYrOP1Z6AaXsBKhdMblw2TTBSnk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="462510410" X-IronPort-AV: E=Sophos;i="6.04,294,1695711600"; d="scan'208";a="462510410" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 19:56:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="1108339667" X-IronPort-AV: E=Sophos;i="6.04,294,1695711600"; d="scan'208";a="1108339667" Received: from zhaohaif-mobl.ccr.corp.intel.com (HELO [10.93.26.36]) ([10.93.26.36]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 19:56:34 -0800 Message-ID: <02619a5c-842c-4441-85cb-0f7151705a5d@linux.intel.com> Date: Fri, 22 Dec 2023 11:56:31 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected To: Lukas Wunner 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 References: <20231220005153.3984502-1-haifeng.zhao@linux.intel.com> <20231220005153.3984502-3-haifeng.zhao@linux.intel.com> <20231221103940.GA12714@wunner.de> <20231221110138.GA27755@wunner.de> From: Ethan Zhao In-Reply-To: <20231221110138.GA27755@wunner.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/21/2023 7:01 PM, Lukas Wunner wrote: > 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. I really "expected" there is interrrupt signal to iommu hardware when the PCIe swtich downstream device 'gone', or some internal polling /heartbeating the endpoint device for ATS breaking, but so far seems there are only hotplug interrupts to downstream control. ... How to define the point "some" msec to timeout while software break out the waiting loop ?  or polling if the target is gone ? Thanks, Ethan > > Thanks, > > Lukas