[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V3 21/29] VIOMMU: Introduce callback of checking irq remapping mode



This patch is to add callback for vIOAPIC and vMSI to check whether interrupt
remapping is enabled.

Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
---
 xen/common/viommu.c      | 15 +++++++++++++++
 xen/include/xen/viommu.h | 10 ++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/common/viommu.c b/xen/common/viommu.c
index 0708e43..ff95465 100644
--- a/xen/common/viommu.c
+++ b/xen/common/viommu.c
@@ -194,6 +194,21 @@ int viommu_get_irq_info(struct domain *d,
     return viommu->ops->get_irq_info(d, request, irq_info);
 }
 
+bool viommu_check_irq_remapping(struct domain *d,
+                                struct arch_irq_remapping_request *request)
+{
+    struct viommu *viommu = d->viommu;
+
+    if ( !viommu )
+        return false;
+
+    ASSERT(viommu->ops);
+    if ( !viommu->ops->check_irq_remapping )
+        return false;
+
+    return viommu->ops->check_irq_remapping(d, request);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/viommu.h b/xen/include/xen/viommu.h
index beb40cd..b5ac1e6 100644
--- a/xen/include/xen/viommu.h
+++ b/xen/include/xen/viommu.h
@@ -26,6 +26,8 @@ struct arch_irq_remapping_request;
 
 struct viommu_ops {
     int (*create)(struct domain *d, struct viommu *viommu);
+    bool (*check_irq_remapping)(struct domain *d,
+                                struct arch_irq_remapping_request *request);
     int (*destroy)(struct viommu *viommu);
     int (*handle_irq_request)(struct domain *d,
                               struct arch_irq_remapping_request *request);
@@ -57,6 +59,8 @@ int viommu_handle_irq_request(struct domain *d,
 int viommu_get_irq_info(struct domain *d,
                         struct arch_irq_remapping_request *request,
                         struct arch_irq_remapping_info *irq_info);
+bool viommu_check_irq_remapping(struct domain *d,
+                                struct arch_irq_remapping_request *request);
 #else
 static inline int viommu_register_type(uint64_t type, struct viommu_ops *ops)
 {
@@ -75,6 +79,12 @@ viommu_get_irq_info(struct domain *d,
 {
     return -EINVAL;
 }
+static inline bool
+viommu_check_irq_remapping(struct domain *d,
+                           struct arch_irq_remapping_request *request)
+{
+    return false;
+}
 #endif
 
 #endif /* __XEN_VIOMMU_H__ */
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.