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

Re: [Xen-devel] [PATCH 4/4] x86/iommu: add PVH support to the inclusive options



>>> On 31.07.18 at 17:27, <roger.pau@xxxxxxxxxx> wrote:
> On Tue, Jul 31, 2018 at 05:15:22PM +0200, Roger Pau Monné wrote:
>> On Tue, Jul 31, 2018 at 08:52:14AM -0600, Jan Beulich wrote:
>> > >>> On 27.07.18 at 17:31, <roger.pau@xxxxxxxxxx> wrote:
>> > > --- a/xen/drivers/passthrough/x86/iommu.c
>> > > +++ b/xen/drivers/passthrough/x86/iommu.c
>> > > @@ -20,6 +20,8 @@
>> > >  #include <xen/softirq.h>
>> > >  #include <xsm/xsm.h>
>> > >  
>> > > +#include <asm/apicdef.h>
>> > > +#include <asm/io_apic.h>
>> > 
>> > Why? You're looking for the guest view of things, which I don't
>> > think you can derive from definitions in these two headers.
>> 
>> I can use the domain state for the lapic and the ioapic...
>> 
>> > > +    /* ... or the PCIe MCFG regions. */
>> > > +    for ( i = 0; i < pci_mmcfg_config_num; i++ )
>> > > +    {
>> > > +        unsigned long addr = PFN_DOWN(pci_mmcfg_config[i].address);
>> > > +
>> > > +        if ( pfn >= addr + (pci_mmcfg_config[i].start_bus_number << 8) 
>> > > &&
>> > > +             pfn < addr + (pci_mmcfg_config[i].end_bus_number << 8) )
>> > > +            return false;
>> > > +    }
>> > 
>> > Same here - this would better use domain state.
>> 
>> ... but pci mcfg regions are currently added after the iommu
>> initialization in the HVM dom0 builder. I can shuffle that call so
>> that iommu initialization is performed after the mcfg regions are
>> added.
> 
> So that's not so easy. The current hvm_mmcfg used to store the MMCFG
> data in the domain struct is private to io.c, I could move it's
> declaration to a header file, but maybe it's better to just use
> pci_mmcfg_config directly?

Or add a helper function in that file?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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