kernel_optimize_test/include/asm-generic
Masahiro Yamada 62d0fd591d arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h>
As the bug report [1] pointed out, <linux/vermagic.h> must be included
after <linux/module.h>.

I believe we should not impose any include order restriction. We often
sort include directives alphabetically, but it is just coding style
convention. Technically, we can include header files in any order by
making every header self-contained.

Currently, arch-specific MODULE_ARCH_VERMAGIC is defined in
<asm/module.h>, which is not included from <linux/vermagic.h>.

Hence, the straight-forward fix-up would be as follows:

|--- a/include/linux/vermagic.h
|+++ b/include/linux/vermagic.h
|@@ -1,5 +1,6 @@
| /* SPDX-License-Identifier: GPL-2.0 */
| #include <generated/utsrelease.h>
|+#include <linux/module.h>
|
| /* Simply sanity version stamp for modules. */
| #ifdef CONFIG_SMP

This works enough, but for further cleanups, I split MODULE_ARCH_VERMAGIC
definitions into <asm/vermagic.h>.

With this, <linux/module.h> and <linux/vermagic.h> will be orthogonal,
and the location of MODULE_ARCH_VERMAGIC definitions will be consistent.

For arc and ia64, MODULE_PROC_FAMILY is only used for defining
MODULE_ARCH_VERMAGIC. I squashed it.

For hexagon, nds32, and xtensa, I removed <asm/modules.h> entirely
because they contained nothing but MODULE_ARCH_VERMAGIC definition.
Kbuild will automatically generate <asm/modules.h> at build-time,
wrapping <asm-generic/module.h>.

[1] https://lore.kernel.org/lkml/20200411155623.GA22175@zn.tnic

Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
2020-04-23 10:50:26 +09:00
..
bitops powerpc updates for 5.5 #2 2019-12-06 13:36:31 -08:00
vdso lib/vdso: Avoid highres update if clocksource is not VDSO capable 2020-02-17 20:12:17 +01:00
5level-fixup.h asm-generic/tlb: stub out p4d_free_tlb() if nop4d ... 2019-12-01 06:29:19 -08:00
asm-offsets.h
asm-prototypes.h
atomic-instrumented.h
atomic-long.h
atomic.h
atomic64.h
audit_change_attr.h
audit_dir_write.h
audit_read.h
audit_signal.h
audit_write.h
barrier.h
bitops.h asm-generic/bitops: Update stale comment 2020-03-06 11:06:19 +01:00
bitsperlong.h
bug.h
bugs.h
cache.h
cacheflush.h asm-generic/nds32: don't redefine cacheflush primitives 2019-12-30 11:18:43 +01:00
checksum.h
cmpxchg-local.h
cmpxchg.h
compat.h
current.h
delay.h
device.h
div64.h
dma-contiguous.h
dma-mapping.h
dma.h
early_ioremap.h
emergency-restart.h
error-injection.h
exec.h
export.h export.h: reduce __ksymtab_strings string duplication by using "MS" section flags 2019-12-16 10:35:33 +01:00
extable.h
fb.h
fixmap.h
flat.h
ftrace.h
futex.h generic arch_futex_atomic_op_inuser() doesn't need access_ok() 2020-03-27 23:58:55 -04:00
getorder.h
gpio.h gpio: Avoid kernel.h inclusion where it's possible 2020-02-10 12:58:36 +01:00
hardirq.h
hugetlb.h
hw_irq.h
ide_iops.h
int-ll64.h
io.h remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
ioctl.h
iomap.h remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
irq_regs.h
irq_work.h
irq.h
irqflags.h
Kbuild arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
kdebug.h
kmap_types.h
kprobes.h
kvm_para.h
linkage.h
local.h
local64.h
mcs_spinlock.h
memory_model.h
mm_hooks.h mm: remove arch_bprm_mm_init() hook 2020-01-23 10:41:16 -08:00
mm-arch-hooks.h
mmiowb_types.h
mmiowb.h
mmu_context.h
mmu.h
module.h
mshyperv.h x86/Hyper-V: Report crash data in die() when panic_on_oops is set 2020-04-11 17:19:07 +01:00
msi.h
page.h
param.h
parport.h
pci_iomap.h
pci.h
percpu.h percpu: fix __percpu annotation in asm-generic 2020-01-31 11:15:59 -08:00
pgalloc.h
pgtable_uffd.h userfaultfd: wp: add pmd_swp_*uffd_wp() helpers 2020-04-07 10:43:39 -07:00
pgtable-nop4d-hack.h
pgtable-nop4d.h asm-generic/tlb: stub out p4d_free_tlb() if nop4d ... 2019-12-01 06:29:19 -08:00
pgtable-nopmd.h asm-generic/tlb: stub out pmd_free_tlb() if nopmd 2019-12-01 06:29:19 -08:00
pgtable-nopud.h asm-generic/tlb: stub out pud_free_tlb() if nopud ... 2019-12-01 06:29:19 -08:00
pgtable.h userfaultfd: wp: add WP pagetable tracking to x86 2020-04-07 10:43:39 -07:00
preempt.h
qrwlock_types.h
qrwlock.h
qspinlock_types.h
qspinlock.h
resource.h
seccomp.h
sections.h
serial.h
set_memory.h
shmparam.h
signal.h
simd.h
spinlock.h
statfs.h
string.h
switch_to.h
syscall.h
syscalls.h
termios-base.h
termios.h
timex.h
tlb.h mm/vma: replace all remaining open encodings with is_vm_hugetlb_page() 2020-04-07 10:43:37 -07:00
tlbflush.h
topology.h
trace_clock.h
uaccess.h
unaligned.h
user.h
vermagic.h arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
vga.h
vmlinux.lds.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
vtime.h
word-at-a-time.h
xor.h