linux/arch
Niklas Schnelle a78b607e1b s390/pci: move pseudo-MMIO to prevent MIO overlap
commit 52d04d408185b7aa47628d2339c28ec70074e0ae upstream.

When running without MIO support, with pci=nomio or for devices which
are not MIO-capable the zPCI subsystem generates pseudo-MMIO addresses
to allow access to PCI BARs via MMIO based Linux APIs even though the
platform uses function handles and BAR numbers.

This is done by stashing an index into our global IOMAP array which
contains the function handle in the 16 most significant bits of the
addresses returned by ioremap() always setting the most significant bit.

On the other hand the MIO addresses assigned by the platform for use,
while requiring special instructions, allow PCI access with virtually
mapped physical addresses. Now the problem is that these MIO addresses
and our own pseudo-MMIO addresses may overlap, while functionally this
would not be a problem by itself this overlap is detected by common code
as both address types are added as resources in the iomem_resource tree.
This leads to the overlapping resource claim of either the MIO capable
or non-MIO capable devices with being rejected.

Since PCI is tightly coupled to the use of the iomem_resource tree, see
for example the code for request_mem_region(), we can't reasonably get
rid of the overlap being detected by keeping our pseudo-MMIO addresses
out of the iomem_resource tree.

Instead let's move the range used by our own pseudo-MMIO addresses by
starting at (1UL << 62) and only using addresses below (1UL << 63) thus
avoiding the range currently used for MIO addresses.

Fixes: c7ff0e918a ("s390/pci: deal with devices that have no support for MIO instructions")
Cc: stable@vger.kernel.org # 5.3+
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:01:11 +01:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:09:26 +02:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:26:45 +02:00
arm ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE 2021-12-01 09:23:32 +01:00
arm64 arm64: dts: mcbin: support 2W SFP modules 2021-12-08 09:01:08 +01:00
c6x mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
csky csky: Fixup regs.sr broken in ptrace 2021-10-20 11:40:12 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 10:35:18 +01:00
hexagon hexagon: export raw I/O routines for modules 2021-11-26 10:47:21 +01:00
ia64 ia64: don't do IA64_CMPXCHG_DEBUG without CONFIG_PRINTK 2021-11-17 09:48:29 +01:00
m68k m68k: set a default value for MEMORY_RESERVE 2021-11-17 09:48:46 +01:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:37:02 +01:00
mips MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48 2021-12-01 09:23:33 +01:00
nds32 nds32: fix up stack guard gap 2021-07-28 13:31:01 +02:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-11-02 19:46:14 +01:00
openrisc openrisc: don't printk() unconditionally 2021-09-22 12:26:24 +02:00
parisc Revert "parisc: Fix backtrace to always include init funtion names" 2021-12-01 09:23:28 +01:00
powerpc KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB 2021-12-01 09:23:28 +01:00
riscv RISC-V: Include clone3() on rv32 2021-10-13 10:08:20 +02:00
s390 s390/pci: move pseudo-MMIO to prevent MIO overlap 2021-12-08 09:01:11 +01:00
sh sh: define __BIG_ENDIAN for math-emu 2021-11-26 10:47:17 +01:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:39:49 +02:00
um um: virtio_uml: fix memory leak on init failures 2021-09-26 14:07:08 +02:00
unicore32 mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
x86 x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 10:47:21 +01:00
xtensa xtensa: xtfpga: Try software restart before simulating CPU reset 2021-10-27 09:54:25 +02:00
.gitignore
Kconfig Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS" 2020-12-30 11:51:47 +01:00