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

Re: [Xen-devel] [PATCH 7/7] x86/IOMMU: initialize iommu_ops in vendor-independent code



>>> On 28.03.19 at 18:50, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 28/03/2019 14:54, Jan Beulich wrote:
>> --- a/xen/drivers/passthrough/x86/iommu.c
>> +++ b/xen/drivers/passthrough/x86/iommu.c
>> @@ -26,6 +26,19 @@
>>  const struct iommu_init_ops *__initdata iommu_init_ops;
>>  struct iommu_ops __read_mostly iommu_ops;
>>  
>> +int __init iommu_hardware_setup(void)
>> +{
>> +    if ( !iommu_init_ops )
>> +        return -ENODEV;
>> +
>> +    if ( !iommu_ops.init )
>> +        iommu_ops = *iommu_init_ops->ops;
>> +    else
>> +        ASSERT(iommu_ops.init == iommu_init_ops->ops->init);
> 
> What is this ASSERT() intended to catch?  We pass through this function
> exactly once, making the else path dead.

iommu_ops may have got set already during x2APIC IR enabling (see
patch 6).

> Do you have some plans in future series which make this a non-init function?

No.

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®.