WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing

>>> On 05.01.11 at 20:36, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
>@@ -1729,13 +1732,15 @@
>     return 0;
> }
> 
>-void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int present)
>+void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte,
>+                     u32 order, int present)

u32? Shouldn't fixed-size types only be used where really necessary?

> {
>     struct acpi_drhd_unit *drhd;
>     struct iommu *iommu = NULL;
>     struct hvm_iommu *hd = domain_hvm_iommu(d);
>     int flush_dev_iotlb;
>     int iommu_domid;
>+    int page_shift = (order == 0) ? PAGE_SHIFT_4K : PAGE_SHIFT_4K + order;

Why not simply 

    int page_shift = PAGE_SHIFT_4K + order;

> 
>     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
> 
>@@ -1750,8 +1755,8 @@
>         if ( iommu_domid == -1 )
>             continue;
>         if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
>-                                   (paddr_t)gfn << PAGE_SHIFT_4K, 1,
>-                                   !present, flush_dev_iotlb) )
>+                                   (paddr_t)gfn << page_shift, 1,

This certainly isn't correct, at least as long as "gfn" is what its
name says (and since the only caller simply adds an "order"
argument without adjusting the "gfn" one, I'm sure it is).

>+                                   page_shift, !present, flush_dev_iotlb) )
>             iommu_flush_write_buffer(iommu);
>     }
> }

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel