From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) (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 D1D8F1FC0EA; Tue, 2 Jun 2026 23:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780441735; cv=none; b=rkbzKajrZKHR1limK2QR6JAWXK22bbXUDhyqtVNb3szAeYTZowcgtNeQnDdd1dZ9zmn0HpZnL+xQHkWHHRPpZD1TfM9renyTRErniuhWFyrpoJt8jocvaTE4nJ7a63ZU8cHQzjOTVGjhXRB4QG0EqO0Rsp5oDvjz6lSNyskV5NI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780441735; c=relaxed/simple; bh=QBHnnineqjThiMLhY+nr1MKw+5hXNJMMrTVbAQfm/ZE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PMDsDZFD+XXjO65Fnu7FOKjeIZkI6eNRuBYIIDuc+DMEWlnZw3/mNJ0vJDMUAImCXtHutvM0ZN0iBQSvIQuCxLWLonqK5gxWmdgplYAVLDuYjYZakVT2AhSXbJEc5Xvj1AFYWva1Dvy/Y2rVDTUwJm208RaaIW/blfEQ0a3JWf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=U710U8OH; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=J5swia51; arc=none smtp.client-ip=202.12.124.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="U710U8OH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="J5swia51" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 722BD1D00097; Tue, 2 Jun 2026 19:08:51 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 02 Jun 2026 19:08:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1780441731; x=1780528131; bh=hHE7BDsIE+Zyxz7NbvGL2s+sSkSVVhwfU+vpeKVXfVk=; b= U710U8OHYHaBQkZfVnzbpAmOJk5srW+5q8lwA1ZQA8IQ2nYGX4s7VwoOph/O1QSO KE0mq25YCRKat3J6HuT885iweJJoit91sPlHe1v4PSwQuAjMINTZ4YaU1Ix0YJOQ QUeI2DoNK5/8sHQQW0aEuqktRBUNyh/bY0RKKSsvwLx4zSViJU9IKcWc2ZqYqn9h XWtUCEfi439W13G+kM30KSdhfD21QtioFrIhYjxsUohoxoMrQuscDFJlwwn+m3VB HBlMBpXY78anzFRiSFe01pJmc+8BeqZvfesnAKzOSHEGspTDTnqx7R3qml0KkCS0 SX7Zn+WxM+1TlI+JhmZk2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1780441731; x= 1780528131; bh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9fbhvscb98gbHnCHTIlXY75GQRwWh96YDMvaIQN5w X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Jun 2026 19:08:49 -0400 (EDT) Date: Tue, 2 Jun 2026 17:08:47 -0600 From: Alex Williamson To: fengchengwen Cc: , , , , , , , , , , alex@shazbot.org Subject: Re: [PATCH v14 0/8] vfio/pci: Add PCIe TPH support Message-ID: <20260602170847.75bd159d@shazbot.org> In-Reply-To: <59c82855-59a7-4f0e-b534-d35535d04b93@huawei.com> References: <20260528124649.14732-1-fengchengwen@huawei.com> <20260601095840.3aaaa508@shazbot.org> <59c82855-59a7-4f0e-b534-d35535d04b93@huawei.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 2 Jun 2026 22:46:13 +0800 fengchengwen wrote: > On 6/1/2026 11:58 PM, Alex Williamson wrote: > > > > > > - Patch 2/ sets tph_cap to zero if TPH cannot be enabled, but this is > > never propagated to vfio-pci to drop the TPH capability from the > > capability chain. > > > > - Patch 3/ exposing the enum to callers is a bit ugly, maybe we should > > retain pci_enable_tph() as the "auto" wrapper, resulting in no > > change to existing users, and add _ext and _std wrappers. > > > > - Patch 4/ same, multiple wrappers keeps the "auto" api cleaner. Also > > note that auto is broken before TPH is enabled when tph_req_type is > > zero. > > > > - Patch 6/: > > - mutex_init/destroy belong in vfio_pci_core_init_dev/release_dev() > > - Re-order to avoid forward declarations. > > - vfio_check_feature() does not require declaring PROBE as a > > supported op. > > - pcie_tph_set_st_entry() can write to MMIO space without testing > > for or enabling device memory or power state. > > - tph_init allocates shadow table regardless of opt-in for tph > > support. > > - Redundant tests for count/index in feature function. > > - Duplicate memcpy/kfree in feature function. > > > > - Patch 7/: > > - Unclear why it's vfio-pci's responsibility to provide this > > translation interface. > > - PROBE is unnecessary for vfio_check_feature(). > > - Array size conversion is strange. > > > > - Patch 8/: > > - default config read handles emulated bits. Clear the bit if > > necessary in vconfig, use p_setd() to mark PCI_TPH_CAP_EXT_TPH > > virtualized, read-only. > > - Follow examples like vfio_pm_config_write, vfio_vpd_config_write, > > vfio_exp_config_write, etc. Set the virtualized and writable > > bits, perform default config write, evaluate if anything was > > enabled, effect the change in hardware via kernel APIs. > > - pcie_disable_tph() happens after the restore state is recorded. > > - TPH capability becomes read/write, an ABI change to the user, with > > only a host-based opt-in. Seems like the userspace driver also > > needs to opt-in to the ABI change. > > - Memory enable not assured for pcie_tph_set_st_entry(). > > - Sashiko notes there are existing hazards in the tph_enabled > > storage unit relative to multiple bitfields that can be updated > > concurrently. The problem is worse with this exposed through > > vfio-pci. > > Thanks for review, all your comments are resolved in v15: Not everything. At a glance I can see that v15 is still pushing for vfio-pci to provide the interface to translate CPU IDs to steering tags, despite my push back above that it doesn't seem within vfio-pci's scope to provide a CPU ID -> ST interface. The host-only opt-in issue above also doesn't appear to be addressed or rebutted. Typically v15 would be an indication that a series is coming to maturity, but with the quick cadence and lack of discussion throughout this development, I'm not even sure we've arrived at a proper uAPI for this feature. Thanks, Alex