android_kernel_oneplus_msm8998/arch/x86/kernel
Rui Wang 699a6cc7dd x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
commit 9d98bcec731756b8688b59ec998707924d716d7b upstream.

On a 4-socket Brickland system, hot-removing one ioapic is fine.
Hot-removing the 2nd one causes panic in mp_unregister_ioapic()
while calling release_resource().

It is because the iomem_res pointer has already been released
when removing the first ioapic.

To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do:

	struct resource *r = ioapic_resources;

        for_each_ioapic(i) {
                insert_resource(&iomem_resource, r);
                r++;
        }

Here 'r' is treated as an arry of 'struct resource', and the r++ ensures
that each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].

Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 12:06:09 +01:00
..
acpi x86/acpi: Reduce code duplication in mp_override_legacy_irq() 2018-01-17 09:35:26 +01:00
apic x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() 2018-01-31 12:06:09 +01:00
cpu drivers: base: cacheinfo: fix x86 with CONFIG_OF enabled 2018-01-31 12:06:08 +01:00
fpu x86/fpu: Don't let userspace set bogus xcomp_bv 2017-10-05 09:41:47 +02:00
kprobes kprobes/x86: Disable optimizing on the function jumps to indirect thunk 2018-01-23 19:50:17 +01:00
.gitignore
alternative.c x86/alternatives: Fix optimize_nops() checking 2018-01-17 09:35:33 +01:00
amd_gart_64.c
amd_nb.c x86/amd_nb: Fix boot crash on non-AMD systems 2016-07-27 09:47:29 -07:00
apb_timer.c x86/asm/tsc: Rename native_read_tsc() to rdtsc() 2015-07-06 15:23:28 +02:00
aperture_64.c
apm_32.c apm32: Fix cputime == jiffies assumption 2015-07-29 15:44:58 +02:00
asm-offsets.c Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-03 21:05:40 -08:00
asm-offsets_32.c
asm-offsets_64.c x86/asm/entry: (Re-)rename __NR_entry_INT80_compat_max to __NR_syscall_compat_max 2015-06-08 23:43:38 +02:00
audit_64.c
bootflag.c x86: don't use module_init for non-modular core bootflag code 2015-06-16 14:12:34 -04:00
check.c Linux 4.2-rc8 2015-08-25 09:59:19 +02:00
cpuid.c x86: Drop bogus __ref / __refdata annotations 2015-07-20 18:57:20 +02:00
crash.c x86/kexec: Remove obsolete 'in_crash_kexec' flag 2015-10-12 09:43:11 +02:00
crash_dump_32.c
crash_dump_64.c
devicetree.c Replace module_init with equivalent device_initcall in non modules. 2015-07-02 10:30:48 -07:00
doublefault.c
dumpstack.c
dumpstack_32.c
dumpstack_64.c
e820.c x86/e820: Don't merge consecutive E820_PRAM ranges 2016-10-28 03:01:33 -04:00
early-quirks.c drm/i915: Account for TSEG size when determining 865G stolen base 2016-10-31 04:13:58 -06:00
early_printk.c x86/early_printk: Set __iomem address space for IO 2015-10-13 21:45:56 +02:00
espfix_64.c kaiser: add "nokaiser" boot option, using ALTERNATIVE 2018-01-05 15:44:25 +01:00
ftrace.c ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram 2017-05-02 21:19:56 -07:00
head.c
head32.c
head64.c x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y 2017-03-22 12:04:18 +01:00
head_32.S x86/traps: Ignore high word of regs->cs in early_fixup_exception() 2016-12-08 07:15:24 +01:00
head_64.S KPTI: Rename to PAGE_TABLE_ISOLATION 2018-01-05 15:44:26 +01:00
hpet.c x86/hpet: Prevent might sleep splat on resume 2017-12-16 10:33:51 +01:00
hw_breakpoint.c perf/x86/hw_breakpoints: Fix check for kernel-space breakpoints 2015-08-04 10:16:55 +02:00
i386_ksyms_32.c preempt: Use preempt_schedule_context() as the official tracing preemption point 2015-06-07 15:57:42 +02:00
i8237.c
i8253.c clockevents/drivers/i8253: Migrate to new 'set-state' interface 2015-08-10 11:40:30 +02:00
i8259.c x86/irq: Probe for PIC presence before allocating descs for legacy IRQs 2015-11-07 10:37:37 +01:00
io_delay.c
ioport.c x86/iopl: Fix iopl capability check on Xen PV 2016-04-12 09:08:38 -07:00
irq.c x86/irq: Do not substract irq_tlb_count from irq_call_count 2017-12-25 14:22:09 +01:00
irq_32.c x86/retpoline/irq32: Convert assembler indirect jumps 2018-01-23 19:50:13 +01:00
irq_64.c x86/irq: Drop unlikely before IS_ERR_OR_NULL 2015-10-01 11:08:56 +02:00
irq_work.c treewide: Remove old email address 2015-11-23 09:44:58 +01:00
irqinit.c KAISER: Kernel Address Isolation 2018-01-05 15:44:23 +01:00
jump_label.c jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2015-08-03 11:34:12 +02:00
kdebugfs.c
kexec-bzimage64.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2015-09-08 12:41:25 -07:00
kgdb.c x86/kgdb: Replace bool_int_array[NR_CPUS] with bitmap 2015-09-28 10:13:31 +02:00
ksysfs.c
kvm.c KVM: async_pf: make rcu irq exit if not triggered from idle task 2017-08-11 09:08:47 -07:00
kvmclock.c x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap 2018-01-05 15:44:27 +01:00
ldt.c kaiser: fix unlikely error in alloc_ldt_struct() 2018-01-05 15:44:25 +01:00
livepatch.c livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX 2015-11-06 11:10:03 +01:00
machine_kexec_32.c
machine_kexec_64.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching 2015-06-23 14:07:26 -07:00
Makefile kexec: split kexec_load syscall from kexec core code 2015-09-10 13:29:01 -07:00
mcount_64.S x86/retpoline/ftrace: Convert ftrace assembler indirect jumps 2018-01-23 19:50:13 +01:00
mmconf-fam10h_64.c
module.c
mpparse.c
msr.c
nmi.c Merge branch 'x86/urgent' into x86/asm, before applying dependent patches 2015-07-31 10:23:35 +02:00
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c x86/paravirt: Do not trace _paravirt_ident_*() functions 2016-09-24 10:07:37 +02:00
paravirt_patch_32.c x86/asm/tsc, x86/paravirt: Remove read_tsc() and read_tscp() paravirt hooks 2015-07-06 15:23:26 +02:00
paravirt_patch_64.c x86/paravirt: Dont patch flush_tlb_single 2018-01-05 15:44:26 +01:00
pci-calgary_64.c x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 2017-05-14 13:32:55 +02:00
pci-dma.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
pci-iommu_table.c
pci-nommu.c
pci-swiotlb.c x86/swiotlb: Try coherent allocations with __GFP_NOWARN 2015-06-11 08:28:38 +02:00
pcspeaker.c
perf_regs.c
pmem.c libnvdimm, e820: skip module loading when no type-12 2015-11-30 09:10:33 -08:00
probe_roms.c
process.c KAISER: Kernel Address Isolation 2018-01-05 15:44:23 +01:00
process_32.c sched/core, sched/x86: Kill thread_info::saved_preempt_count 2015-10-06 17:08:18 +02:00
process_64.c x86/iopl/64: Properly context-switch IOPL on Xen PV 2016-04-12 09:08:38 -07:00
ptrace.c x86/dumpstack: Fix x86_32 kernel_stack_pointer() previous stack access 2016-10-16 17:36:15 +02:00
pvclock.c pvclock: Add CPU barriers to get correct version value 2016-08-10 11:49:27 +02:00
quirks.c timers/x86/hpet: Type adjustments 2015-10-21 11:17:32 +02:00
reboot.c x86/mm/64: Fix reboot interaction with CR4.PCIDE 2018-01-02 20:33:24 +01:00
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
resource.c
rtc.c x86/paravirt: Prevent rtc_cmos platform device init on PV guests 2015-12-19 21:35:13 +01:00
setup.c x86/kaiser: Move feature detection up 2018-01-05 15:44:26 +01:00
setup_percpu.c
signal.c x86/signal: Fix restart_syscall number for x32 tasks 2015-12-05 18:52:14 +01:00
signal_compat.c x86/compat: Move copy_siginfo_*_user32() to signal_compat.c 2015-07-06 15:28:55 +02:00
smp.c x86/mce: Clear Local MCE opt-in before kexec 2015-08-13 10:12:52 +02:00
smpboot.c x86/smpboot: Remove stale TLB flush invocations 2018-01-02 20:33:28 +01:00
stacktrace.c
step.c Merge branch 'x86/urgent' into x86/asm to fix up conflicts and to pick up fixes 2015-08-18 09:39:47 +02:00
sys_x86_64.c mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
sysfb.c
sysfb_efi.c x86/sysfb_efi: Fix valid BAR address range check 2016-05-11 11:21:20 +02:00
sysfb_simplefb.c
tboot.c
tce_64.c
test_nx.c
test_rodata.c
time.c
tls.c
tls.h
topology.c x86: Drop bogus __ref / __refdata annotations 2015-07-20 18:57:20 +02:00
trace_clock.c x86/asm/tsc: Add rdtsc_ordered() and use it in trivial call sites 2015-07-06 15:23:29 +02:00
tracepoint.c kaiser: merged update 2018-01-05 15:44:23 +01:00
traps.c x86/asm: Use register variable to get stack pointer value 2018-01-23 19:50:11 +01:00
tsc.c perf/x86: Fix time_shift in perf_event_mmap_page 2015-10-20 10:30:52 +02:00
tsc_msr.c x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO 2016-05-11 11:21:19 +02:00
tsc_sync.c x86/asm/tsc/sync: Use rdtsc_ordered() in check_tsc_warp() and drop extra barriers 2015-07-06 15:23:29 +02:00
uprobes.c uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions 2016-09-07 08:32:36 +02:00
verify_cpu.S x86/cpu: Call verify_cpu() after having entered long mode too 2015-11-07 10:45:02 +01:00
vm86_32.c x86/vm86/32: Switch to flush_tlb_mm_range() in mark_screen_rdonly() 2018-01-02 20:33:23 +01:00
vmlinux.lds.S retpoline: Introduce start/end markers of indirect thunk 2018-01-23 19:50:17 +01:00
vsmp_64.c x86: replace __init_or_module with __init in non-modular vsmp_64.c 2015-06-16 14:12:41 -04:00
x86_init.c PCI changes for the v4.2 merge window: 2015-06-23 13:41:24 -07:00
x8664_ksyms_64.c preempt: Use preempt_schedule_context() as the official tracing preemption point 2015-06-07 15:57:42 +02:00