> From: Roger Pau Monne [mailto:roger....@citrix.com]
> 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@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to