[PATCH] powerpc/pseries: Add pcibios_default_alignment implementation

From: Shawn Anastasio
Date: Fri Aug 21 2020 - 17:00:06 EST


Implement pcibios_default_alignment for pseries so that
resources are page-aligned. The main benefit of this is being
able to map any resource from userspace via mechanisms like VFIO.

This is identical to powernv's implementation.

Signed-off-by: Shawn Anastasio <shawn@xxxxxxxxxx>
---
arch/powerpc/platforms/pseries/pci.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 911534b89c85..6d922c096354 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -210,6 +210,11 @@ int pseries_pcibios_sriov_disable(struct pci_dev *pdev)
}
#endif

+static resource_size_t pseries_pcibios_default_alignment(void)
+{
+ return PAGE_SIZE;
+}
+
static void __init pSeries_request_regions(void)
{
if (!isa_io_base)
@@ -231,6 +236,8 @@ void __init pSeries_final_fixup(void)

eeh_show_enabled();

+ ppc_md.pcibios_default_alignment = pseries_pcibios_default_alignment;
+
#ifdef CONFIG_PCI_IOV
ppc_md.pcibios_sriov_enable = pseries_pcibios_sriov_enable;
ppc_md.pcibios_sriov_disable = pseries_pcibios_sriov_disable;
--
2.28.0