linux/arch
Cédric Le Goater b67a95f2ab powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts
The PCI INTx interrupts and other LSI interrupts are handled differently
under a sPAPR platform. When the interrupt source characteristics are
queried, the hypervisor returns an H_INT_ESB flag to inform the OS
that it should be using the H_INT_ESB hcall for interrupt management
and not loads and stores on the interrupt ESB pages.

A default -1 value is returned for the addresses of the ESB pages. The
driver ignores this condition today and performs a bogus IO mapping.
Recent changes and the DEBUG_VM configuration option make the bug
visible with :

  kernel BUG at arch/powerpc/include/asm/book3s/64/pgtable.h:612!
  Oops: Exception in kernel mode, sig: 5 [#1]
  LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=1024 NUMA pSeries
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-0.rc6.git0.1.fc32.ppc64le #1
  NIP:  c000000000f63294 LR: c000000000f62e44 CTR: 0000000000000000
  REGS: c0000000fa45f0d0 TRAP: 0700   Not tainted  (5.4.0-0.rc6.git0.1.fc32.ppc64le)
  ...
  NIP ioremap_page_range+0x4c4/0x6e0
  LR  ioremap_page_range+0x74/0x6e0
  Call Trace:
    ioremap_page_range+0x74/0x6e0 (unreliable)
    do_ioremap+0x8c/0x120
    __ioremap_caller+0x128/0x140
    ioremap+0x30/0x50
    xive_spapr_populate_irq_data+0x170/0x260
    xive_irq_domain_map+0x8c/0x170
    irq_domain_associate+0xb4/0x2d0
    irq_create_mapping+0x1e0/0x3b0
    irq_create_fwspec_mapping+0x27c/0x3e0
    irq_create_of_mapping+0x98/0xb0
    of_irq_parse_and_map_pci+0x168/0x230
    pcibios_setup_device+0x88/0x250
    pcibios_setup_bus_devices+0x54/0x100
    __of_scan_bus+0x160/0x310
    pcibios_scan_phb+0x330/0x390
    pcibios_init+0x8c/0x128
    do_one_initcall+0x60/0x2c0
    kernel_init_freeable+0x290/0x378
    kernel_init+0x2c/0x148
    ret_from_kernel_thread+0x5c/0x80

Fixes: bed81ee181 ("powerpc/xive: introduce H_INT_ESB hcall")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191203163642.2428-1-clg@kaod.org
2019-12-05 00:11:45 +11:00
..
alpha pci-v5.5-changes 2019-12-03 13:58:22 -08:00
arc pci-v5.5-changes 2019-12-03 13:58:22 -08:00
arm TTY/Serial patches for 5.5-rc1 2019-12-03 14:09:14 -08:00
arm64 pci-v5.5-changes 2019-12-03 13:58:22 -08:00
c6x dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
csky dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
h8300 h8300: Move EXCEPTION_TABLE to RO_DATA segment 2019-11-04 18:12:55 +01:00
hexagon Kbuild updates for v5.5 2019-12-02 17:35:04 -08:00
ia64 Kbuild updates for v5.5 2019-12-02 17:35:04 -08:00
m68k Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-12-01 13:26:18 -08:00
microblaze dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
mips pci-v5.5-changes 2019-12-03 13:58:22 -08:00
nds32 y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
nios2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-12-01 13:26:18 -08:00
openrisc OpenRISC updates for 5.5 2019-12-02 17:18:43 -08:00
parisc y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
powerpc powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts 2019-12-05 00:11:45 +11:00
riscv pci-v5.5-changes 2019-12-03 13:58:22 -08:00
s390 pci-v5.5-changes 2019-12-03 13:58:22 -08:00
sh - New Functionality 2019-12-01 16:13:39 -08:00
sparc pci-v5.5-changes 2019-12-03 13:58:22 -08:00
um This pull request contains the following changes for UML: 2019-12-02 17:14:02 -08:00
unicore32 generic ioremap support 2019-11-28 10:57:12 -08:00
x86 pci-v5.5-changes 2019-12-03 13:58:22 -08:00
xtensa Xtensa updates for v5.5: 2019-12-03 12:46:44 -08:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2019-12-01 20:36:41 -08:00