[SLOF] [RFC PATCH] pci-properties: Enforce all MMIO BARs to be 64K page aligned

Alexey Kardashevskiy aik at ozlabs.ru
Mon Dec 14 19:07:26 AEDT 2015

On 12/14/2015 04:25 PM, Nikunj A Dadhania wrote:
> yongji xie <xyjxie at linux.vnet.ibm.com> writes:
>> 在 2015/12/11 17:40, Nikunj A Dadhania 写道:
>>> Yongji Xie <xyjxie at linux.vnet.ibm.com> writes:
>>>> QEMU may passthrough a pci device of which BARs are smaller than
>>>> 64KB(PAGE_SIZE) to guest if all PCI MMIO BARs are page aligned in
>>>> host. But these passthru-BARs' mmio page would be shared with other
>>>> BARs in guest if guest doesn't support all PCI MMIO BARs to be page
>>>> aligned. This would cause the pci-passthrough fail and mmio emulation
>>>> happens in host.
>>>> To solve this performance issue, this patch enforces the alignment
>>>> of all MMIO BARs allocations to be at least 64K page aligned so that
>>>> the mmio page of one BAR would not be shared with other BARs in guest.
>>> So this would be basically hard-code (host page size 64k) page size. Is
>>> there a better way to communicate this to the guest ?
>> Yes, I know hard-code is not a good idea.
>>> We can pass host page size in the device tree and make this generic.
>> So you mean we can add a OF property like "ibm, mmio-bars-alignment"
>> for phb device node in QEMU and pass it to SLOF? Thanks.
> Yes, something like that.
> Alexey, what will be the right place to put ?

I'd wait and see how it goes with QEMU and kernel patchsets first.
May be it will be better just to repeat host's BAR alignment and not bother 
with page size in QEMU/SLOF.


More information about the SLOF mailing list