diff options
author | Feng Wu <feng.wu@intel.com> | 2015-06-09 07:20:36 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-06-12 11:33:52 +0200 |
commit | 959c870f7305be019d9316bc4e038dc6119d51ad (patch) | |
tree | b20a409d969a0757a987da7c0e8630b0f882e6bd /drivers/iommu/irq_remapping.c | |
parent | iommu, x86: Setup Posted-Interrupts capability for Intel iommu (diff) | |
download | linux-959c870f7305be019d9316bc4e038dc6119d51ad.tar.xz linux-959c870f7305be019d9316bc4e038dc6119d51ad.zip |
iommu, x86: Provide irq_remapping_cap() interface
Add a new interface irq_remapping_cap() to detect whether irq
remapping supports new features, such as VT-d Posted-Interrupts.
Export the function, so that KVM code can check this and use this
mechanism properly.
Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Cc: dwmw2@infradead.org
Link: http://lkml.kernel.org/r/1433827237-3382-10-git-send-email-feng.wu@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/iommu/irq_remapping.c')
-rw-r--r-- | drivers/iommu/irq_remapping.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index ed605a924ca2..2d9993062ded 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -81,6 +81,15 @@ void set_irq_remapping_broken(void) irq_remap_broken = 1; } +bool irq_remapping_cap(enum irq_remap_cap cap) +{ + if (!remap_ops || disable_irq_post) + return 0; + + return (remap_ops->capability & (1 << cap)); +} +EXPORT_SYMBOL_GPL(irq_remapping_cap); + int __init irq_remapping_prepare(void) { if (disable_irq_remap) |