From: Lan Tianyu <tianyu.lan@intel.com>
To: xen-devel@lists.xen.org
Cc: Lan Tianyu <tianyu.lan@intel.com>,
kevin.tian@intel.com, wei.liu2@citrix.com,
andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
jbeulich@suse.com, chao.gao@intel.com
Subject: [RFC PATCH V2 4/26] VIOMMU: Add get irq info callback to convert irq remapping request
Date: Thu, 18 May 2017 01:34:34 -0400 [thread overview]
Message-ID: <1495085696-10819-5-git-send-email-tianyu.lan@intel.com> (raw)
In-Reply-To: <1495085696-10819-1-git-send-email-tianyu.lan@intel.com>
This patch is to add get_irq_info callback for platform implementation
to convert irq remapping request to irq info (E,G vector, dest, dest_mode
and so on).
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
xen/common/viommu.c | 16 ++++++++++++++++
xen/include/asm-x86/viommu.h | 8 ++++++++
xen/include/xen/viommu.h | 9 +++++++++
3 files changed, 33 insertions(+)
diff --git a/xen/common/viommu.c b/xen/common/viommu.c
index 4e3ecd7..c6c9589 100644
--- a/xen/common/viommu.c
+++ b/xen/common/viommu.c
@@ -209,6 +209,22 @@ int viommu_handle_irq_request(struct domain *d, u32 viommu_id,
return info->viommu[viommu_id]->ops->handle_irq_request(d, request);
}
+int viommu_get_irq_info(struct domain *d, u32 viommu_id,
+ struct irq_remapping_request *request,
+ struct irq_remapping_info *irq_info)
+{
+ struct viommu_info *info = &d->viommu;
+
+ if ( !info || viommu_id > info->nr_viommu
+ || !info->viommu[viommu_id] )
+ return -EINVAL;
+
+ if ( !info->viommu[viommu_id]->ops->get_irq_info )
+ return -EINVAL;
+
+ return info->viommu[viommu_id]->ops->get_irq_info(d, request, irq_info);
+}
+
/*
* Local variables:
* mode: C
diff --git a/xen/include/asm-x86/viommu.h b/xen/include/asm-x86/viommu.h
index 51bda72..1e8d4be 100644
--- a/xen/include/asm-x86/viommu.h
+++ b/xen/include/asm-x86/viommu.h
@@ -27,6 +27,14 @@
#define VIOMMU_REQUEST_IRQ_MSI 0
#define VIOMMU_REQUEST_IRQ_APIC 1
+struct irq_remapping_info
+{
+ u8 vector;
+ u32 dest;
+ u32 dest_mode:1;
+ u32 delivery_mode:3;
+};
+
struct irq_remapping_request
{
union {
diff --git a/xen/include/xen/viommu.h b/xen/include/xen/viommu.h
index 5b99211..e40fca4 100644
--- a/xen/include/xen/viommu.h
+++ b/xen/include/xen/viommu.h
@@ -32,6 +32,8 @@ struct viommu_ops {
int (*destroy)(struct viommu *viommu);
int (*handle_irq_request)(struct domain *d,
struct irq_remapping_request *request);
+ int (*get_irq_info)(struct domain *d, struct irq_remapping_request *request,
+ struct irq_remapping_info *info);
};
struct viommu {
@@ -61,6 +63,9 @@ int viommu_domctl(struct domain *d, struct xen_domctl_viommu_op *op,
int viommu_setup(void);
int viommu_handle_irq_request(struct domain *d, u32 viommu_id,
struct irq_remapping_request *request);
+int viommu_get_irq_info(struct domain *d, u32 viommu_id,
+ struct irq_remapping_request *request,
+ struct irq_remapping_info *irq_info);
#else
static inline int viommu_init_domain(struct domain *d) { return 0 };
static inline int viommu_create(struct domain *d, u64 type, u64 base_address,
@@ -79,6 +84,10 @@ static inline int viommu_domctl(struct domain *d,
static inline int viommu_handle_irq_request(struct domain *d, u32 viommu_id,
struct irq_remapping_request *request)
{ return 0 };
+static inline int viommu_get_irq_info(struct domain *d, u32 viommu_id,
+ struct irq_remapping_request *request,
+ struct irq_remapping_info *irq_info)
+{ return 0 };
#endif
#endif /* __XEN_VIOMMU_H__ */
--
1.8.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-05-18 5:34 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 5:34 [RFC PATCH V2 00/26] xen/vIOMMU: Add vIOMMU support with irq remapping fucntion of virtual vtd Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 1/26] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-30 15:42 ` Jan Beulich
2017-06-02 7:10 ` Lan Tianyu
2017-06-02 7:31 ` Julien Grall
2017-06-06 6:31 ` Jan Beulich
2017-06-06 16:38 ` Julien Grall
2017-05-18 5:34 ` [RFC PATCH V2 2/26] DOMCTL: Introduce new DOMCTL commands for vIOMMU support Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 3/26] VIOMMU: Add irq request callback to deal with irq remapping Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` Lan Tianyu [this message]
2017-05-30 15:36 ` [RFC PATCH V2 4/26] VIOMMU: Add get irq info callback to convert irq remapping request Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 5/26] Xen/doc: Add Xen virtual IOMMU doc Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 6/26] Tools/libxc: Add viommu operations in libxc Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 7/26] Tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table structures Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 8/26] Tools/libacpi: Add new fields in acpi_config to build DMAR table Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 9/26] Tools/libacpi: Add a user configurable parameter to control vIOMMU attributes Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 10/26] libxl: create vIOMMU during domain construction Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 11/26] x86/hvm: Introduce a emulated VTD for HVM Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-30 15:46 ` Jan Beulich
2017-05-18 5:34 ` [RFC PATCH V2 12/26] X86/vvtd: Add MMIO handler for VVTD Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 13/26] X86/vvtd: Set Interrupt Remapping Table Pointer through GCMD Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 14/26] X86/vvtd: Process interrupt remapping request Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 15/26] x86/vvtd: decode interrupt attribute from IRTE Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 16/26] x86/vioapic: Hook interrupt delivery of vIOAPIC Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 17/26] X86/vvtd: Enable Queued Invalidation through GCMD Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 18/26] X86/vvtd: Enable Interrupt Remapping " Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 19/26] x86/vpt: Get interrupt vector through a vioapic interface Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 20/26] passthrough: move some fields of hvm_gmsi_info to a sub-structure Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 21/26] Tools/libxc: Add a new interface to bind remapping format msi with pirq Lan Tianyu
2017-05-30 15:36 ` Wei Liu
2017-05-18 5:34 ` [RFC PATCH V2 22/26] x86/vmsi: Hook delivering remapping format msi to guest Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 23/26] x86/vvtd: Handle interrupt translation faults Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 24/26] x86/vvtd: Add queued invalidation (QI) support Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 25/26] x86/vlapic: drop no longer suitable restriction to set x2apic id Lan Tianyu
2017-05-18 5:34 ` [RFC PATCH V2 26/26] x86/vvtd: save and restore emulated VT-d Lan Tianyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495085696-10819-5-git-send-email-tianyu.lan@intel.com \
--to=tianyu.lan@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=chao.gao@intel.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).