From patchwork Wed Apr 2 14:11:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 14036094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DA9AC28B20 for ; Wed, 2 Apr 2025 14:12:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B36710E7DF; Wed, 2 Apr 2025 14:12:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="oDl5BP41"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1255F10E7D5; Wed, 2 Apr 2025 14:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743603125; x=1775139125; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=uaLN4nN20No4hlqhR8aptXwXK/u+iL2XHrALmgQZwS0=; b=oDl5BP41gbseldogLl/T2h8Mj28RsuORY0cuSSyRKbLMDe3D66JCsQrE ERPg6d5TynWc7cDhM/aJLjP2j/pEEBxjEgAuvG6LaqMQYA/z6ayIJLlP3 V9P/811NRQhrLwbKIBglpBb3JuxuaOD+6WR0QHQxdD4HD8RnI01aCqHZv lH10F/XTNDOQXYtfUuaQE7fA8uvHyfWf10y08c3+22qmMAXogbTqElOoo 5dglSH4uaw5v9tEEZSVxg/DUnS5m3op1repjG/hURdgKps323LdpuqCBT 1UfAGPg5oihERi+lrwcGxrnehO8dxBp1e71hRtjB1LEF/YRoz7hUChy4/ Q==; X-CSE-ConnectionGUID: wR9gkG20Tf+BqyEEO9O15A== X-CSE-MsgGUID: iUEbcnvpQDuzJddPX+ZZ4g== X-IronPort-AV: E=McAfee;i="6700,10204,11392"; a="44677119" X-IronPort-AV: E=Sophos;i="6.15,182,1739865600"; d="scan'208";a="44677119" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2025 07:12:04 -0700 X-CSE-ConnectionGUID: K65Rh4/nTGykMFe544unRg== X-CSE-MsgGUID: EQYVioqSQNGWD7KUbDm9lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,182,1739865600"; d="scan'208";a="127620412" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 02 Apr 2025 07:12:03 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Wed, 2 Apr 2025 07:12:02 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Wed, 2 Apr 2025 07:12:02 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Wed, 2 Apr 2025 07:12:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tXepFsafiueFt7PGwcuGDFmYoLjQux3ufss4IhlDP4yyRNHfjJAK4dzgFvwg1MnoCk5KUZEXk1xF0oIwXxccvaPIsesGYKPfjrbji3t/Eoxo9jwBaGf0dVf2DIIrknSuG3Q1DXuxe+XtTICnvicWyB3fMcLNC22c+8Kmtd4XGfNHp//osrJsPiqkQoemSfW7hlmHxf6ZBg4LcWD0f38mH77hPyYcUKpbrCL9SkwwAGubNv4aKC22n2brPGiTtVf+HH0DHpqedmVMLEyC2C+SsAGzrIFB5LyQMU8VAdd108UFgtgpWqUVQMsdTgk1kbmjRaR9eDvR5/n37+QgLOG7+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fsKKFgSfS7ckipDxTfJ2D+IUjygo2mbu6zEOktC19AI=; b=ZewczICKeERUubQFqRyyCpssyW1Q+77Dq5HjdiPqxtWApmMleIHQrLllGBs/pUO7ANEw8n2TLnJZRI9nJv7CX8AzWfRjK3ddrCxzMaAwDYR1ixF4sLGTbmTprpoGbf3BWuRJwwreB6ufmxPZFNhWruSwX78QErAeMT/eJyqMYoq8dgq8gTrZUUxBoY7H9VUJfDnNXPP4O++UXl1+Tp1dpFr2yaII7SsoR781mJ1XJmx4gKFrguMO4e+Tngk1e4XbflRqp0UtZCvyOCQ2tes3OWU9YpjPNkBncSaomdgfthPzMtv4lw9+XmuLyHQRDEY20jBEI8ZS0KnDv8VVIXMZqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by SJ0PR11MB5213.namprd11.prod.outlook.com (2603:10b6:a03:2da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.48; Wed, 2 Apr 2025 14:11:37 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39%4]) with mapi id 15.20.8583.041; Wed, 2 Apr 2025 14:11:37 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , , , "Bjorn Helgaas" , =?utf-8?q?Christian_K=C3=B6nig?= , =?utf-8?q?Krzy?= =?utf-8?q?sztof_Wilczy=C5=84ski?= , =?utf-8?q?Ilpo_J=C3=A4rvi?= =?utf-8?q?nen?= CC: Rodrigo Vivi , Michal Wajdeczko , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matt Roper , =?utf-8?q?Micha=C5=82_Winiarski?= Subject: [PATCH v7 1/6] PCI/IOV: Restore VF resizable BAR state after reset Date: Wed, 2 Apr 2025 16:11:17 +0200 Message-ID: <20250402141122.2818478-2-michal.winiarski@intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402141122.2818478-1-michal.winiarski@intel.com> References: <20250402141122.2818478-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR09CA0154.eurprd09.prod.outlook.com (2603:10a6:803:12c::38) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|SJ0PR11MB5213:EE_ X-MS-Office365-Filtering-Correlation-Id: 99cab7dc-89ae-4bbe-84ff-08dd71f047e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?NqdBdttoY+qwbOR7seyJruKmnGGYnSX?= =?utf-8?q?xA9ZVtqRWW6a4wf/oWp6SQwkOI5hf4vy04Axr8L6Hce05w2mAdn/7dHoP7t5kIu3Z?= =?utf-8?q?aYXec99PEYEFpBgDklssW7Ktg2uO/s5MVCXDWgOJdRNo53KeUY3o3Kad/DvFccE8j?= =?utf-8?q?YRU3BxCQeD6WZhQYEALxm1mMH2Tgy8ZS5Dox5doGd2uOanWLF8V3m3SxmMdmtjiqd?= =?utf-8?q?rgSOmd5nNmfZoh2XtWA05EvuONdqSdtcdl+egXyaWKsWdyseP1I/SFVy5sfPAEKpn?= =?utf-8?q?zNUROli++QJmKOEDx+WE/rzvOzDKWHTW1lqCbMQeW+fbD/XNeKyC6wM3EmyUfRWIt?= =?utf-8?q?XGL4m6ARL3QBjQtryV4YaexcbDECydwYjeXqnSy04YWFqhSxadrZGqXmHvy0OepCX?= =?utf-8?q?X5KCCC6kiCgp/KpEjeSbfyfDR/pD6TU6aH/l0w3caFmnfsh6qiylpfcKqelogh5CW?= =?utf-8?q?Nmz1pdj2O7JldTYOIqeh2g8rGVRHwme8l9QPIZNR9BlrAS1TqX4Wb3UE1P5GRQJph?= =?utf-8?q?hvAtvQddoYv4+ZD/9B5RPNhZ/MvIgBg0LFImwX86Lfr/Hpom8Ec609Vo7dqRppNQf?= =?utf-8?q?ily+qQl/SwKQset5rU11GZ2ip4fM3qQkAjBK9QQQ59zKDr3CaGaBVw/tTDccJbncv?= =?utf-8?q?35mjwyO2X50mKnrV8wWtqk9bsaZccJ3lM709vzBZWgBRYq+ngSnntP73lU333n0BZ?= =?utf-8?q?CO04a3aFBi2tRELnUZyQHjvS9c+D1hR1bTkCCm2tDSTKUMlzhFHlAkWtxrX9Z49b2?= =?utf-8?q?kz36sE+COnP6F0jYcvKw0mkzXO5sl/VWPSFexPnMPsuVAyJHCk640ipMlZcuRp5bv?= =?utf-8?q?FNxRzCeECFfYNtwXWIiRsTsbwmzNBGUFyY/QDiBjnNH2jQ5ykbL2QvxqDRuCvmtx+?= =?utf-8?q?XQ9splBcl/eZFwYsVp3nBZH4qaU4pNx3OcXOh+SZJ+aIfMagfhmUboz/uITUk99Rg?= =?utf-8?q?vo2Jcq6nHez2HxtPT9N7MiiD5CaUiNxuipUjM17Ttnnp7EdDFDPaDH8sWkCqGwsKQ?= =?utf-8?q?mjEhfp2MsLp16VlYNtU1dTwYhz4e6wDI78QvRrycCKlPJEkn/BUOnBiwrDPZqu/QM?= =?utf-8?q?soZHd8fksN6SskdgIiDQ35ipb82negiXvwaHYUQbbNC9vSl6GnXnfX2AejQavSeRi?= =?utf-8?q?1n1r51TngPJS906Ss2WbgeO+5Jtbh5wXBzJRPedOPxIMOVYxu4uCsR7M4stOGygrn?= =?utf-8?q?1PHToRVCXmSPRw9YfFN3vRrl7TJAIG6sUiIn8kIvwfwmiXKgBQ7jrmKdXif8icJB6?= =?utf-8?q?lBQh/BBwbbWgwck+ViHUgmpE0XI3Gm1IiN/JX8H1lhD+scRwdEobr1nKTyPw5+lX8?= =?utf-8?q?zdO79m5JKFAP?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jKf2NnewTfCttqREyhKuywRY0Y95?= =?utf-8?q?piNrhrbPAj23nnyh4wf3XxroLw+kE/RgtismnWEEN6bFeWIprZtvdT+FHSbRVS2yI?= =?utf-8?q?3R1RBfZdexIGRav6bHpwlMXRsNPhimtqkKa9wgW4Da1BGTAEPUFJYwbl5nh7e5Haw?= =?utf-8?q?0cphMnNux+RWphr+pfrxM+zNrhTB6LcciWXxJwyxoTCq2YafyrsnSHme0g5IRFJ3x?= =?utf-8?q?MUGjRr05hjrW8BoWsLkh6xjtL1mLVOSV6ANkRVEmP54oTthWwxi0MoDJRZ3TOKl7O?= =?utf-8?q?ryN6wOJsf15EBPIKvEJTsknjD2HNaAmzvNxQy27LiOXoqNd/o7U8kJJBYcAtnceP1?= =?utf-8?q?InbkUiTu6nwVicK2rucDTEgFelbNY2gkO/KoKXTMh2scrUxUzf/mOvLx6AcJ8spUh?= =?utf-8?q?pXn3zH6WYxZcoXRmwUaEADIvCs1/VD0NwQFggKWzdbuozoItbpzDyvs2UvoGq+7c2?= =?utf-8?q?fuQJCuaYsLCC2HJKdvuY+JOXfzhfpNQ/38WcRDd38/4+8tJK0FiQ3aimXyyytDkpu?= =?utf-8?q?YCfFw2KafCjz/pc6V5IdiUAmrVq/UAOoF/ebc0Se/Jd+fRblApfUiMWsgykppHyV9?= =?utf-8?q?27qjErD2U5mmFtpaURffZ2iYGeEI49n/ZoviRcopZIpYIevdFjG8gl9PvdtU8aowS?= =?utf-8?q?7vrBkxQ5++EG0oFDg/Sau1UKRGLZ87MDwlmYovou5ZnFQjCj8PGR8XKFFatAVFVEF?= =?utf-8?q?dV3EX+9LxBDLDtQZcs4Yi6K/EI+JniirU6OFmsaGvZICUJZPHL0xKAhiIw/echh3c?= =?utf-8?q?0kBm2bfbuAHPG2/Z9Yr2rbAq4ZKAHoKW0o2BUu6411iVnnIJNcctj3Cr7QzQ/6Amj?= =?utf-8?q?U+oWvj5zZVcAmdSmBLcvOXz3fZcvj6JrUieUAkuEf9KBMkF9qiV+dWFnCJvmS1w+2?= =?utf-8?q?hDL+/Jdr9Re8CWnj+w/Y3wjLC8RZ474och1R7qvuJYTDy8U77aFOQpiNAvKM9Sa00?= =?utf-8?q?G1SHFOzFFvcvEd4y5N9IZcqinncfvit9TSfNCnJDL4u30sZ7lBvGFe2B3LYL1Dlgk?= =?utf-8?q?OanJsoHQeVovbqT7aTIm78eDMVf80whPo191zOdLRdoQw3Wp7M08r48aJo0AeR3pW?= =?utf-8?q?TtFkFS5TlkY3F5ZnduIBdCxelvUp8chioIUyxEhjjO51lEdGkURL0mo8PlhrgH9RC?= =?utf-8?q?iGnt+AkrFEVMEWLIPsWRzFM7yP52dOZMWgq+79rHfUgohL2nt2YA3GXeBXMNu7EEP?= =?utf-8?q?CGzeY5iy5PbFHBfklGfSGFgApi2+QKQgWkpS38wMA/dim/eC9Ojn4ffavvg0BE1lV?= =?utf-8?q?Hu6NizYvAAeSDqLl0dAYqt7aj0EL7WMEdMZeK9haD+UqjjkN/048CpFzYDU3/LWet?= =?utf-8?q?jKhm7SC12NDghngaGsxwPz/lB1NJ3KjkV4X3evtkKYauwbriBvDv5IEe3ue20cEah?= =?utf-8?q?GNFe9B1WrylVuN695oE5FJ9j7wrk0cZcnFTJy9XGMn+7Lg4RLiWbX67MkO4Yf4HHh?= =?utf-8?q?9WjKP4rD+W1eYZ1poAU2pLfc1mcDTtqGKK+qpFi1C5ykkWg9cMjaUSF3efJFpvB5Y?= =?utf-8?q?EzuEBxhzNDl4U4BxK+LO32drHc1NMqx2Ig=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 99cab7dc-89ae-4bbe-84ff-08dd71f047e6 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2025 14:11:37.1364 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BcSmQ8YV3/6TVd6dcMzqkD4luMXq7PoGpEbhdfbzGkzSwHpwapIlNHt+esER5drVwGeJ7QaioNpZaStjEbhaN3SbOnUzFAcZcw8sfAdntOU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5213 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. The capability layout is the same as PCI_EXT_CAP_ID_REBAR. Add the capability ID and restore it as a part of IOV state. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen Reviewed-by: Christian König --- drivers/pci/iov.c | 30 +++++++++++++++++++++++++++++- drivers/pci/pci.h | 1 + include/uapi/linux/pci_regs.h | 9 +++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 10693b5d7eb66..8bdc0829f847b 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -7,6 +7,7 @@ * Copyright (C) 2009 Intel Corporation, Yu Zhao */ +#include #include #include #include @@ -850,6 +851,7 @@ static int sriov_init(struct pci_dev *dev, int pos) pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link); if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END) iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link); + iov->vf_rebar_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VF_REBAR); if (pdev) iov->dev = pci_dev_get(pdev); @@ -888,6 +890,30 @@ static void sriov_release(struct pci_dev *dev) dev->sriov = NULL; } +static void sriov_restore_vf_rebar_state(struct pci_dev *dev) +{ + unsigned int pos, nbars, i; + u32 ctrl; + + pos = dev->sriov->vf_rebar_cap; + if (!pos) + return; + + pci_read_config_dword(dev, pos + PCI_VF_REBAR_CTRL, &ctrl); + nbars = FIELD_GET(PCI_VF_REBAR_CTRL_NBAR_MASK, ctrl); + + for (i = 0; i < nbars; i++, pos += 8) { + int bar_idx, size; + + pci_read_config_dword(dev, pos + PCI_VF_REBAR_CTRL, &ctrl); + bar_idx = FIELD_GET(PCI_VF_REBAR_CTRL_BAR_IDX, ctrl); + size = pci_rebar_bytes_to_size(dev->sriov->barsz[bar_idx]); + ctrl &= ~PCI_VF_REBAR_CTRL_BAR_SIZE; + ctrl |= FIELD_PREP(PCI_VF_REBAR_CTRL_BAR_SIZE, size); + pci_write_config_dword(dev, pos + PCI_VF_REBAR_CTRL, ctrl); + } +} + static void sriov_restore_state(struct pci_dev *dev) { int i; @@ -1047,8 +1073,10 @@ resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) */ void pci_restore_iov_state(struct pci_dev *dev) { - if (dev->is_physfn) + if (dev->is_physfn) { + sriov_restore_vf_rebar_state(dev); sriov_restore_state(dev); + } } /** diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index b81e99cd4b62a..adc54bb2c8b34 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -482,6 +482,7 @@ struct pci_sriov { u16 subsystem_vendor; /* VF subsystem vendor */ u16 subsystem_device; /* VF subsystem device */ resource_size_t barsz[PCI_SRIOV_NUM_BARS]; /* VF BAR size */ + u16 vf_rebar_cap; /* VF Resizable BAR capability offset */ bool drivers_autoprobe; /* Auto probing of VFs by driver */ }; diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index ba326710f9c8b..b2d5f3ac79ae9 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -745,6 +745,7 @@ #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */ #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */ #define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */ +#define PCI_EXT_CAP_ID_VF_REBAR 0x24 /* VF Resizable BAR */ #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ #define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ @@ -1140,6 +1141,14 @@ #define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */ #define PCI_DVSEC_HEADER2_ID(x) ((x) & 0xffff) +/* VF Resizable BARs, same layout as PCI_REBAR */ +#define PCI_VF_REBAR_CAP PCI_REBAR_CAP +#define PCI_VF_REBAR_CAP_SIZES PCI_REBAR_CAP_SIZES +#define PCI_VF_REBAR_CTRL PCI_REBAR_CTRL +#define PCI_VF_REBAR_CTRL_BAR_IDX PCI_REBAR_CTRL_BAR_IDX +#define PCI_VF_REBAR_CTRL_NBAR_MASK PCI_REBAR_CTRL_NBAR_MASK +#define PCI_VF_REBAR_CTRL_BAR_SIZE PCI_REBAR_CTRL_BAR_SIZE + /* Data Link Feature */ #define PCI_DLF_CAP 0x04 /* Capabilities Register */ #define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */