OpenCloudOS-Kernel/arch/s390/include/asm
Niklas Schnelle 52d04d4081 s390/pci: move pseudo-MMIO to prevent MIO overlap
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>
2021-11-29 09:48:34 +01:00
..
fpu s390: convert to generic entry 2021-01-19 12:29:26 +01:00
trace
vdso s390/vdso: use system call functions 2021-07-27 09:39:15 +02:00
Kbuild local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
airq.h s390/airq: use DMA memory for adapter interrupts 2019-06-15 12:25:05 +02:00
alternative-asm.h s390: add assembler macros for CPU alternatives 2018-03-28 08:38:27 +02:00
alternative.h s390/alternatives: add alternative_input() / alternative_io() 2021-02-09 15:57:06 +01:00
ap.h s390/ap: get rid of register asm in ap_dqap() 2021-07-08 22:12:17 +02:00
appldata.h s390/appldata: pass parameter list pointer to appldata_asm 2018-10-09 11:20:50 +02:00
archrandom.h s390/crypto: add arch_get_random_long() support 2020-12-10 21:02:08 +01:00
asm-const.h s390/kernel: unify EX_TABLE* implementations 2020-07-20 10:55:45 +02:00
asm-prototypes.h
atomic.h locking/atomic: make ARCH_ATOMIC a Kconfig symbol 2021-05-26 13:20:49 +02:00
atomic_ops.h s390/atomic,cmpxchg: make constraints work with old compilers 2021-04-15 17:47:42 +02:00
barrier.h s390/barrier: factor out bcr_serialize() 2021-10-11 20:55:58 +02:00
bitops.h s390/bitops: return true/false (not 1/0) from bool functions 2021-10-26 15:21:29 +02:00
boot_data.h s390/ipl: read IPL report at early boot 2019-04-26 12:34:05 +02:00
bug.h printk: Make linux/printk.h self-contained 2020-07-27 17:46:24 +09:00
bugs.h s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
cache.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
ccwdev.h s390/cio: remove duplicate struct ccw1 declaration 2021-04-05 11:30:57 +02:00
ccwgroup.h s390/qeth: fix deadlock during failing recovery 2021-09-21 20:02:24 -07:00
checksum.h s390/checksum: use register pair instead of register asm 2021-06-18 16:41:21 +02:00
chpid.h s390/cio: rename struct channel_path_desc 2018-03-26 16:13:11 +02:00
chsc.h s390/cio: Add new Operation Code OC3 to PNSO 2020-09-15 13:21:46 -07:00
cio.h s390/cio: remove unused include linux/spinlock.h from cio.h 2021-07-27 09:39:13 +02:00
clocksource.h s390: convert to GENERIC_VDSO 2020-08-26 18:47:21 +02:00
clp.h s390/pci: Implement ioremap_wc/prot() with MIO 2020-09-14 10:30:07 +02:00
cmb.h
cmpxchg.h s390/cmpxchg: use register pair instead of register asm 2021-06-28 11:18:28 +02:00
compat.h arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
cpacf.h s390/cpacf: get rid of register asm 2021-07-27 09:39:15 +02:00
cpcmd.h
cpu.h s390: add support for BEAR enhancement facility 2021-10-26 15:21:29 +02:00
cpu_mcf.h s390/cpum_cf: move array from header to C file 2021-09-07 13:38:41 +02:00
cpu_mf-insn.h s390/cpu_mf: add store cpu counter multiple instruction support 2019-02-22 09:19:52 +01:00
cpu_mf.h s390/cpum_sf: Replace function name in debug statements 2019-11-30 10:52:46 +01:00
cpufeature.h s390/hwcaps: shorten HWCAP defines 2021-07-27 09:39:20 +02:00
cputime.h s390: convert to generic entry 2021-01-19 12:29:26 +01:00
crw.h
css_chars.h s390/cio: Add new Operation Code OC3 to PNSO 2020-09-15 13:21:46 -07:00
ctl_reg.h s390/ctl_reg: add ctlreg5 and ctlreg15 unions 2021-07-27 09:39:17 +02:00
current.h
debug.h s390/debug: fix kernel-doc warnings 2021-10-11 20:55:58 +02:00
delay.h s390/delay: remove udelay_simple() 2020-12-16 14:55:49 +01:00
diag.h s390: rename dma section to amode31 2021-08-05 14:10:53 +02:00
dis.h s390/tools: generate header files in arch/s390/include/generated/ 2018-01-23 07:36:53 +01:00
dma.h
dwarf.h s390/vdso: revise CFI annotations of vDSO functions 2017-12-13 10:51:36 +01:00
eadm.h s390/scm: Make struct scm_driver::remove return void 2021-07-21 11:53:42 +02:00
ebcdic.h s390: fix clang -Wpointer-sign warnigns in boot code 2019-05-03 17:17:58 +02:00
elf.h s390/hwcaps: make sie capability regular hwcap 2021-07-27 09:39:21 +02:00
entry-common.h s390/signal: remove sigreturn on stack 2021-07-08 22:12:17 +02:00
exec.h
extable.h s390: rename dma section to amode31 2021-08-05 14:10:53 +02:00
extmem.h
facility.h include/linux/delay.h: replace kernel.h with the necessary inclusions 2021-11-09 10:02:49 -08:00
fcx.h
ftrace.h s390/ftrace: add HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALL support 2021-10-19 15:39:53 +02:00
ftrace.lds.h s390/ftrace: implement hotpatching 2021-08-03 14:31:40 +02:00
futex.h s390/mm: remove set_fs / rework address space handling 2020-11-23 12:01:12 +01:00
gmap.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
hardirq.h softirq: Move __ARCH_HAS_DO_SOFTIRQ to Kconfig 2021-02-10 23:34:16 +01:00
hugetlb.h mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hw_irq.h s390/irq: make init_ext_interrupts static 2020-03-11 14:18:44 +01:00
idals.h s390/idal: use struct_size() in kmalloc() 2019-06-04 15:03:18 +02:00
idle.h s390/time,idle: get rid of unsigned long long 2021-03-08 10:46:27 +01:00
io.h mm: remove xlate_dev_kmem_ptr() 2021-05-07 00:26:34 -07:00
ipl.h s390/cio: remove unused include linux/spinlock.h from cio.h 2021-07-27 09:39:13 +02:00
irq.h s390/pci: gather statistics for floating vs directed irqs 2019-04-29 10:47:01 +02:00
irq_work.h s390/smp: implement arch_irq_work_raise() 2021-02-24 00:31:22 +01:00
irqflags.h s390/irqflags: always inline arch irqflags functions 2021-06-18 16:41:19 +02:00
isc.h KVM: s390: add gib_alert_irq_handler() 2019-02-05 14:29:23 +01:00
itcw.h
jump_label.h s390/jump_label: make use of HAVE_JUMP_LABEL_BATCH 2021-10-11 20:55:58 +02:00
kasan.h s390: setup kernel memory layout early 2021-06-18 16:41:19 +02:00
kdebug.h exit: Remove calls of do_exit after noreturn versions of die 2021-10-20 13:09:47 -05:00
kexec.h s390/kexec: fix memory leak of ipl report buffer 2021-11-18 17:50:07 +01:00
kfence.h s390: add support for KFENCE 2021-07-30 17:09:02 +02:00
kprobes.h kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
kvm_host.h ARM: 2021-09-07 13:40:51 -07:00
kvm_para.h KVM: s390: generate kvm hypercall functions 2021-08-25 11:03:35 +02:00
linkage.h s390: rename dma section to amode31 2021-08-05 14:10:53 +02:00
livepatch.h s390/ftrace: add ftrace_instruction_pointer_set() helper function 2021-10-11 20:55:58 +02:00
lowcore.h s390: add support for BEAR enhancement facility 2021-10-26 15:21:29 +02:00
mem_detect.h s390/mem_detect: provide single get_mem_detect_end 2019-08-26 12:51:18 +02:00
mem_encrypt.h treewide: Replace the use of mem_encrypt_active() with cc_platform_has() 2021-10-04 11:47:24 +02:00
mmu.h s390 updates for the 5.7 merge window 2020-04-04 09:45:50 -07:00
mmu_context.h s390/mm: ensure switch_mm() is executed with interrupts disabled 2021-06-07 17:06:59 +02:00
mmzone.h
module.h s390/ftrace: implement hotpatching 2021-08-03 14:31:40 +02:00
nmi.h s390/mcck: keep machine check interruption codes sorted 2021-07-05 12:44:23 +02:00
nospec-branch.h s390: introduce nospec_uses_trampoline() 2021-10-26 15:21:29 +02:00
nospec-insn.h s390/nospec: rename assembler generated expoline thunks 2019-05-02 13:54:11 +02:00
numa.h s390/mm: remove fake numa support 2020-02-27 16:02:21 +01:00
os_info.h
page-states.h
page.h s390/mm: remove unused cmma functions 2021-08-18 10:01:28 +02:00
pci.h s390/pci: implement minimal PCI error recovery 2021-11-08 14:17:49 +01:00
pci_clp.h s390/pci: Implement ioremap_wc/prot() with MIO 2020-09-14 10:30:07 +02:00
pci_debug.h
pci_dma.h s390/pci: improve DMA translation init and exit 2021-08-25 11:03:34 +02:00
pci_insn.h s390: fix setting of mio addressing control 2019-07-11 20:40:02 +02:00
pci_io.h s390/pci: move pseudo-MMIO to prevent MIO overlap 2021-11-29 09:48:34 +01:00
percpu.h s390/cmpxchg: use register pair instead of register asm 2021-06-28 11:18:28 +02:00
perf_event.h s390: implement perf_arch_fetch_caller_regs 2019-11-30 10:52:44 +01:00
pgalloc.h mm/thp: define default pmd_pgtable() 2021-07-01 11:06:03 -07:00
pgtable.h s390 updates for the 5.16 merge window 2021-11-06 14:48:06 -07:00
pkey.h s390/pkey: pkey cleanup: narrow in-kernel API, fix some variable types 2019-08-21 12:58:53 +02:00
pnet.h s390/net: move pnet constants 2019-02-07 18:06:18 -08:00
preempt.h s390: preempt: Fix preempt_count initialization 2021-07-08 22:12:18 +02:00
processor.h sched: Add wrapper for get_wchan() to keep task blocked 2021-10-15 11:25:14 +02:00
ptdump.h s390: add ARCH_HAS_DEBUG_WX support 2020-09-14 11:38:35 +02:00
ptrace.h s390/ptrace: add last_break member to pt_regs 2021-10-26 15:21:28 +02:00
purgatory.h s390/purgatory: Remove duplicate variable definitions 2018-07-06 08:47:51 +02:00
qdio.h s390/qeth: move qdio's QAOB cache into qeth 2021-10-25 13:58:19 +01:00
runtime_instr.h s390/runtime instrumentation: provide uapi header file 2018-02-02 10:47:15 +01:00
schid.h
sclp.h s390/sclp: sort out physical vs virtual pointers usage 2021-10-26 15:21:28 +02:00
scsw.h s390: Simplify the calculation of variables 2021-02-09 15:57:04 +01:00
seccomp.h s390: Enable seccomp architecture tracking 2020-11-20 11:16:35 -08:00
sections.h s390: use generic version of arch_is_kernel_initmem_freed() 2021-11-06 13:30:38 -07:00
serial.h
set_memory.h s390/mm: implement set_memory_4k() 2021-07-30 17:09:01 +02:00
setup.h s390: make command line configurable 2021-10-26 15:21:31 +02:00
shmparam.h
signal.h
sigp.h s390/sigp: use register pair instead of register asm 2021-06-18 16:41:22 +02:00
smp.h s390/topology: fix topology information when calling cpu hotplug notifiers 2021-09-07 13:38:41 +02:00
softirq_stack.h s390/softirq: use call_on_stack() macro 2021-07-08 22:12:18 +02:00
sparsemem.h
spinlock.h locking: Remove spin_lock_flags() etc 2021-10-30 16:37:28 +02:00
spinlock_types.h s390/spinlock: remove align attribute from arch_spinlock_t 2021-03-28 20:23:54 +02:00
stacktrace.h s390/unwind: use current_frame_address() to unwind current task 2021-09-07 13:38:27 +02:00
stp.h s390/stp: add support for leap seconds 2020-09-26 15:51:21 +02:00
string.h s390/string: use generic strlcpy 2021-10-26 15:21:30 +02:00
switch_to.h s390: always save and restore all registers on context switch 2017-12-05 07:51:08 +01:00
syscall.h arch: remove unused function syscall_set_arguments() 2021-09-14 16:06:20 +02:00
syscall_wrapper.h s390: pass struct pt_regs instead of registers to syscalls 2021-01-19 12:29:27 +01:00
sysinfo.h s390/sysinfo: add and display licensed internal code identifier 2018-02-02 10:47:15 +01:00
termios.h
text-patching.h s390: introduce text_poke_sync() 2021-10-11 20:55:58 +02:00
thread_info.h s390: add CPU field to struct thread_info 2021-09-30 16:12:51 +02:00
timex.h s390/timex: get rid of register asm 2021-06-28 11:18:28 +02:00
tlb.h s390/tlb: make cleared_pXs flags consistent with generic code 2021-01-19 12:29:25 +01:00
tlbflush.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
topology.h s390/numa: set node distance to LOCAL_DISTANCE 2020-08-11 18:16:35 +02:00
tpi.h s390: add struct tpi_info to struct pt_regs 2021-06-07 17:07:01 +02:00
types.h s390: introduce register pair union 2021-06-18 16:41:21 +02:00
uaccess.h arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
unistd.h s390: wire up clone3 system call 2019-07-23 10:45:53 +02:00
unwind.h s390/unwind: use current_frame_address() to unwind current task 2021-09-07 13:38:27 +02:00
uprobes.h
user.h
uv.h KVM: s390: pv: properly handle page flags for protected guests 2021-10-27 07:55:53 +02:00
vdso.h s390/vdso: add minimal compat vdso 2021-07-08 15:37:28 +02:00
vga.h s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
vmlinux.lds.h s390: introduce .boot.preserved.data section 2019-04-10 17:47:09 +02:00
vtime.h s390: convert to generic entry 2021-01-19 12:29:26 +01:00
vtimer.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
vx-insn.h s390: add alignment hints to vector load and store 2019-02-07 11:57:10 +01:00
xor.h