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

Re: [Xen-devel] [PATCH v1] hvmloader, pci: Don't try to relocate memory if 64-bit BAR is bigger than 4GB



>>> On 28.09.16 at 21:23, <konrad@xxxxxxxxxx> wrote:
> .. snip..
>>> +            {
>>> +                /* If bigger than 4GB, don't try to put under 4GB. */
>>> +                if ( is_64bar && bar_sz > (1ull<<32) )
>>
>> Clearly at the very least this should be >=. However, even when
>> it's a 2Gb BAR, we won't be able to fit it (as it can't go at address
>> zero, nor at address 0x80000000, both for different reasons).
> 
> <brushes off an old email>
> The reason 2GB is also problematic is that we still have other things
> that need to live under 4GB region: ACPI, APIC, and BAR of the PCI
> platform device (16MB), VGA emulated device (32MB).
> 
> mmio_total counts all of those up, and the emulated devices are
> enumerated before the passthrough devices - so I can do:
> 
>  if ( is_64bar && bar_sz > (GB(2) - mmio_total - HVM_BELOW_4G_MMIO_LENGTH) )
> 
> or such?

Or such. Subtracting mmio_total is problematic, as that may cause
the expression to wrap through zero. And I also don't see why you
would want to subtract it in the first place: If the overall size is too
big, code elsewhere is responsible for taking care. Once removed
I'd then think you should once again use >= (even if it doesn't
really matter much, i.e. mostly as documentation of the intentions).

Jan


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

 


Rackspace

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