[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOSf1CFFyz0YNqdpd5r44MaBV449yoK3WOMBZ1mpgZ=judNfDQ@mail.gmail.com>
Date: Tue, 28 May 2019 14:01:24 +1000
From: Oliver <oohall@...il.com>
To: Shawn Anastasio <shawn@...stas.io>
Cc: linux-pci@...r.kernel.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Sam Bobroff <sbobroff@...ux.ibm.com>,
xyjxie@...ux.vnet.ibm.com, rppt@...ux.ibm.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Alexey Kardashevskiy <aik@...abs.ru>
Subject: Re: [RESEND PATCH 0/3] Allow custom PCI resource alignment on pseries
On Tue, May 28, 2019 at 8:56 AM Shawn Anastasio <shawn@...stas.io> wrote:
>
> Hello all,
>
> This patch set implements support for user-specified PCI resource
> alignment on the pseries platform for hotplugged PCI devices.
> Currently on pseries, PCI resource alignments specified with the
> pci=resource_alignment commandline argument are ignored, since
> the firmware is in charge of managing the PCI resources. In the
> case of hotplugged devices, though, the kernel is in charge of
> configuring the resources and should obey alignment requirements.
Are you using hotplug to work around SLOF (the OF we use under qemu)
not aligning BARs to 64K? It looks like there is a commit in SLOF to
fix that (https://git.qemu.org/?p=SLOF.git;a=commit;f=board-qemu/slof/pci-phb.fs;h=1903174472f8800caf50c959b304501b4c01153c).
> The current behavior of ignoring the alignment for hotplugged devices
> results in sub-page BARs landing between page boundaries and
> becoming un-mappable from userspace via the VFIO framework.
> This issue was observed on a pseries KVM guest with hotplugged
> ivshmem devices.
> With these changes, users can specify an appropriate
> pci=resource_alignment argument on boot for devices they wish to use
> with VFIO.
>
> In the future, this could be extended to provide page-aligned
> resources by default for hotplugged devices, similar to what is done
> on powernv by commit 382746376993 ("powerpc/powernv: Override
> pcibios_default_alignment() to force PCI devices to be page aligned").
Can we make aligning the BARs to PAGE_SIZE the default behaviour? The
BAR assignment process is complex enough as-is so I'd rather we didn't
add another platform hack into the mix.
> Feedback is appreciated.
>
> Thanks,
> Shawn
>
> Shawn Anastasio (3):
> PCI: Introduce pcibios_ignore_alignment_request
> powerpc/64: Enable pcibios_after_init hook on ppc64
> powerpc/pseries: Allow user-specified PCI resource alignment after
> init
>
> arch/powerpc/include/asm/machdep.h | 6 ++++--
> arch/powerpc/kernel/pci-common.c | 9 +++++++++
> arch/powerpc/kernel/pci_64.c | 4 ++++
> arch/powerpc/platforms/pseries/setup.c | 22 ++++++++++++++++++++++
> drivers/pci/pci.c | 9 +++++++--
> 5 files changed, 46 insertions(+), 4 deletions(-)
>
> --
> 2.20.1
>
Powered by blists - more mailing lists