| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH resend] PVH Dom0 RMRR IOMMU mapping regression fix
 >>> On 25.09.15 at 17:18, <elena.ufimtseva@xxxxxxxxxx> wrote:
> On Fri, Sep 25, 2015 at 12:36:09AM -0600, Jan Beulich wrote:
>> >>> On 25.09.15 at 01:53, <elena.ufimtseva@xxxxxxxxxx> wrote:
>> > --- a/xen/arch/x86/mm/p2m.c
>> > +++ b/xen/arch/x86/mm/p2m.c
>> > @@ -971,7 +971,17 @@ int set_identity_p2m_entry(struct domain *d, unsigned 
>> > long gfn,
>> >          ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
>> >                              p2m_mmio_direct, p2ma);
>> >      else if ( mfn_x(mfn) == gfn && p2mt == p2m_mmio_direct && a == p2ma )
>> > -        ret = 0;
>> > +    {
>> > +        /*
>> > +         * PVH fixme: during Dom0 PVH construction, p2m entries are being 
>> > set
>> > +         * but iomem regions are not mapped with IOMMU. This makes sure 
>> > that
>> > +         * RMRRs are correctly mapped with IOMMU.
>> > +         */
>> > +        if ( is_hardware_domain(d) && !iommu_use_hap_pt(d) )
>> > +            ret = iommu_map_page(d, gfn, gfn, 
>> > IOMMUF_readable|IOMMUF_writable);
>> 
>> This should use p2m_get_iommu_flags() (which eventually needs to
>> also honor the passed in p2m_access_t, i.e. its use here for now
>> only serves documentation purposes as well as a means to spot the
>> location when making said adjustment).
> 
> Here is the problem: for p2m_mmio_direct type p2m_get_iommu_flags() will
> return 0. And that is essentially why 1:1 iomem mapping for Dom0 PVH
> does set p2m entries, but does not create identity mapping in
> construct_dom0.
> 
> Do you mean when saying 'honoring p2m_access_t' that p2m_get_iommu_flags 
> should
> be more like ept_p2m_type_to_flags() where permissions are verified?
No, I was actually wrong with that part.
> Right now even if rw permissions are requested, the type p2m_mmio_direct 
> will always
> return IOMMU flags being zero from p2m_get_iommu_flags();
I see. Leave as is then.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |