linux-stable/include/asm-generic
Andrew Murray 500dd23244 asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO
The !CONFIG_GENERIC_IOMAP version of ioport_map uses MMIO_UPPER_LIMIT to
prevent users from making I/O accesses outside the expected I/O range -
however it erroneously treats MMIO_UPPER_LIMIT as a mask which is
contradictory to its other users.

The introduction of CONFIG_INDIRECT_PIO, which subtracts an arbitrary
amount from IO_SPACE_LIMIT to form MMIO_UPPER_LIMIT, results in ioport_map
mangling the given port rather than capping it.

We address this by aligning more closely with the CONFIG_GENERIC_IOMAP
implementation of ioport_map by using the comparison operator and
returning NULL where the port exceeds MMIO_UPPER_LIMIT. Though note that
we preserve the existing behavior of masking with IO_SPACE_LIMIT such that
we don't break existing buggy drivers that somehow rely on this masking.

Fixes: 5745392e0c ("PCI: Apply the new generic I/O management on PCI IO hosts")
Reported-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Murray <andrew.murray@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-09-14 09:49:21 +01:00
..
bitops locking/atomics, asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*() 2018-06-21 12:52:12 +02:00
4level-fixup.h
5level-fixup.h x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable 2018-02-14 13:11:14 +01:00
asm-offsets.h
asm-prototypes.h
atomic-instrumented.h locking/atomics: Instrument cmpxchg_double*() 2018-07-25 11:53:59 +02:00
atomic-long.h locking/mutex: Optimize __mutex_trylock_fast() 2018-05-04 10:02:39 +02:00
atomic.h atomics/treewide: Make unconditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
atomic64.h atomics/treewide: Make conditional inc/dec ops optional 2018-06-21 14:25:24 +02:00
audit_change_attr.h
audit_dir_write.h audit: Avoid build failures on systems without renameat 2018-01-30 19:07:54 -08:00
audit_read.h
audit_signal.h
audit_write.h
barrier.h locking/barriers: Introduce smp_cond_load_relaxed() and atomic_cond_read_relaxed() 2018-04-27 09:48:44 +02:00
bitops.h
bitsperlong.h
bug.h include/asm-generic/bug.h: clarify valid uses of WARN() 2018-08-22 10:52:46 -07:00
bugs.h
cache.h
cacheflush.h
checksum.h
cmpxchg-local.h
cmpxchg.h
compat.h time: Add an asm-generic/compat.h file 2018-04-19 13:28:51 +02:00
current.h
delay.h
device.h
div64.h
dma-contiguous.h
dma-mapping.h dma-mapping: provide a generic dma-noncoherent implementation 2018-05-19 08:46:12 +02:00
dma.h
early_ioremap.h
emergency-restart.h
error-injection.h error-injection: Add injectable error types 2018-01-12 17:33:38 -08:00
exec.h mn10300: Remove the architecture 2018-03-09 23:19:56 +01:00
export.h module: use relative references for __ksymtab entries 2018-08-22 10:52:47 -07:00
extable.h
fb.h
fixmap.h
ftrace.h
futex.h
getorder.h
gpio.h
hardirq.h
hugetlb.h
hw_irq.h
ide_iops.h
int-ll64.h int-ll64.h: define u{8,16,32,64} and s{8,16,32,64} based on uapi header 2018-06-07 17:34:38 -07:00
io.h asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO 2018-09-14 09:49:21 +01:00
ioctl.h
iomap.h
irq.h
irq_regs.h
irq_work.h
irqflags.h
kdebug.h
kmap_types.h
kprobes.h
kvm_para.h KVM: Introduce paravirtualization hints and KVM_HINTS_DEDICATED 2018-03-06 18:40:44 +01:00
linkage.h
local.h
local64.h
mcs_spinlock.h
memory_model.h
mm-arch-hooks.h
mm_hooks.h arch, mm: Allow arch_dup_mmap() to fail 2017-12-22 20:13:01 +01:00
mmu.h
mmu_context.h
module.h
msi.h
page.h
param.h
parport.h
pci.h PCI: remove PCI_DMA_BUS_IS_PHYS 2018-05-07 07:15:41 +02:00
pci_iomap.h mn10300: Remove the architecture 2018-03-09 23:19:56 +01:00
percpu.h
pgalloc.h
pgtable-nop4d-hack.h
pgtable-nop4d.h x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable 2018-02-14 13:11:14 +01:00
pgtable-nopmd.h
pgtable-nopud.h
pgtable.h mm: provide a fallback for PAGE_KERNEL_EXEC for architectures 2018-08-17 16:20:29 -07:00
preempt.h
ptrace.h
qrwlock.h
qrwlock_types.h locking/qrwlock: include asm/byteorder.h as needed 2018-02-06 10:28:58 +01:00
qspinlock.h locking/spinlocks: Clean up comment and #ifndef for {,queued_}spin_is_locked() 2018-05-15 08:11:15 +02:00
qspinlock_types.h locking/qspinlock: Fix build for anonymous union in older GCC compilers 2018-06-22 04:19:16 +02:00
resource.h
rwsem.h
seccomp.h
sections.h sections: split dereference_function_descriptor() 2018-01-09 10:45:37 +01:00
segment.h
serial.h
set_memory.h
signal.h
simd.h
sizes.h
spinlock.h
statfs.h
string.h
switch_to.h mn10300: Remove the architecture 2018-03-09 23:19:56 +01:00
syscall.h
syscalls.h
termios-base.h
termios.h
timex.h
tlb.h mm: mmu_notifier fix for tlb_end_vma 2018-08-23 11:55:58 -07:00
tlbflush.h
topology.h
trace_clock.h
uaccess.h
unaligned.h
unistd.h
user.h
vga.h
vmlinux.lds.h vmlinux.lds.h: remove stale <linux/export.h> include 2018-08-22 23:21:44 +09:00
vtime.h
word-at-a-time.h
xor.h