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

Re: [Xen-devel] [PATCH v2 3/4] x86/vtd: introduce a PVH implementation of iommu_inclusive_mapping


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Mon, 28 Aug 2017 06:13:10 +0000
  • Accept-language: en-US
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 28 Aug 2017 06:13:28 +0000
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.0.0.116
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: AQHTEsD/UoGLQ+onNEqPufZD3DY5fqKH5+Qw///l7ICAEZW6MA==
  • Thread-topic: [PATCH v2 3/4] x86/vtd: introduce a PVH implementation of iommu_inclusive_mapping

> From: Roger Pau Monne [mailto:roger.pau@xxxxxxxxxx]
> Sent: Thursday, August 17, 2017 5:39 PM
> 
> > >
> > > +void __hwdom_init vtd_set_pvh_hwdom_mapping(struct domain *d)
> > > +{
> > > +    unsigned long pfn;
> > > +
> > > +    BUG_ON(!is_hardware_domain(d));
> > > +
> > > +    if ( !iommu_inclusive_mapping )
> > > +        return;
> > > +
> > > +    /* NB: the low 1MB is already mapped in pvh_setup_p2m. */
> > > +    for ( pfn = PFN_DOWN(MB(1)); pfn < PFN_DOWN(GB(4)); pfn++ )
> > > +    {
> > > +        p2m_access_t a;
> > > +        int rc;
> > > +
> > > +        if ( !(pfn & 0xfff) )
> > > +            process_pending_softirqs();
> > > +
> > > +        /* Skip RAM, ACPI and unusable regions. */
> > > +        if ( page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL) ||
> > > +             page_is_ram_type(pfn, RAM_TYPE_UNUSABLE) ||
> > > +             page_is_ram_type(pfn, RAM_TYPE_ACPI) ||
> > > +             !iomem_access_permitted(d, pfn, pfn) )
> > > +            continue;
> >
> > I'm a bit confused here. So you only handle RESERVED memory
> > type here, which doesn't match the definition of inclusive mapping.
> >
> > /*
> >  * iommu_inclusive_mapping: when set, all memory below 4GB is
> included in dom0
> >  * 1:1 iommu mappings except xen and unusable regions.
> >  */
> >
> > there must be some background which I missed...
> 
> Right, RAM and ACPI regions are already mapped by the Dom0 builder, so
> the only thing left are reserved regions not being used by Xen.
> 
> I can expand the comment above to say:
> 
> /*
>  * Skip RAM, ACPI and unusable regions because they have been already
>  * mapped by the PVH Dom0 builder.
>  */
> 
> Does that seem better?
> 
> Roger.

yes it's better. btw if you can limit the function name further then 
it might be clearer, e.g. vtd_set_pvh_hwdom_reserved_mapping


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

 


Rackspace

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