ia64/xen-unstable

changeset 19228:c3a307f5a14b

vtd: fix/cleanup minor issues with multi-page qinval support

Remove MAX_QINVAL_PAGES. Rely on whoever changes NUM_QINVAL_PAGES to
change corresponding IQA_REG_QS value also.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 18 08:57:56 2009 +0000 (2009-02-18)
parents 08da408254c6
children b29a64d04a01
files xen/drivers/passthrough/vtd/iommu.h xen/drivers/passthrough/vtd/qinval.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/iommu.h	Wed Feb 18 08:56:31 2009 +0000
     1.2 +++ b/xen/drivers/passthrough/vtd/iommu.h	Wed Feb 18 08:57:56 2009 +0000
     1.3 @@ -397,8 +397,8 @@ struct poll_info {
     1.4      u32 udata;
     1.5  };
     1.6  
     1.7 -#define MAX_QINVAL_PAGES 8
     1.8  #define NUM_QINVAL_PAGES 1
     1.9 +#define IQA_REG_QS       0    // derived from NUM_QINVAL_PAGES per VT-d spec.
    1.10  #define QINVAL_ENTRY_NR (PAGE_SIZE_4K*NUM_QINVAL_PAGES/sizeof(struct qinval_entry))
    1.11  #define qinval_present(v) ((v).lo & 1)
    1.12  #define qinval_fault_disable(v) (((v).lo >> 1) & 1)
     2.1 --- a/xen/drivers/passthrough/vtd/qinval.c	Wed Feb 18 08:56:31 2009 +0000
     2.2 +++ b/xen/drivers/passthrough/vtd/qinval.c	Wed Feb 18 08:57:56 2009 +0000
     2.3 @@ -445,8 +445,7 @@ int qinval_setup(struct iommu *iommu)
     2.4       * registers are automatically reset to 0 with write
     2.5       * to IQA register.
     2.6       */
     2.7 -    if ( NUM_QINVAL_PAGES <= MAX_QINVAL_PAGES )
     2.8 -        qi_ctrl->qinval_maddr |= NUM_QINVAL_PAGES - 1;
     2.9 +    qi_ctrl->qinval_maddr |= IQA_REG_QS;
    2.10      dmar_writeq(iommu->reg, DMAR_IQA_REG, qi_ctrl->qinval_maddr);
    2.11  
    2.12      /* enable queued invalidation hardware */