diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-30 11:47:01 -0700 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-05-07 14:34:59 +0200 |
commit | 4f3d8b67ad3090f9fb72f8235d21cde53cd24b79 (patch) | |
tree | c6408bbae796a1aec8c0d8ef735ee2f159358e2c /drivers/iommu | |
parent | 736baef4472d00574089f295bc759ac002b9558c (diff) | |
download | linux-4f3d8b67ad3090f9fb72f8235d21cde53cd24b79.tar.bz2 |
iommu/vt-d: Convert missing apic.c intr-remapping call to remap_ops
Convert these calls too:
* Disable of remapping hardware
* Reenable of remapping hardware
* Enable fault handling
With that all of arch/x86/kernel/apic/apic.c is converted to
use the generic intr-remapping interface.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel_intr_remapping.c | 7 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.c | 24 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.h | 9 |
3 files changed, 38 insertions, 2 deletions
diff --git a/drivers/iommu/intel_intr_remapping.c b/drivers/iommu/intel_intr_remapping.c index 9c742fb111b6..610b75b66c07 100644 --- a/drivers/iommu/intel_intr_remapping.c +++ b/drivers/iommu/intel_intr_remapping.c @@ -764,7 +764,7 @@ int __init ir_dev_scope_init(void) } rootfs_initcall(ir_dev_scope_init); -void disable_intr_remapping(void) +static void disable_intr_remapping(void) { struct dmar_drhd_unit *drhd; struct intel_iommu *iommu = NULL; @@ -780,7 +780,7 @@ void disable_intr_remapping(void) } } -int reenable_intr_remapping(int eim) +static int reenable_intr_remapping(int eim) { struct dmar_drhd_unit *drhd; int setup = 0; @@ -818,4 +818,7 @@ struct irq_remap_ops intel_irq_remap_ops = { .supported = intel_intr_remapping_supported, .hardware_init = dmar_table_init, .hardware_enable = intel_enable_intr_remapping, + .hardware_disable = disable_intr_remapping, + .hardware_reenable = reenable_intr_remapping, + .enable_faulting = enable_drhd_fault_handling, }; diff --git a/drivers/iommu/intr_remapping.c b/drivers/iommu/intr_remapping.c index 670c69a80afd..9aabed7c0320 100644 --- a/drivers/iommu/intr_remapping.c +++ b/drivers/iommu/intr_remapping.c @@ -74,3 +74,27 @@ int __init intr_hardware_enable(void) return remap_ops->hardware_enable(); } + +void intr_hardware_disable(void) +{ + if (!remap_ops || !remap_ops->hardware_disable) + return; + + remap_ops->hardware_disable(); +} + +int intr_hardware_reenable(int mode) +{ + if (!remap_ops || !remap_ops->hardware_reenable) + return 0; + + return remap_ops->hardware_reenable(mode); +} + +int __init intr_enable_fault_handling(void) +{ + if (!remap_ops || !remap_ops->enable_faulting) + return -ENODEV; + + return remap_ops->enable_faulting(); +} diff --git a/drivers/iommu/intr_remapping.h b/drivers/iommu/intr_remapping.h index d6df732e001f..2744c9ae4aec 100644 --- a/drivers/iommu/intr_remapping.h +++ b/drivers/iommu/intr_remapping.h @@ -37,6 +37,15 @@ struct irq_remap_ops { /* Enables the remapping hardware */ int (*hardware_enable)(void); + + /* Disables the remapping hardware */ + void (*hardware_disable)(void); + + /* Reenables the remapping hardware */ + int (*hardware_reenable)(int); + + /* Enable fault handling */ + int (*enable_faulting)(void); }; extern struct irq_remap_ops intel_irq_remap_ops; |