linux-sg2042/arch/alpha/kernel
Lorenzo Pieralisi 814eae5982 alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata
The introduction of {map/swizzle}_irq() hooks in the struct pci_host_bridge
allowed to replace the pci_fixup_irqs() PCI IRQ allocation in alpha arch
PCI code with per-bridge map/swizzle functions with commit 0e4c2eeb75
("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping
hooks").

As a side effect of converting PCI IRQ allocation to the struct
pci_host_bridge {map/swizzle}_irq() hooks mechanism, the actual PCI IRQ
allocation function (ie pci_assign_irq()) is carried out per-device in
pci_device_probe() that is called when a PCI device driver is about to be
probed.

This means that, for drivers compiled as loadable modules, the actual PCI
device IRQ allocation can now happen after the system has booted so the
struct pci_host_bridge {map/swizzle}_irq() hooks pci_assign_irq() relies on
must stay valid after the system has booted so that PCI core can carry out
PCI IRQ allocation correctly.

Most of the alpha board structures pci_map_irq() and pci_swizzle() hooks
(that are used to initialize their struct pci_host_bridge equivalent
through the alpha_mv global variable - that represents the struct
alpha_machine_vector of the running kernel) are marked as
__init/__initdata; this causes freed memory dereferences when PCI IRQ
allocation is carried out after the kernel has booted (ie when loading PCI
drivers as loadable module) because when the kernel tries to bind the PCI
device to its (module) driver, the function pci_assign_irq() is called,
that in turn retrieves the struct pci_host_bridge {map/swizzle}_irq() hooks
to carry out PCI IRQ allocation; if those hooks are marked as __init
code/__initdata they point at freed/invalid memory.

Fix the issue by removing the __init/__initdata markers from all subarch
struct alpha_machine_vector.pci_map_irq()/pci_swizzle() functions (and
data).

Fixes: 0e4c2eeb75 ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Link: http://lkml.kernel.org/r/alpine.LRH.2.21.1710251043170.7098@math.ut.ee
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Meelis Roos <mroos@linux.ee>
Cc: Matt Turner <mattst88@gmail.com>
2017-10-26 11:53:38 -05:00
..
.gitignore alpha: .gitignore vmlinux.lds 2009-01-15 16:39:40 -08:00
Makefile alpha: move exports to actual definitions 2016-08-07 23:47:18 -04:00
asm-offsets.c CRED: Separate task security context from task_struct 2008-11-14 10:39:16 +11:00
audit.c alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
binfmt_loader.c get rid of pt_regs argument of ->load_binary() 2012-11-28 21:53:38 -05:00
console.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
core_apecs.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_cia.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_irongate.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
core_lca.c Fix common misspellings 2011-03-31 11:26:23 -03:00
core_marvel.c alpha: marvel: make use of raw_spinlock variants 2017-09-04 12:04:31 -07:00
core_mcpcia.c alpha: Remove set but unused variables. 2011-04-17 14:41:30 -07:00
core_polaris.c
core_t2.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_titan.c alpha: Fix build error without CONFIG_VGA_HOSE. 2017-08-29 12:01:41 -07:00
core_tsunami.c alpha: include module.h to fix modpost on Tsunami 2012-05-02 15:54:06 -04:00
core_wildfire.c
entry.S alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
err_common.c
err_ev6.c alpha: delete non-required instances of <linux/init.h> 2015-05-26 10:01:48 -07:00
err_ev7.c alpha: titan and marvel build fixes 2009-05-02 15:36:10 -07:00
err_impl.h Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
err_marvel.c Fix common misspellings 2011-03-31 11:26:23 -03:00
err_titan.c alpha: Remove set but unused variables. 2011-04-17 14:41:30 -07:00
es1888.c
gct.c
head.S Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
io.c
irq.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
irq_alpha.c alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
irq_i8259.c alpha: Convert to new irq function names 2011-03-29 14:47:58 +02:00
irq_impl.h alpha: i8259, alcor, jensen wildfire: Convert irq_chip 2011-03-02 14:57:55 -05:00
irq_pyxis.c alpha: Convert to new irq function names 2011-03-29 14:47:58 +02:00
irq_srm.c alpha: Convert to new irq function names 2011-03-29 14:47:58 +02:00
machvec_impl.h alpha: move exports to actual definitions 2016-08-07 23:47:18 -04:00
module.c alpha: support R_ALPHA_REFLONG relocations for module loading 2017-08-29 12:01:52 -07:00
osf_sys.c osf_sigstack(): switch to put_user() 2017-05-27 16:38:39 -04:00
pc873xx.c alpha: Detect Super IO chip, no IDE on Avanti, enable EPP19 2010-06-15 14:19:08 -04:00
pc873xx.h alpha: Detect Super IO chip, no IDE on Avanti, enable EPP19 2010-06-15 14:19:08 -04:00
pci-noop.c alpha: squash lines for immediate return 2017-09-04 12:04:32 -07:00
pci-sysfs.c alpha: use kobj_to_dev() 2017-09-04 12:04:33 -07:00
pci.c pci-v4.14-changes 2017-09-08 15:47:43 -07:00
pci_impl.h alpha/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:56 -07:00
pci_iommu.c treewide: Constify most dma_map_ops structures 2017-01-24 12:23:35 -05:00
perf_event.c alpha: Replace __get_cpu_var 2014-08-26 13:45:53 -04:00
process.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
proto.h alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
ptrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
rtc.c rtc: cmos: move mc146818rtc code out of asm-generic/rtc.h 2016-06-04 00:20:00 +02:00
setup.c alpha: silence a buffer overflow warning 2017-09-04 12:04:32 -07:00
signal.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
smc37c93x.c alpha: Remove set but unused variables. 2011-04-17 14:41:30 -07:00
smc37c669.c alpha: squash lines for immediate return 2017-09-04 12:04:32 -07:00
smp.c alpha: Fix section mismatches 2017-08-29 12:01:55 -07:00
srm_env.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
srmcons.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sys_alcor.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_cabriolet.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_dp264.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_eb64p.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_eiger.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_jensen.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
sys_marvel.c alpha: marvel: make use of raw_spinlock variants 2017-09-04 12:04:31 -07:00
sys_miata.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_mikasa.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_nautilus.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_noritake.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_rawhide.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_ruffian.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_rx164.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_sable.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_sio.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_sx164.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_takara.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
sys_titan.c alpha: irq: remove deprecated use of IRQF_DISABLED 2013-04-07 12:59:30 -07:00
sys_wildfire.c alpha/PCI: Move pci_map_irq()/pci_swizzle() out of initdata 2017-10-26 11:53:38 -05:00
systbls.S alpha: Update for new syscalls 2017-08-29 12:01:43 -07:00
time.c clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
traps.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2017-09-11 18:34:47 -07:00
vmlinux.lds.S nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00