[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID an
From: |
Duan, Zhenzhong |
Subject: |
RE: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID and ATS are enabled |
Date: |
Tue, 14 May 2024 08:45:52 +0000 |
>-----Original Message-----
>From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>
>Subject: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID
>and ATS are enabled
>
>ats_enabled and pasid_enabled check whether the capabilities are
>present or not. If so, we read the configuration space to get
>the status of the feature (enabled or not).
s/present/enabled/
>
>Signed-off-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
>---
> hw/pci/pcie.c | 18 ++++++++++++++++++
> include/hw/pci/pcie.h | 3 +++
> 2 files changed, 21 insertions(+)
>
>diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
>index c8e9d4c0f7..2a638a9c3f 100644
>--- a/hw/pci/pcie.c
>+++ b/hw/pci/pcie.c
>@@ -1201,3 +1201,21 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t
>offset, uint8_t pasid_width,
>
> dev->exp.pasid_cap = offset;
> }
>+
>+bool pcie_pasid_enabled(const PCIDevice *dev)
>+{
>+ if (!pci_is_express(dev) || !dev->exp.pasid_cap) {
>+ return false;
>+ }
>+ 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;
>+}
>diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h
>index c59627d556..8c222f09da 100644
>--- a/include/hw/pci/pcie.h
>+++ b/include/hw/pci/pcie.h
>@@ -151,4 +151,7 @@ void
>pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev,
>
> void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width,
> bool exec_perm, bool priv_mod);
>+
>+bool pcie_pasid_enabled(const PCIDevice *dev);
>+bool pcie_ats_enabled(const PCIDevice *dev);
> #endif /* QEMU_PCIE_H */
>--
>2.44.0
- RE: [PATCH ats_vtd v1 06/24] intel_iommu: do not consider wait_desc as an invalid descriptor, (continued)
- [PATCH ats_vtd v1 03/24] intel_iommu: check if the input address is canonical, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 07/24] memory: add permissions in IOMMUAccessFlags, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 08/24] pcie: add helper to declare PASID capability for a pcie device, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 04/24] intel_iommu: set accessed and dirty bits during first stage translation, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID and ATS are enabled, CLEMENT MATHIEU--DRIF, 2024/05/02
- RE: [PATCH ats_vtd v1 09/24] pcie: helper functions to check if PASID and ATS are enabled,
Duan, Zhenzhong <=
- [PATCH ats_vtd v1 10/24] intel_iommu: declare supported PASID size, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 20/24] atc: generic ATC that can be used by PCIe devices that support SVM, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 12/24] intel_iommu: add support for PASID-based device IOTLB invalidation, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 11/24] intel_iommu: add an internal API to find an address space with PASID, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 13/24] pci: cache the bus mastering status in the device, CLEMENT MATHIEU--DRIF, 2024/05/02
- [PATCH ats_vtd v1 14/24] pci: add IOMMU operations to get address spaces and memory regions with PASID, CLEMENT MATHIEU--DRIF, 2024/05/02