{"id":2227016,"url":"http://patchwork.ozlabs.org/api/covers/2227016/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/cover/20260423010851.46737-1-fengchengwen@huawei.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260423010851.46737-1-fengchengwen@huawei.com>","list_archive_url":null,"date":"2026-04-23T01:08:46","name":"[v3,0/5] vfio/pci: Add PCIe TPH support","submitter":{"id":92756,"url":"http://patchwork.ozlabs.org/api/people/92756/?format=json","name":"fengchengwen","email":"fengchengwen@huawei.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-pci/cover/20260423010851.46737-1-fengchengwen@huawei.com/mbox/","series":[{"id":501135,"url":"http://patchwork.ozlabs.org/api/series/501135/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=501135","date":"2026-04-23T01:08:48","name":"vfio/pci: Add PCIe TPH support","version":3,"mbox":"http://patchwork.ozlabs.org/series/501135/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2227016/comments/","headers":{"Return-Path":"\n <linux-pci+bounces-53027-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256\n header.s=dkim header.b=SEMcAhvW;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-53027-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com\n header.b=\"SEMcAhvW\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=113.46.200.220","smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=huawei.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=huawei.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1Hzz6Mlhz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 11:09:19 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 7667B303D089\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 01:09:10 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2E874285066;\n\tThu, 23 Apr 2026 01:09:07 +0000 (UTC)","from canpmsgout05.his.huawei.com (canpmsgout05.his.huawei.com\n [113.46.200.220])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id B1F0427BF6C;\n\tThu, 23 Apr 2026 01:09:04 +0000 (UTC)","from mail.maildlp.com (unknown [172.19.162.223])\n\tby canpmsgout05.his.huawei.com (SkyGuard) with ESMTPS id 4g1HrM4GMvz12LDP;\n\tThu, 23 Apr 2026 09:02:43 +0800 (CST)","from kwepemk500009.china.huawei.com (unknown [7.202.194.94])\n\tby mail.maildlp.com (Postfix) with ESMTPS id 236D140561;\n\tThu, 23 Apr 2026 09:08:57 +0800 (CST)","from localhost.localdomain (10.50.163.32) by\n kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.11; Thu, 23 Apr 2026 09:08:56 +0800"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776906547; cv=none;\n b=md1YiCHLBPOi6cFuAhYUj+4PagVP0fiTcfufZlCtcIZVVJWfWsHhu/wR3isOcadmNNZM090DkcYE5Z5HqSs+0k5TTNZvMpKr/w8cOid+nREA+1tOdMpHMA30OVQW597MI0/lhkeXy8wa+amva7ZUFNvPq5bn/44+LJpcArR0FMo=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776906547; c=relaxed/simple;\n\tbh=228AgdFS86IQi0odGn+xgFovd83zQNrMJcJLhl5+KC8=;\n\th=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=O8SBnR1jjet08ipHxu43VpXQLAPRxFmeLpOhGNU1Tsk/AElaH2AdN+WxyDfEMpHnuCCtVRTHgrcEY50z96uNloUtiXnz11MGgiN5toEJAmyH/w2d2kEVgk8vymKaUrJQf7ug41TLaKjyzMKVqD4kdCD3fFV1IixlW2SD6gSd2Pk=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=huawei.com;\n spf=pass smtp.mailfrom=huawei.com;\n dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com\n header.b=SEMcAhvW; arc=none smtp.client-ip=113.46.200.220","dkim-signature":"v=1; a=rsa-sha256; d=huawei.com; s=dkim;\n\tc=relaxed/relaxed; q=dns/txt;\n\th=From;\n\tbh=lEKCag3ENTTr/YOurag2RZ8Vm850IdPfjTBjeHiUWFU=;\n\tb=SEMcAhvWhrPrnAQQeVlmSgHWb1hjzXHLVLKeDCnYgcyivIeR3XCUCqxqdAoUlgJx7zXjv052m\n\txs//kTp7b9QlKP/e247Sk2EpxWcDWYRmK2MJurErYobK4O/lOBFQTbn5vx7rpiOF4oOJlBN/xvV\n\t9Dgv2kgsDMom9u4Owf6DepA=","From":"Chengwen Feng <fengchengwen@huawei.com>","To":"<alex@shazbot.org>, <jgg@ziepe.ca>","CC":"<wathsala.vithanage@arm.com>, <helgaas@kernel.org>,\n\t<wangzhou1@hisilicon.com>, <wangyushan12@huawei.com>,\n\t<liuyonglong@huawei.com>, <kvm@vger.kernel.org>, <linux-pci@vger.kernel.org>","Subject":"[PATCH v3 0/5] vfio/pci: Add PCIe TPH support","Date":"Thu, 23 Apr 2026 09:08:46 +0800","Message-ID":"<20260423010851.46737-1-fengchengwen@huawei.com>","X-Mailer":"git-send-email 2.17.1","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain","X-ClientProxiedBy":"kwepems500002.china.huawei.com (7.221.188.17) To\n kwepemk500009.china.huawei.com (7.202.194.94)"},"content":"This series adds support for PCIe TLP Processing Hints (TPH) to\nvfio-pci, allowing userspace to manage device steering tags for\nimproved performance and QoS in virtualized deployments.\n\nThe implementation follows a clean incremental structure:\n- Patch 1: Export pcie_tph_get_st_modes()\n- Patch 2: Introduce UAPI ABI and implement capability query to\n  let userspace discover supported TPH modes, ST table presence\n  and size. Also add module parameter enable_unsafe_tph_ds to\n  guard unsafe usage of TPH Device-Specific mode with no ST table.\n- Patch 3: Add TPH enable/disable with mode selection. Restrict\n  unsafe Device-Specific mode without ST table to be allowed only\n  when the module parameter is enabled.\n- Patch 4: Add interface to batch get per-CPU steering tags for\n  device-specific mode without standard ST table. This interface\n  is only available when the unsafe module parameter is enabled.\n- Patch 5: Add interface to batch program steering tag table\n  entries for standard TPH modes.\n\nAll user API definitions are finalized in the first patch and\nremain stable across the series. The design follows existing\nVFIO conventions and relies on kernel pcie-tph infrastructure.\n\nTo avoid potential security risks in virtualization environments,\nTPH Device-Specific mode without a standard ST table is blocked\nby default. It can only be enabled by administrators via the\nenable_unsafe_tph_ds module parameter for trusted bare-metal\nuserspace.\n\nThis series addresses the TPH management requirements discussed\nin the RFC \"Proposal: Add sysfs interface for PCIe TPH Steering\nTag retrieval and configuration\".\n\nInstead of introducing a sysfs interface, we choose to implement\nTPH management via a VFIO-specific ioctl for these reasons:\n- VFIO is the standard userspace interface for PCI devices.\n- An ioctl approach provides better type safety, batch support\n  and stable ABI compared to sysfs for configuration.\n- VFIO properly isolates TPH operations to the assigned device,\n  avoiding conflicts with other kernel management paths.\n\nBased on earlier RFC work by Wathsala Vithanage.\n\nv3:\n- Add module param enable_unsafe_tph_ds to guard unsafe usage\n  of TPH device-specific mode with no ST table\nv2:\n- Export pcie_tph_get_st_modes()\n- Add detailed comment for UAPI structures and operations\n- Add batch entry limit VFIO_TPH_MAX_ENTRIES\n- Improve robustness and error handling\n\nChengwen Feng (5):\n  PCI/TPH: Export pcie_tph_get_st_modes() for external use\n  vfio/pci: Add PCIe TPH interface with capability query\n  vfio/pci: Add PCIe TPH enable/disable support\n  vfio/pci: Add PCIe TPH GET_ST interface\n  vfio/pci: Add PCIe TPH SET_ST interface\n\n drivers/pci/tph.c                |  13 +-\n drivers/vfio/pci/vfio_pci.c      |  13 +-\n drivers/vfio/pci/vfio_pci_core.c | 225 ++++++++++++++++++++++++++++++-\n include/linux/pci-tph.h          |   7 +\n include/linux/vfio_pci_core.h    |   3 +-\n include/uapi/linux/vfio.h        | 131 ++++++++++++++++++\n 6 files changed, 387 insertions(+), 5 deletions(-)"}