mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
pcie: Helper function to check if ATS is enabled
ats_enabled checks whether the capability is present or not. If so, we read the configuration space to get the status of the feature (enabled or not). Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com> Message-Id: <20250520071823.764266-4-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:
parent
1e82e8a828
commit
6a3ae6a244
2 changed files with 10 additions and 0 deletions
|
@ -1248,3 +1248,12 @@ bool pcie_pasid_enabled(const PCIDevice *dev)
|
|||
return (pci_get_word(dev->config + dev->exp.pasid_cap + PCI_PASID_CTRL) &
|
||||
PCI_PASID_CTRL_ENABLE) != 0;
|
||||
}
|
||||
|
||||
bool pcie_ats_enabled(const PCIDevice *dev)
|
||||
{
|
||||
if (!pci_is_express(dev) || !dev->exp.ats_cap) {
|
||||
return false;
|
||||
}
|
||||
return (pci_get_word(dev->config + dev->exp.ats_cap + PCI_ATS_CTRL) &
|
||||
PCI_ATS_CTRL_ENABLE) != 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue