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

Re: [Xen-devel] [PATCH 4/4] iommu: add rmrr Xen command line option for extra rmrrs



>>> On 01.06.15 at 08:30, <kevin.tian@xxxxxxxxx> wrote:
>>  From: elena.ufimtseva@xxxxxxxxxx [mailto:elena.ufimtseva@xxxxxxxxxx]
>> +        rmrrn = xzalloc(struct acpi_rmrr_unit);
>> +        if ( !rmrrn )
>> +            return;
>> +
>> +        rmrrn->scope.devices = xmalloc_array(u16,
>> +                                             rmrru[i].dev_count);
>> +        if ( !rmrrn->scope.devices )
>> +        {
>> +            xfree(rmrrn);
>> +            return;
>> +        }
>> +
>> +        seg = 0;
>> +        for ( dev = 0; dev < rmrru->dev_count; dev++ )
>> +        {
>> +            rmrrn->scope.devices[dev] = rmrru->sbdf[dev];
>> +            seg = seg | PCI_SEG(rmrru->sbdf[dev] >> 16);
>> +        }
>> +        if ( seg != PCI_SEG(rmrru->sbdf[0]) )
>> +        {
>> +            printk(XENLOG_ERR VTDPREFIX
>> +                   "Segments are not equal for RMRR range [%"PRIx64" - 
>> %"PRIx64"]\n",
>> +                   rmrru->base_pfn, rmrru->end_pfn);
>> +            xfree(rmrrn->scope.devices);
>> +            xfree(rmrrn);
>> +            continue;
>> +        }
> 
> This check should be moved earlier along with other checks.

I think that would make code worse, as it would mean breaking up
the loop above (right now it depends on the memory allocations
left in above for context).

Jan


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


 


Rackspace

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