pcie: Add helper to declare PASID capability for a pcie device

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Message-Id: <20250520071823.764266-2-clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
CLEMENT MATHIEU--DRIF 2025-05-20 07:18:51 +00:00 committed by Michael S. Tsirkin
parent 0f178860df
commit a8d178e149
3 changed files with 35 additions and 1 deletions

View file

@ -70,8 +70,9 @@ struct PCIExpressDevice {
uint16_t aer_cap;
PCIEAERLog aer_log;
/* Offset of ATS capability in config space */
/* Offset of ATS and PASID capabilities in config space */
uint16_t ats_cap;
uint16_t pasid_cap;
/* ACS */
uint16_t acs_cap;
@ -150,4 +151,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
Error **errp);
void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp);
void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width,
bool exec_perm, bool priv_mod);
#endif /* QEMU_PCIE_H */

View file

@ -86,6 +86,11 @@ typedef enum PCIExpLinkWidth {
#define PCI_ARI_VER 1
#define PCI_ARI_SIZEOF 8
/* PASID */
#define PCI_PASID_VER 1
#define PCI_EXT_CAP_PASID_MAX_WIDTH 20
#define PCI_PASID_CAP_WIDTH_SHIFT 8
/* AER */
#define PCI_ERR_VER 2
#define PCI_ERR_SIZEOF 0x48