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

Re: [Xen-devel] [v8][PATCH 15/17] xen:vtd: create RMRR mapping



> From: Chen, Tiejun
> Sent: Monday, December 01, 2014 5:25 PM
> 
> 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.
> 
> Here we will create those RMRR mappings even in shared EPT case.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>

Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>

> ---
>  xen/drivers/passthrough/vtd/iommu.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/vtd/iommu.c
> b/xen/drivers/passthrough/vtd/iommu.c
> index a38f201..a54c6eb 100644
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -1856,10 +1856,15 @@ static int rmrr_identity_mapping(struct domain
> *d, bool_t map,
> 
>      while ( base_pfn < end_pfn )
>      {
> -        int err = intel_iommu_map_page(d, base_pfn, base_pfn,
> -
> IOMMUF_readable|IOMMUF_writable);
> -
> -        if ( err )
> +        int err = 0;
> +        if ( iommu_use_hap_pt(d) )
> +        {
> +            ASSERT(!iommu_passthrough || !is_hardware_domain(d));
> +            if ( (err = set_identity_p2m_entry(d, base_pfn,
> p2m_access_rw)) )
> +                return err;
> +        }
> +        else if ( (err = intel_iommu_map_page(d, base_pfn, base_pfn,
> +                                           IOMMUF_readable|IOMMUF_writable)) 
> )
>              return err;
>          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®.