]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
x86: Don't include linux/irq.h from asm/hardirq.h
authorNicolai Stange <nstange@suse.de>
Sun, 29 Jul 2018 10:15:33 +0000 (12:15 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 8 Aug 2018 12:08:07 +0000 (14:08 +0200)
The next patch in this series will have to make the definition of
irq_cpustat_t available to entering_irq().

Inclusion of asm/hardirq.h into asm/apic.h would cause circular header
dependencies like

  asm/smp.h
    asm/apic.h
      asm/hardirq.h
        linux/irq.h
          linux/topology.h
            linux/smp.h
              asm/smp.h

or

  linux/gfp.h
    linux/mmzone.h
      asm/mmzone.h
        asm/mmzone_64.h
          asm/smp.h
            asm/apic.h
              asm/hardirq.h
                linux/irq.h
                  linux/irqdesc.h
                    linux/kobject.h
                      linux/sysfs.h
                        linux/kernfs.h
                          linux/idr.h
                            linux/gfp.h

and others.

This causes compilation errors because of the header guards becoming
effective in the second inclusion: symbols/macros that had been defined
before wouldn't be available to intermediate headers in the #include chain
anymore.

A possible workaround would be to move the definition of irq_cpustat_t
into its own header and include that from both, asm/hardirq.h and
asm/apic.h.

However, this wouldn't solve the real problem, namely asm/harirq.h
unnecessarily pulling in all the linux/irq.h cruft: nothing in
asm/hardirq.h itself requires it. Also, note that there are some other
archs, like e.g. arm64, which don't have that #include in their
asm/hardirq.h.

Remove the linux/irq.h #include from x86' asm/hardirq.h.

Fix resulting compilation errors by adding appropriate #includes to *.c
files as needed.

Note that some of these *.c files could be cleaned up a bit wrt. to their
set of #includes, but that should better be done from separate patches, if
at all.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
CVE-2018-3620
CVE-2018-3646

[tyhicks: Adjust context in smpboot.c, add asm/sections.h include in
 kprobes/core.c, i915_pmu.c doesn't exist in 4.15,
 controller/pci-hyperv.c is host/pci-hyperv.c in 4.15]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 files changed:
arch/x86/include/asm/dmi.h
arch/x86/include/asm/hardirq.h
arch/x86/include/asm/kvm_host.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/msi.c
arch/x86/kernel/apic/vector.c
arch/x86/kernel/fpu/core.c
arch/x86/kernel/hpet.c
arch/x86/kernel/i8259.c
arch/x86/kernel/idt.c
arch/x86/kernel/irq.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c
arch/x86/kernel/irqinit.c
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/time.c
arch/x86/mm/pti.c
arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c
arch/x86/xen/enlighten.c
drivers/gpu/drm/i915/intel_lpe_audio.c
drivers/pci/host/pci-hyperv.c

index 0ab2ab27ad1fb59993fb651f69f49df50e857ff9..b825cb201251654f7a085b0b612a0b574979fa2b 100644 (file)
@@ -4,8 +4,8 @@
 
 #include <linux/compiler.h>
 #include <linux/init.h>
+#include <linux/io.h>
 
-#include <asm/io.h>
 #include <asm/setup.h>
 
 static __always_inline __init void *dmi_alloc(unsigned len)
index 261ef5d8c181dffca66c1a0853b3d682d145d55b..486c843273c46fe6c102fdce5997d8d9ed211a80 100644 (file)
@@ -3,7 +3,6 @@
 #define _ASM_X86_HARDIRQ_H
 
 #include <linux/threads.h>
-#include <linux/irq.h>
 
 typedef struct {
        u16          __softirq_pending;
index 41f60f753c437b73b933e7219401d77b30cf097e..19725e707eb9a1a7ebe3ccf5638d45ac1726ae22 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/tracepoint.h>
 #include <linux/cpumask.h>
 #include <linux/irq_work.h>
+#include <linux/irq.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
index 4a215b6e41f63e05d4767dbeb0453397d6014c0b..c56ddeea2bec79b30f02ff8c22e40878873fc622 100644 (file)
@@ -56,6 +56,7 @@
 #include <asm/hypervisor.h>
 #include <asm/cpu_device_id.h>
 #include <asm/intel-family.h>
+#include <asm/irq_regs.h>
 
 unsigned int num_processors;
 
index 93d5f55cd8b67731d663a03b9956bf20c8c8a5d8..5daeebab0517781be8ecf3c6162d1830571a4d48 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
index ce503c99f5c4cd67fddb5fafdda7e3e64b8e7690..72a94401f9e03487f37dea32f762afe524db0578 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/dmar.h>
 #include <linux/hpet.h>
index bb6f7a2148d7781f64836a14f6f9884bd7955740..3e915da2c0c9c7a82c97d7acfbd75532b5493344 100644 (file)
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/compiler.h>
index f92a6593de1ec651d244d43d16acbd8d49959e4b..2ea85b32421a02d5f3f8e6643757610576841e3c 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/fpu/signal.h>
 #include <asm/fpu/types.h>
 #include <asm/traps.h>
+#include <asm/irq_regs.h>
 
 #include <linux/hardirq.h>
 #include <linux/pkeys.h>
index 8ce4212e2b8d0f139e543e05e7e284ee25ee856d..afa1a204bc6d69029a2520725b174ba201dd7cd7 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/export.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
index 86c4439f9d74963b7d9317e6a487ed0d7c085765..519649ddf1001d423c5b0a7e02a42f7ca92e2a06 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/timex.h>
 #include <linux/random.h>
 #include <linux/init.h>
index 2c3a1b4294eb40d202b4e14435cf3682b9f34d5e..7f6cffaa5322936b951952b0a5b3044fe704866c 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/traps.h>
 #include <asm/proto.h>
 #include <asm/desc.h>
+#include <asm/hw_irq.h>
 
 struct idt_data {
        unsigned int    vector;
index 68e1867cca8045d0ed728ffc6b75a866c25484ed..92411e5809fb169468b9d63bd8a379af7b64d2e6 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/ftrace.h>
 #include <linux/delay.h>
 #include <linux/export.h>
+#include <linux/irq.h>
 
 #include <asm/apic.h>
 #include <asm/io_apic.h>
index c1bdbd3d3232cb83d07bfa4ce604ae0b620c796a..95600a99ae93652dbbd4143c9e538e808911bb24 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/kernel_stat.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
index d86e344f5b3debfed504b72a7c0f83f36fe16387..0469cd078db15c0c26700fc7a50f9c3f8144ff2a 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/kernel_stat.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/delay.h>
 #include <linux/ftrace.h>
index a539410c4ea9946993d4db7408a2ccf7b1ca746a..749e878a013e345a5d155e13a3b4954dc32abd73 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/timex.h>
 #include <linux/random.h>
 #include <linux/kprobes.h>
index 0715f827607c4a2742e140f8d9a656ed4514d226..7d24ece21e3d73322720d2e039cd416af0bbcab4 100644 (file)
@@ -63,6 +63,7 @@
 #include <asm/insn.h>
 #include <asm/debugreg.h>
 #include <asm/set_memory.h>
+#include <asm/sections.h>
 
 #include "common.h"
 
index 2459c42ab1fd8a8cd4be462d3dec8fa8970ad45f..4708ce67463d45c0a51fdcd7732a9fde808e0919 100644 (file)
@@ -79,6 +79,7 @@
 #include <asm/misc.h>
 #include <asm/qspinlock.h>
 #include <asm/spec-ctrl.h>
+#include <asm/hw_irq.h>
 
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map);
index 749d189f8cd4675de3267310e38217a8082c0485..40a1f3e25d749a5c8471977fda0fa16180e2eb4f 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/i8253.h>
 #include <linux/time.h>
 #include <linux/export.h>
index ce38f165489b5a13d92091c8671879f30ce44e20..d6f11accd37a0590a7eb3ff22a8aa4ecedb7670b 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/desc.h>
+#include <asm/sections.h>
 
 #undef pr_fmt
 #define pr_fmt(fmt)     "Kernel/User page tables isolation: " fmt
index 4f5fa65a10110344aa3d763fdf5b73a5d6652c0b..2acd6be133755872bad09e920fc0db1cb4911d2d 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/intel-mid.h>
 #include <asm/intel_scu_ipc.h>
 #include <asm/io_apic.h>
+#include <asm/hw_irq.h>
 
 #define TANGIER_EXT_TIMER0_MSI 12
 
index c9081c6671f0b7a05ecfaaf206e7e1ed2b1f456a..df208af3cd749415c67aa270adb5f225a3d42b37 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 #include <linux/cpu.h>
 #include <linux/kexec.h>
+#include <linux/slab.h>
 
 #include <xen/features.h>
 #include <xen/page.h>
index b6db221c007e1d1e0c0dccdd5925aa622c05662c..4c77ab38065253642d9d25338e62ccd7454ccaa3 100644 (file)
@@ -62,6 +62,7 @@
 
 #include <linux/acpi.h>
 #include <linux/device.h>
+#include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 
index f7d36c03486c220a901374b3f122e4289e67e359..573f1b64adf4a9ec77e7c992420498e496295441 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/irqdomain.h>
 #include <asm/irqdomain.h>
 #include <asm/apic.h>
+#include <linux/irq.h>
 #include <linux/msi.h>
 #include <linux/hyperv.h>
 #include <linux/refcount.h>