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

Re: [Xen-devel] [RFC][PATCH 12/13] hvmloader/pci: skip reserved ranges



>>> On 15.05.15 at 11:21, <tiejun.chen@xxxxxxxxx> wrote:
> On 2015/5/15 16:31, Jan Beulich wrote:
>>>>> On 15.05.15 at 10:16, <tiejun.chen@xxxxxxxxx> wrote:
>>> On 2015/5/15 15:44, Jan Beulich wrote:
>>>>>>> On 15.05.15 at 09:34, <tiejun.chen@xxxxxxxxx> wrote:
>>>>> So I think we may need to adjust pci_mem_start like this,
>>>>>
>>>>> @@ -301,6 +301,19 @@ void pci_setup(void)
>>>>>                 pci_mem_start <<= 1;
>>>>>         }
>>>>>
>>>>> +    /* Relocate PCI memory that overlaps reserved space, like RDM. */
>>>>> +    for ( j = 0; j < memory_map.nr_map ; j++ )
>>>>> +    {
>>>>> +        if ( memory_map.map[j].type != E820_RAM )
>>>>> +        {
>>>>> +            reserved_end = memory_map.map[j].addr + 
>>>>> memory_map.map[j].size;
>>>>> +            if ( check_overlap(pci_mem_start, pci_mem_end,
>>>>> +                               memory_map.map[j].addr,
>>>>> +                               memory_map.map[j].size) )
>>>>> +                pci_mem_start -= memory_map.map[j].size >> PAGE_SHIFT;
>>>>> +        }
>>>>> +    }
>>>>> +
>>>>>         if ( mmio_total > (pci_mem_end - pci_mem_start) )
>>>>>         {
>>>>>             printf("Low MMIO hole not large enough for all devices,"
>>>>>
>>>>> Right?
>>>>
>>>> I think that gets you in the right direction, but isn't enough, as it
>>>> doesn't account for (unavoidable) gaps (BARs are always a power
>>>> of 2 in size and accordingly aligned).
>>>
>>> Right.
>>>
>>> But as you see, we always take this action, >> PAGE_SHIFT, so this means
>>> its always a sort of power of 2.
>>
>> No, certainly not.
> 
> rdm start or size? Or anything else I'm missing?

Both. How can an arbitrary value shifted right be PAGE_SHIFT be
guaranteed to be a power of two?

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