[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [v3][PATCH 1/1] xen:vtd: missing RMRR mapping while share EPT



> From: Chen, Tiejun
> Sent: Thursday, July 24, 2014 4:00 AM
> 
> intel_iommu_map_page() does nothing if VT-d shares EPT page table.
> So rmrr_identity_mapping() never create RMRR mapping but in some
> cases like some GFX drivers it still need to access RMRR.

this is not accurate. as long as RMRR is reported, it's always necessary
to have the identity mapping there, not just needed in SOME CASES. :-)

Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>, but please also work out
a solution for address overlapping issue like Tim pointed. out.

Thanks
Kevin

> 
> Here we will create those RMRR mappings even in shared EPT case.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
> ---
>  xen/drivers/passthrough/vtd/iommu.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> v3:
> 
> * Use set_mmio_p2m_entry() to replace p2m_set_entry()
> * Use ASSERT to check
> 
> v2:
> 
> * Fix coding style.
> * Still need to abide intel_iommu_map_page(), so we should do nothing
>   if dom0 and iommu supports pass thru.
> 
> diff --git a/xen/drivers/passthrough/vtd/iommu.c
> b/xen/drivers/passthrough/vtd/iommu.c
> index 042b882..f08a1fc 100644
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1867,8 +1867,14 @@ static int rmrr_identity_mapping(struct domain *d,
> 
>      while ( base_pfn < end_pfn )
>      {
> -        if ( intel_iommu_map_page(d, base_pfn, base_pfn,
> -
> IOMMUF_readable|IOMMUF_writable) )
> +        if ( iommu_use_hap_pt(d) )
> +        {
> +            ASSERT(!iommu_passthrough || !is_hardware_domain(d));
> +            if ( set_mmio_p2m_entry(d, base_pfn, _mfn(base_pfn)) )
> +                return -1;
> +        }
> +        else if ( intel_iommu_map_page(d, base_pfn, base_pfn,
> +
> IOMMUF_readable|IOMMUF_writable) )
>              return -1;
>          base_pfn++;
>      }
> --
> 1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.