ia64/xen-unstable

changeset 19732:931dbe86e5f3

VT-d: remove useless variables

This patch removes global variable "vtd_enabled", which is
redundant. "iommu_enabled" is enough. And also removes useless global
variables qi_ctrl and ir_ctrl, which are not used at all.

Signed-off-by: Weidong Han <weidong.han@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 09:26:39 2009 +0100 (2009-06-05)
parents 01748ccc4da3
children a69daf23602a
files xen/arch/x86/msi.c xen/drivers/passthrough/vtd/dmar.c xen/drivers/passthrough/vtd/extern.h xen/drivers/passthrough/vtd/iommu.c xen/drivers/passthrough/vtd/utils.c xen/drivers/passthrough/vtd/x86/vtd.c xen/include/xen/iommu.h
line diff
     1.1 --- a/xen/arch/x86/msi.c	Fri Jun 05 09:25:50 2009 +0100
     1.2 +++ b/xen/arch/x86/msi.c	Fri Jun 05 09:26:39 2009 +0100
     1.3 @@ -191,7 +191,7 @@ static void read_msi_msg(struct msi_desc
     1.4          BUG();
     1.5      }
     1.6  
     1.7 -    if ( vtd_enabled )
     1.8 +    if ( iommu_enabled )
     1.9          msi_msg_read_remap_rte(entry, msg);
    1.10  }
    1.11  
     2.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Fri Jun 05 09:25:50 2009 +0100
     2.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Fri Jun 05 09:26:39 2009 +0100
     2.3 @@ -32,8 +32,6 @@
     2.4  #include "dmar.h"
     2.5  #include "iommu.h"
     2.6  
     2.7 -int vtd_enabled = 1;
     2.8 -
     2.9  #undef PREFIX
    2.10  #define PREFIX VTDPREFIX "ACPI DMAR:"
    2.11  #define DEBUG
    2.12 @@ -561,6 +559,6 @@ int acpi_dmar_init(void)
    2.13          panic("acpi_dmar_init: acpi_dmar_init failed,"
    2.14                " crash Xen for security purpose!\n");
    2.15  
    2.16 -    vtd_enabled = 0;
    2.17 +    iommu_enabled = 0;
    2.18      return -ENODEV;
    2.19  }
     3.1 --- a/xen/drivers/passthrough/vtd/extern.h	Fri Jun 05 09:25:50 2009 +0100
     3.2 +++ b/xen/drivers/passthrough/vtd/extern.h	Fri Jun 05 09:26:39 2009 +0100
     3.3 @@ -25,8 +25,6 @@
     3.4  
     3.5  extern int qinval_enabled;
     3.6  extern int ats_enabled;
     3.7 -extern struct qi_ctrl *qi_ctrl;
     3.8 -extern struct ir_ctrl *ir_ctrl;
     3.9  
    3.10  void print_iommu_regs(struct acpi_drhd_unit *drhd);
    3.11  void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn);
     4.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Fri Jun 05 09:25:50 2009 +0100
     4.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Fri Jun 05 09:26:39 2009 +0100
     4.3 @@ -1790,7 +1790,7 @@ int intel_vtd_setup(void)
     4.4      struct acpi_drhd_unit *drhd;
     4.5      struct iommu *iommu;
     4.6  
     4.7 -    if ( !vtd_enabled )
     4.8 +    if ( !iommu_enabled )
     4.9          return -ENODEV;
    4.10  
    4.11      platform_quirks();
    4.12 @@ -1859,7 +1859,7 @@ int intel_vtd_setup(void)
    4.13   error:
    4.14      for_each_drhd_unit ( drhd )
    4.15          iommu_free(drhd);
    4.16 -    vtd_enabled = 0;
    4.17 +    iommu_enabled = 0;
    4.18      iommu_snoop = 0;
    4.19      iommu_passthrough = 0;
    4.20      iommu_qinval = 0;
    4.21 @@ -1955,7 +1955,7 @@ void iommu_suspend(void)
    4.22      struct iommu *iommu;
    4.23      u32    i;
    4.24  
    4.25 -    if ( !vtd_enabled )
    4.26 +    if ( !iommu_enabled )
    4.27          return;
    4.28  
    4.29      iommu_flush_all();
    4.30 @@ -1991,7 +1991,7 @@ void iommu_resume(void)
    4.31      struct iommu_flush *flush;
    4.32      u32 i;
    4.33  
    4.34 -    if ( !vtd_enabled )
    4.35 +    if ( !iommu_enabled )
    4.36          return;
    4.37  
    4.38      /* Re-initialize the register-based flush functions.
     5.1 --- a/xen/drivers/passthrough/vtd/utils.c	Fri Jun 05 09:25:50 2009 +0100
     5.2 +++ b/xen/drivers/passthrough/vtd/utils.c	Fri Jun 05 09:26:39 2009 +0100
     5.3 @@ -260,7 +260,7 @@ void dump_iommu_info(unsigned char key)
     5.4      }
     5.5  
     5.6      /* Dump the I/O xAPIC redirection table(s). */
     5.7 -    if ( vtd_enabled )
     5.8 +    if ( iommu_enabled )
     5.9      {
    5.10          int apic, reg;
    5.11          union IO_APIC_reg_01 reg_01;
     6.1 --- a/xen/drivers/passthrough/vtd/x86/vtd.c	Fri Jun 05 09:25:50 2009 +0100
     6.2 +++ b/xen/drivers/passthrough/vtd/x86/vtd.c	Fri Jun 05 09:26:39 2009 +0100
     6.3 @@ -117,7 +117,7 @@ void hvm_dpci_isairq_eoi(struct domain *
     6.4      int i;
     6.5  
     6.6      ASSERT(isairq < NR_ISAIRQS);
     6.7 -    if ( !vtd_enabled)
     6.8 +    if ( !iommu_enabled)
     6.9          return;
    6.10  
    6.11      spin_lock(&d->event_lock);
     7.1 --- a/xen/include/xen/iommu.h	Fri Jun 05 09:25:50 2009 +0100
     7.2 +++ b/xen/include/xen/iommu.h	Fri Jun 05 09:26:39 2009 +0100
     7.3 @@ -26,7 +26,6 @@
     7.4  #include <public/hvm/ioreq.h>
     7.5  #include <public/domctl.h>
     7.6  
     7.7 -extern int vtd_enabled;
     7.8  extern int iommu_enabled;
     7.9  extern int iommu_pv_enabled;
    7.10  extern int force_iommu;