xref: /linux/arch/x86/lib/Makefile (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2583d0e90SSam Ravnborg#
3583d0e90SSam Ravnborg# Makefile for x86 specific library files.
4583d0e90SSam Ravnborg#
5583d0e90SSam Ravnborg
65c9a8750SDmitry Vyukov# Produces uninteresting flaky coverage.
75c9a8750SDmitry VyukovKCOV_INSTRUMENT_delay.o	:= n
85c9a8750SDmitry Vyukov
940d04110SMarco Elver# KCSAN uses udelay for introducing watchpoint delay; avoid recursion.
1040d04110SMarco ElverKCSAN_SANITIZE_delay.o := n
11f5d2313bSMarco Elverifdef CONFIG_KCSAN
12f5d2313bSMarco Elver# In case KCSAN+lockdep+ftrace are enabled, disable ftrace for delay.o to avoid
13f5d2313bSMarco Elver# lockdep -> [other libs] -> KCSAN -> udelay -> ftrace -> lockdep recursion.
14f5d2313bSMarco ElverCFLAGS_REMOVE_delay.o = $(CC_FLAGS_FTRACE)
15f5d2313bSMarco Elverendif
1640d04110SMarco Elver
17eb13296cSMasami Hiramatsuinat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk
18eb13296cSMasami Hiramatsuinat_tables_maps = $(srctree)/arch/x86/lib/x86-opcode-map.txt
19eb13296cSMasami Hiramatsuquiet_cmd_inat_tables = GEN     $@
20172caf19SMasahiro Yamada      cmd_inat_tables = $(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@
21eb13296cSMasami Hiramatsu
22eb13296cSMasami Hiramatsu$(obj)/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
23eb13296cSMasami Hiramatsu	$(call cmd,inat_tables)
24eb13296cSMasami Hiramatsu
25eb13296cSMasami Hiramatsu$(obj)/inat.o: $(obj)/inat-tables.c
26eb13296cSMasami Hiramatsu
27eb13296cSMasami Hiramatsuclean-files := inat-tables.c
28eb13296cSMasami Hiramatsu
29a7b480e7SBorislav Petkovobj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
30583d0e90SSam Ravnborg
3199f925ceSBorislav Petkovlib-y := delay.o misc.o cmdline.o cpu.o
321ac2e6caSRobert Richterlib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
33583d0e90SSam Ravnborglib-y += memcpy_$(BITS).o
34fb6a0408SMaciej W. Rozyckilib-y += pc-conf-reg.o
35ec6347bbSDan Williamslib-$(CONFIG_ARCH_HAS_COPY_MC) += copy_mc.o copy_mc_64.o
3632542ee2SRicardo Nerilib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
37d899a7d1SThomas Garnierlib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
38540adea3SMasami Hiramatsulib-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
39aefb2f2eSBreno Leitaolib-$(CONFIG_MITIGATION_RETPOLINE) += retpoline.o
40583d0e90SSam Ravnborg
4155d1ecceSEric Biggersobj-$(CONFIG_CRC32_ARCH) += crc32-x86.o
4255d1ecceSEric Biggerscrc32-x86-y := crc32-glue.o crc32-pclmul.o
4355d1ecceSEric Biggerscrc32-x86-$(CONFIG_64BIT) += crc32c-3way.o
4455d1ecceSEric Biggers
454ffd5086SEric Biggersobj-$(CONFIG_CRC64_ARCH) += crc64-x86.o
464ffd5086SEric Biggerscrc64-x86-y := crc64-glue.o crc64-pclmul.o
474ffd5086SEric Biggers
48ed4bc981SEric Biggersobj-$(CONFIG_CRC_T10DIF_ARCH) += crc-t10dif-x86.o
49dbdda1fdSEric Biggerscrc-t10dif-x86-y := crc-t10dif-glue.o crc16-msb-pclmul.o
50ed4bc981SEric Biggers
51f5967101SBorislav Petkovobj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
52170d13caSLinus Torvaldsobj-y += iomem.o
5344f0257fSThomas Gleixner
5444f0257fSThomas Gleixnerifeq ($(CONFIG_X86_32),y)
551fde902dSIngo Molnar        obj-y += atomic64_32.o
56a7e926abSLuca Barbieri        lib-y += atomic64_cx8_32.o
57583d0e90SSam Ravnborg        lib-y += checksum_32.o
58583d0e90SSam Ravnborg        lib-y += strstr_32.o
594625cd63SJan Beulich        lib-y += string_32.o
60bce5a1e8SNick Desaulniers        lib-y += memmove_32.o
616d12c8d3SPeter Zijlstra        lib-y += cmpxchg8b_emu.o
62*909639aaSH. Peter Anvin (Intel)ifneq ($(CONFIG_X86_CX8),y)
636d12c8d3SPeter Zijlstra        lib-y += atomic64_386_32.o
6404edbdefSEric Dumazetendif
6544f0257fSThomas Gleixnerelse
66d911c67eSAlexander Potapenkoifneq ($(CONFIG_GENERIC_CSUM),y)
67583d0e90SSam Ravnborg        lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
68d911c67eSAlexander Potapenkoendif
69212be3b2SOleg Nesterov        lib-y += clear_page_64.o copy_page_64.o
70583d0e90SSam Ravnborg        lib-y += memmove_64.o memset_64.o
71034ff37dSLinus Torvalds        lib-y += copy_user_64.o copy_user_uncached_64.o
72b9ec40afSChristoph Lameter        lib-y += cmpxchg16b_emu.o
73b815f687SPeter Zijlstra        lib-y += bhi.o
7444f0257fSThomas Gleixnerendif
75