ia64/xen-unstable

changeset 15939:39c85fa942aa

VTD: Small fix to iommu initialisation.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: Guy Zana <guy@neocleus.com>
author Keir Fraser <keir@xensource.com>
date Thu Sep 20 09:42:01 2007 +0100 (2007-09-20)
parents fdabc0af5852
children b33ee2276b6a
files xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Thu Sep 20 09:40:49 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Thu Sep 20 09:42:01 2007 +0100
     1.3 @@ -27,6 +27,7 @@
     1.4  #include <xen/domain_page.h>
     1.5  #include <asm/delay.h>
     1.6  #include <asm/string.h>
     1.7 +#include <asm/mm.h>
     1.8  #include <asm/iommu.h>
     1.9  #include <asm/hvm/vmx/intel-iommu.h>
    1.10  #include "dmar.h"
    1.11 @@ -1669,6 +1670,7 @@ int iommu_setup(void)
    1.12      struct hvm_iommu *hd  = domain_hvm_iommu(dom0);
    1.13      struct acpi_drhd_unit *drhd;
    1.14      struct iommu *iommu;
    1.15 +    unsigned long i;
    1.16  
    1.17      if (!vtd_enabled)
    1.18          return 0;
    1.19 @@ -1687,8 +1689,9 @@ int iommu_setup(void)
    1.20      drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
    1.21      iommu = drhd->iommu;
    1.22  
    1.23 -    hd->pgd = (struct dma_pte *)alloc_xenheap_page();
    1.24 -    memset((u8*)hd->pgd, 0, PAGE_SIZE);
    1.25 +    /* setup 1:1 page table for dom0 */
    1.26 +    for (i = 0; i < max_page; i++)
    1.27 +        iommu_map_page(dom0, i, i);
    1.28  
    1.29      if (init_vtd_hw())
    1.30          goto error;