From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 673CF71747 for ; Fri, 18 Oct 2024 01:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729216725; cv=none; b=MgPLJLy8N2X7uppoqhLOkc405BlLw4CorbieUSgycFOACsf4sI4lJcUBI4dpFNsFiznRnOnZ4bO+RO10UusRcKxvH5V5+jjtxaP58WgIHqUI/0GVHjN3MmGFfzet5YGMsORqMyQX/euEuDT/PhjguaKzkqpVTnWwj/dvx7vcbWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729216725; c=relaxed/simple; bh=z0TiPjA1esacraE/iuy/u3ZF8AIUwcsbFBy9SdtcBr8=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=GwK5z2zdme1pdyjceWsAMWiBdMPZEZ8Hsy5xZWY/Cd2zdw7JtCtmLzGb2BsV0+UcYAl5iy4ugzsus9C63+WjujIIP3BWSADxVAao0hj35evGPrA/VUO/8ygZl2vE7ER0Ekaqf24/r+pelrzPygpkdT8FFjPwskrH+rPZ0I8vp9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Dav5vNsf; arc=none smtp.client-ip=198.175.65.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Dav5vNsf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729216724; x=1760752724; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=z0TiPjA1esacraE/iuy/u3ZF8AIUwcsbFBy9SdtcBr8=; b=Dav5vNsf6IKis8GcECj07n6Sl2zZWdurZEP1PzIMLz3dfZIoq/Ne24JT pt/tgePgGWv2BZaWVj8ssihmUpzmRkwqwOW7BaWbYZ/cXouihNR5GASGI cD+FNnfUjf1M+ajDcTLgoCpG+3hs5GiQRRsm0A2dqZRpxkk8qNfalVM/u E47pnPp+9W7J7oFkeYlGMW5D42ExKVBu3p/LDMQJ6nSW96/MzQtk9pL78 i6n5gEBHMSDTER9y0+TyMW+7bV/SQBcyiUaC+DHasvSHBUM/FWnsLuKQG lhBsRM9seS5cO58++7ArgjpKSVIV2YLQKYkzK5EbRAfD6kw1XZKrQCJJy A==; X-CSE-ConnectionGUID: 9L3Rwen2Tk6X50TX6emfGA== X-CSE-MsgGUID: JZmF0qy7TVaBNAdRqwhGfA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="28613710" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="28613710" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2024 18:58:43 -0700 X-CSE-ConnectionGUID: WslB4K4WRX+jx3xs76Nskg== X-CSE-MsgGUID: rMHC0WJ4QO+roVP274Zd6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,212,1725346800"; d="scan'208";a="78774900" Received: from unknown (HELO [10.238.0.51]) ([10.238.0.51]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2024 18:58:39 -0700 Message-ID: Date: Fri, 18 Oct 2024 09:58:37 +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 Cc: baolu.lu@linux.intel.com, Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Nicolin Chen , Yi Liu , Jacob Pan , Joel Granados , iommu@lists.linux.dev, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Shameerali Kolothum Thodi Subject: Re: [PATCH v8 07/10] iommufd: Fault-capable hwpt attach/detach/replace To: Jason Gunthorpe , Zhangfei Gao References: <20240702063444.105814-1-baolu.lu@linux.intel.com> <20240702063444.105814-8-baolu.lu@linux.intel.com> <20241015125420.GK1825128@ziepe.ca> <20241016152503.GB4020792@ziepe.ca> <20241017120518.GI4020792@ziepe.ca> <20241017130805.GA926121@ziepe.ca> Content-Language: en-US From: Baolu Lu In-Reply-To: <20241017130805.GA926121@ziepe.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/10/17 21:08, Jason Gunthorpe wrote: > On Thu, Oct 17, 2024 at 08:35:24PM +0800, Zhangfei Gao wrote: > >> Yes, you are right >> I am using SRIOV vf and stall feature, so is_virtfn == true >> >> Our ACC devices are fake pci endpoint devices which supports stall, >> And they also supports sriov >> >> So I have to ignore the limitation. > I see, so that is more complicated. > > Lu, what do you think about also checking if the PCI function has PRI > ? If not PRI assume the fault is special and doesn't follow PRI rules? > > Or maybe we can have the iommu driver tag the event as a PRI/not-PRI > fault? This limitation applies to PRI on PCI/SRIOV VFs because the PRI might be a shared resource and current iommu subsystem is not ready to support enabling/disabling PRI on a VF without any impact on others. In my understanding, it's fine to remove this limitation from the use case of non-PRI on SRIOV VFs. Perhaps something like below? if (dev_is_pci(dev)) { struct pci_dev *pdev = to_pci_dev(dev); if (pdev->is_virtfn && pci_pri_supported(pdev)) return -EINVAL; } Thanks, baolu