1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for the linux kernel.
8 CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
10 ifdef CONFIG_FUNCTION_TRACER
11 # Do not profile debug and lowlevel utilities
12 CFLAGS_REMOVE_tsc.o = -pg
13 CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
14 CFLAGS_REMOVE_pvclock.o = -pg
15 CFLAGS_REMOVE_kvmclock.o = -pg
16 CFLAGS_REMOVE_ftrace.o = -pg
17 CFLAGS_REMOVE_early_printk.o = -pg
18 CFLAGS_REMOVE_head64.o = -pg
19 CFLAGS_REMOVE_sev.o = -pg
22 KASAN_SANITIZE_head$(BITS).o := n
23 KASAN_SANITIZE_dumpstack.o := n
24 KASAN_SANITIZE_dumpstack_$(BITS).o := n
25 KASAN_SANITIZE_stacktrace.o := n
26 KASAN_SANITIZE_paravirt.o := n
27 KASAN_SANITIZE_sev.o := n
29 # With some compiler versions the generated code results in boot hangs, caused
30 # by several compilation units. To be safe, disable all instrumentation.
32 KMSAN_SANITIZE_head$(BITS).o := n
33 KMSAN_SANITIZE_nmi.o := n
35 # If instrumentation of this dir is enabled, boot hangs during first second.
36 # Probably could be more selective here, but note that files related to irqs,
37 # boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
38 # non-deterministic coverage.
41 CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
43 obj-y += head_$(BITS).o
44 obj-y += head$(BITS).o
46 obj-y += platform-quirks.o
47 obj-y += process_$(BITS).o signal.o signal_$(BITS).o
48 obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
49 obj-y += time.o ioport.o dumpstack.o nmi.o
50 obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o
51 obj-y += setup.o x86_init.o i8259.o irqinit.o
52 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
53 obj-$(CONFIG_IRQ_WORK) += irq_work.o
55 obj-$(CONFIG_X86_32) += sys_ia32.o
56 obj-$(CONFIG_IA32_EMULATION) += sys_ia32.o signal_32.o
57 obj-$(CONFIG_X86_64) += sys_x86_64.o
58 obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o
59 obj-$(CONFIG_SYSFS) += ksysfs.o
60 obj-y += bootflag.o e820.o
61 obj-y += pci-dma.o quirks.o topology.o kdebugfs.o
62 obj-y += alternative.o i8253.o hw_breakpoint.o
63 obj-y += tsc.o tsc_msr.o io_delay.o rtc.o
66 obj-y += static_call.o
71 obj-$(CONFIG_X86_32) += tls.o
72 obj-$(CONFIG_IA32_EMULATION) += tls.o
74 obj-$(CONFIG_INTEL_TXT) += tboot.o
75 obj-$(CONFIG_ISA_DMA_API) += i8237.o
80 obj-$(CONFIG_X86_MSR) += msr.o
81 obj-$(CONFIG_X86_CPUID) += cpuid.o
82 obj-$(CONFIG_PCI) += early-quirks.o
84 obj-$(CONFIG_APM) += apm.o
85 obj-$(CONFIG_SMP) += smp.o
86 obj-$(CONFIG_SMP) += smpboot.o
87 obj-$(CONFIG_X86_TSC) += tsc_sync.o
88 obj-$(CONFIG_SMP) += setup_percpu.o
89 obj-$(CONFIG_X86_MPPARSE) += mpparse.o
91 obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
92 obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
93 obj-$(CONFIG_FUNCTION_TRACER) += ftrace_$(BITS).o
94 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
95 obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
96 obj-$(CONFIG_X86_TSC) += trace_clock.o
97 obj-$(CONFIG_TRACING) += trace.o
98 obj-$(CONFIG_RETHOOK) += rethook.o
99 obj-$(CONFIG_CRASH_CORE) += crash_core_$(BITS).o
100 obj-$(CONFIG_KEXEC_CORE) += machine_kexec_$(BITS).o
101 obj-$(CONFIG_KEXEC_CORE) += relocate_kernel_$(BITS).o crash.o
102 obj-$(CONFIG_KEXEC_FILE) += kexec-bzimage64.o
103 obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
105 obj-$(CONFIG_MODULES) += module.o
106 obj-$(CONFIG_X86_32) += doublefault_32.o
107 obj-$(CONFIG_KGDB) += kgdb.o
108 obj-$(CONFIG_VM86) += vm86_32.o
109 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
111 obj-$(CONFIG_HPET_TIMER) += hpet.o
113 obj-$(CONFIG_AMD_NB) += amd_nb.o
114 obj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
116 obj-$(CONFIG_KVM_GUEST) += kvm.o kvmclock.o
117 obj-$(CONFIG_PARAVIRT) += paravirt.o
118 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o
119 obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock.o
120 obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o
122 obj-$(CONFIG_JAILHOUSE_GUEST) += jailhouse.o
124 obj-$(CONFIG_EISA) += eisa.o
125 obj-$(CONFIG_PCSPKR_PLATFORM) += pcspeaker.o
127 obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
129 obj-$(CONFIG_OF) += devicetree.o
130 obj-$(CONFIG_UPROBES) += uprobes.o
132 obj-$(CONFIG_PERF_EVENTS) += perf_regs.o
133 obj-$(CONFIG_TRACING) += tracepoint.o
134 obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o
135 obj-$(CONFIG_X86_UMIP) += umip.o
137 obj-$(CONFIG_UNWINDER_ORC) += unwind_orc.o
138 obj-$(CONFIG_UNWINDER_FRAME_POINTER) += unwind_frame.o
139 obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o
141 obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev.o
143 obj-$(CONFIG_CFI_CLANG) += cfi.o
145 obj-$(CONFIG_CALL_THUNKS) += callthunks.o
148 # 64 bit specific files
149 ifeq ($(CONFIG_X86_64),y)
150 obj-$(CONFIG_AUDIT) += audit_64.o
152 obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
154 obj-$(CONFIG_MMCONF_FAM10H) += mmconf-fam10h_64.o