summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorCLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>2025-09-01 11:17:19 +0000
committerMichael S. Tsirkin <mst@redhat.com>2025-10-05 09:01:08 -0400
commitec450d185e4c885396a8e9b9bd2a435c9e0c118f (patch)
treea3f2a39ca115cf4de1c595c630b19a82f317eae8 /hw
parentfa82ce2ddee8208c83a5a10bf3ab7348ad3d334a (diff)
downloadfocaccia-qemu-ec450d185e4c885396a8e9b9bd2a435c9e0c118f.tar.gz
focaccia-qemu-ec450d185e4c885396a8e9b9bd2a435c9e0c118f.zip
pcie: Add a way to get the outstanding page request allocation (pri) from the config space.
Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20250901111630.1018573-2-clement.mathieu--drif@eviden.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci/pcie.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index eaeb68894e..b302de6419 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -1266,6 +1266,14 @@ void pcie_pri_init(PCIDevice *dev, uint16_t offset, uint32_t outstanding_pr_cap,
     dev->exp.pri_cap = offset;
 }
 
+uint32_t pcie_pri_get_req_alloc(const PCIDevice *dev)
+{
+    if (!pcie_pri_enabled(dev)) {
+        return 0;
+    }
+    return pci_get_long(dev->config + dev->exp.pri_cap + PCI_PRI_ALLOC_REQ);
+}
+
 bool pcie_pri_enabled(const PCIDevice *dev)
 {
     if (!pci_is_express(dev) || !dev->exp.pri_cap) {