]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/bugs: Rename CONFIG_RETPOLINE => CONFIG_MITIGATION_RETPOLINE
authorBreno Leitao <leitao@debian.org>
Tue, 21 Nov 2023 16:07:32 +0000 (08:07 -0800)
committerIngo Molnar <mingo@kernel.org>
Wed, 10 Jan 2024 09:52:28 +0000 (10:52 +0100)
Step 5/10 of the namespace unification of CPU mitigations related Kconfig options.

[ mingo: Converted a few more uses in comments/messages as well. ]

Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ariel Miculas <amiculas@cisco.com>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20231121160740.1249350-6-leitao@debian.org
39 files changed:
Documentation/admin-guide/hw-vuln/spectre.rst
Documentation/admin-guide/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/Makefile
arch/x86/entry/vdso/Makefile
arch/x86/include/asm/disabled-features.h
arch/x86/include/asm/linkage.h
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/alternative.c
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/ftrace.c
arch/x86/kernel/kprobes/opt.c
arch/x86/kernel/vmlinux.lds.S
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/vmenter.S
arch/x86/kvm/vmx/vmx.c
arch/x86/lib/Makefile
arch/x86/net/bpf_jit_comp.c
arch/x86/net/bpf_jit_comp32.c
arch/x86/purgatory/Makefile
include/linux/compiler-gcc.h
include/linux/indirect_call_wrapper.h
include/linux/module.h
include/net/netfilter/nf_tables_core.h
include/net/tc_wrapper.h
kernel/trace/ring_buffer.c
net/netfilter/Makefile
net/netfilter/nf_tables_core.c
net/netfilter/nft_ct.c
net/netfilter/nft_lookup.c
net/sched/sch_api.c
scripts/Makefile.lib
scripts/generate_rust_target.rs
scripts/mod/modpost.c
tools/arch/x86/include/asm/disabled-features.h
tools/objtool/arch/x86/special.c
tools/objtool/check.c

index 32a8893e5617764e1a9ca1ae4e106150decf2952..cce768afec6bed11a961643dcdc2d1ae97848684 100644 (file)
@@ -473,8 +473,8 @@ Spectre variant 2
    -mindirect-branch=thunk-extern -mindirect-branch-register options.
    If the kernel is compiled with a Clang compiler, the compiler needs
    to support -mretpoline-external-thunk option.  The kernel config
-   CONFIG_RETPOLINE needs to be turned on, and the CPU needs to run with
-   the latest updated microcode.
+   CONFIG_MITIGATION_RETPOLINE needs to be turned on, and the CPU needs
+   to run with the latest updated microcode.
 
    On Intel Skylake-era systems the mitigation covers most, but not all,
    cases. See :ref:`[3] <spec_ref3>` for more details.
@@ -609,8 +609,8 @@ kernel command line.
                Selecting 'on' will, and 'auto' may, choose a
                mitigation method at run time according to the
                CPU, the available microcode, the setting of the
-               CONFIG_RETPOLINE configuration option, and the
-               compiler with which the kernel was built.
+               CONFIG_MITIGATION_RETPOLINE configuration option,
+               and the compiler with which the kernel was built.
 
                Selecting 'on' will also enable the mitigation
                against user space to user space task attacks.
index e0891ac76ab32742904cff6c3a3483fdcdd6b5c5..d93f403777f232974178fdd18cf4d2c4e309bd85 100644 (file)
                        Selecting 'on' will, and 'auto' may, choose a
                        mitigation method at run time according to the
                        CPU, the available microcode, the setting of the
-                       CONFIG_RETPOLINE configuration option, and the
-                       compiler with which the kernel was built.
+                       CONFIG_MITIGATION_RETPOLINE configuration option,
+                       and the compiler with which the kernel was built.
 
                        Selecting 'on' will also enable the mitigation
                        against user space to user space task attacks.
index a1c047004390f1e3bc767b6681f61003e1ff0438..2a3ebd679b0e1b195c9618287f812d0a768bc8e4 100644 (file)
@@ -2457,7 +2457,7 @@ config CALL_PADDING
 
 config FINEIBT
        def_bool y
-       depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE
+       depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE
        select CALL_PADDING
 
 config HAVE_CALL_THUNKS
@@ -2495,7 +2495,7 @@ config MITIGATION_PAGE_TABLE_ISOLATION
 
          See Documentation/arch/x86/pti.rst for more details.
 
-config RETPOLINE
+config MITIGATION_RETPOLINE
        bool "Avoid speculative indirect branches in kernel"
        select OBJTOOL if HAVE_OBJTOOL
        default y
@@ -2507,7 +2507,7 @@ config RETPOLINE
 
 config RETHUNK
        bool "Enable return-thunks"
-       depends on RETPOLINE && CC_HAS_RETURN_THUNK
+       depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
        select OBJTOOL if HAVE_OBJTOOL
        default y if X86_64
        help
index 1a068de12a564fe452cd5c003feb907fd3de42fd..b8d23ed059fb4cbda1b878c8a8ca9d76f527e4a5 100644 (file)
@@ -192,7 +192,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 
 # Avoid indirect branches in kernel to deal with Spectre
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
   KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
   # Additionally, avoid generating expensive indirect jumps which
   # are subject to retpolines for small number of switch cases.
@@ -301,7 +301,7 @@ vdso-install-$(CONFIG_IA32_EMULATION)       += arch/x86/entry/vdso/vdso32.so.dbg
 
 archprepare: checkbin
 checkbin:
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
 ifeq ($(RETPOLINE_CFLAGS),)
        @echo "You are building kernel with non-retpoline compiler." >&2
        @echo "Please update your compiler." >&2
index b1b8dd1608f7ebd73510cb94e2866c09aac825b6..c4df99aa16158a10a3076e87fd0785186778bf95 100644 (file)
@@ -87,7 +87,7 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
        -fno-omit-frame-pointer -foptimize-sibling-calls \
        -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
 
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
 ifneq ($(RETPOLINE_VDSO_CFLAGS),)
   CFL += $(RETPOLINE_VDSO_CFLAGS)
 endif
@@ -164,7 +164,7 @@ KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
 KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
 KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
 
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
 ifneq ($(RETPOLINE_VDSO_CFLAGS),)
   KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS)
 endif
index fb604ec95a5fa95eaf9798828417d47d98cc4460..24e4010c33b6a4e8d0e6f3acc0aba03fb1ae5594 100644 (file)
@@ -50,7 +50,7 @@
 # define DISABLE_PTI           (1 << (X86_FEATURE_PTI & 31))
 #endif
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 # define DISABLE_RETPOLINE     0
 #else
 # define DISABLE_RETPOLINE     ((1 << (X86_FEATURE_RETPOLINE & 31)) | \
index 571fe4d2d2328c3b4899faf8085e0181403ed003..c5165204c66f0aac7127fce3d3b59bfbfde5bf7e 100644 (file)
 
 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
 #define RET    jmp __x86_return_thunk
-#else /* CONFIG_RETPOLINE */
+#else /* CONFIG_MITIGATION_RETPOLINE */
 #ifdef CONFIG_SLS
 #define RET    ret; int3
 #else
 #define RET    ret
 #endif
-#endif /* CONFIG_RETPOLINE */
+#endif /* CONFIG_MITIGATION_RETPOLINE */
 
 #else /* __ASSEMBLY__ */
 
 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
 #define ASM_RET        "jmp __x86_return_thunk\n\t"
-#else /* CONFIG_RETPOLINE */
+#else /* CONFIG_MITIGATION_RETPOLINE */
 #ifdef CONFIG_SLS
 #define ASM_RET        "ret; int3\n\t"
 #else
 #define ASM_RET        "ret\n\t"
 #endif
-#endif /* CONFIG_RETPOLINE */
+#endif /* CONFIG_MITIGATION_RETPOLINE */
 
 #endif /* __ASSEMBLY__ */
 
index 59810237eb421e38f4fc82812270b5b5e9f4d030..32680cb720038b631a00073b2135eace6c7cffd8 100644 (file)
  * instruction irrespective of kCFI.
  */
 .macro JMP_NOSPEC reg:req
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        __CS_PREFIX \reg
        jmp     __x86_indirect_thunk_\reg
 #else
 .endm
 
 .macro CALL_NOSPEC reg:req
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        __CS_PREFIX \reg
        call    __x86_indirect_thunk_\reg
 #else
@@ -378,7 +378,7 @@ static inline void call_depth_return_thunk(void) {}
 
 #endif /* CONFIG_MITIGATION_CALL_DEPTH_TRACKING */
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 
 #define GEN(reg) \
        extern retpoline_thunk_t __x86_indirect_thunk_ ## reg;
@@ -399,7 +399,7 @@ static inline void call_depth_return_thunk(void) {}
 
 /*
  * Inline asm uses the %V modifier which is only in newer GCC
- * which is ensured when CONFIG_RETPOLINE is defined.
+ * which is ensured when CONFIG_MITIGATION_RETPOLINE is defined.
  */
 # define CALL_NOSPEC                                           \
        ALTERNATIVE_2(                                          \
index 55e205b2127104f5d4786795579a58069d7f228b..08c182f5a0f4d5d9ff4932edc038ccffcce164a7 100644 (file)
@@ -544,7 +544,7 @@ static inline bool is_jcc32(struct insn *insn)
        return insn->opcode.bytes[0] == 0x0f && (insn->opcode.bytes[1] & 0xf0) == 0x80;
 }
 
-#if defined(CONFIG_RETPOLINE) && defined(CONFIG_OBJTOOL)
+#if defined(CONFIG_MITIGATION_RETPOLINE) && defined(CONFIG_OBJTOOL)
 
 /*
  * CALL/JMP *%\reg
@@ -844,12 +844,12 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end)
 void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
 #endif /* CONFIG_RETHUNK */
 
-#else /* !CONFIG_RETPOLINE || !CONFIG_OBJTOOL */
+#else /* !CONFIG_MITIGATION_RETPOLINE || !CONFIG_OBJTOOL */
 
 void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) { }
 void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
 
-#endif /* CONFIG_RETPOLINE && CONFIG_OBJTOOL */
+#endif /* CONFIG_MITIGATION_RETPOLINE && CONFIG_OBJTOOL */
 
 #ifdef CONFIG_X86_KERNEL_IBT
 
index b906ed4f30916168ec16e1e664a79e37d245374a..fc46fd6447f9f340850d6f7ce6226d417fda6ac4 100644 (file)
@@ -1103,7 +1103,7 @@ static enum spectre_v2_user_mitigation spectre_v2_user_stibp __ro_after_init =
 static enum spectre_v2_user_mitigation spectre_v2_user_ibpb __ro_after_init =
        SPECTRE_V2_USER_NONE;
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 static bool spectre_v2_bad_module;
 
 bool retpoline_module_ok(bool has_retpoline)
@@ -1416,7 +1416,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
             cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC ||
             cmd == SPECTRE_V2_CMD_EIBRS_LFENCE ||
             cmd == SPECTRE_V2_CMD_EIBRS_RETPOLINE) &&
-           !IS_ENABLED(CONFIG_RETPOLINE)) {
+           !IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
                pr_err("%s selected but not compiled in. Switching to AUTO select\n",
                       mitigation_options[i].option);
                return SPECTRE_V2_CMD_AUTO;
@@ -1470,7 +1470,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
 
 static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void)
 {
-       if (!IS_ENABLED(CONFIG_RETPOLINE)) {
+       if (!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
                pr_err("Kernel not compiled with retpoline; no mitigation available!");
                return SPECTRE_V2_NONE;
        }
index 12df54ff0e817188d384affee8d98a515d6db471..93bc52d4a472da6946f45d87595ee8c163290e48 100644 (file)
@@ -307,7 +307,7 @@ union ftrace_op_code_union {
        } __attribute__((packed));
 };
 
-#define RET_SIZE               (IS_ENABLED(CONFIG_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
+#define RET_SIZE       (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
 
 static unsigned long
 create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
index 517821b48391aadf63b49d42783dd7f09f5f2bfa..36d6809c6c9e1a74d879285bd835958087c1a5ee 100644 (file)
@@ -324,7 +324,7 @@ static int can_optimize(unsigned long paddr)
                 * However, the kernel built with retpolines or IBT has jump
                 * tables disabled so the check can be skipped altogether.
                 */
-               if (!IS_ENABLED(CONFIG_RETPOLINE) &&
+               if (!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) &&
                    !IS_ENABLED(CONFIG_X86_KERNEL_IBT) &&
                    insn_is_indirect_jump(&insn))
                        return 0;
index a349dbfc6d5ab47b2f8963bacd24915a963cb2a2..bb2ec03f046d1686f95dcd40de32a1047a7727bb 100644 (file)
@@ -132,7 +132,7 @@ SECTIONS
                LOCK_TEXT
                KPROBES_TEXT
                SOFTIRQENTRY_TEXT
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
                *(.text..__x86.indirect_thunk)
                *(.text..__x86.return_thunk)
 #endif
@@ -267,7 +267,7 @@ SECTIONS
        }
 #endif
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        /*
         * List of instructions that call/jmp/jcc to retpoline thunks
         * __x86_indirect_thunk_*(). These instructions can be patched along
index 0b1f991b9a312a5177b2efa75177835b57f115e6..6fdc1cf5c33d43532522fe8411d8a04c383a4ed1 100644 (file)
@@ -263,7 +263,7 @@ static unsigned long get_guest_cr3(struct kvm_vcpu *vcpu)
 static inline unsigned long kvm_mmu_get_guest_pgd(struct kvm_vcpu *vcpu,
                                                  struct kvm_mmu *mmu)
 {
-       if (IS_ENABLED(CONFIG_RETPOLINE) && mmu->get_guest_pgd == get_guest_cr3)
+       if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && mmu->get_guest_pgd == get_guest_cr3)
                return kvm_read_cr3(vcpu);
 
        return mmu->get_guest_pgd(vcpu);
index decc1f1536694f31529f3d8c2c7cf67d1185a8c0..bf73a121c5ef14fdd758607ef8992f2deb01112e 100644 (file)
@@ -312,7 +312,7 @@ static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
        if (!prefetch)
                vcpu->stat.pf_taken++;
 
-       if (IS_ENABLED(CONFIG_RETPOLINE) && fault.is_tdp)
+       if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && fault.is_tdp)
                r = kvm_tdp_page_fault(vcpu, &fault);
        else
                r = vcpu->arch.mmu->page_fault(vcpu, &fault);
index 7fb51424fc745ebd5a4ce8399eaf780e86494542..b2751b9acf03da401e7034d0207c82c74b45ea41 100644 (file)
@@ -3455,7 +3455,7 @@ int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code)
        if (!svm_check_exit_valid(exit_code))
                return svm_handle_invalid_exit(vcpu, exit_code);
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        if (exit_code == SVM_EXIT_MSR)
                return msr_interception(vcpu);
        else if (exit_code == SVM_EXIT_VINTR)
index ef2ebabb059c8cdf2f88eb7b98682e29940e4dd8..b9e08837ab96070c5706ae97ddb9b8bd97bdb02f 100644 (file)
@@ -207,7 +207,7 @@ SYM_FUNC_START(__svm_vcpu_run)
 7:     vmload %_ASM_AX
 8:
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
        FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
 #endif
@@ -344,7 +344,7 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run)
        /* Pop @svm to RDI, guest registers have been saved already. */
        pop %_ASM_DI
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
        FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
 #endif
index e0f86f11c345416d85951b16edb24cb586b8efdc..4e1003ba380aec4cfb73943907e345b0e5e7c192 100644 (file)
@@ -6544,7 +6544,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)
 
        if (exit_reason.basic >= kvm_vmx_max_exit_handlers)
                goto unexpected_vmexit;
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        if (exit_reason.basic == EXIT_REASON_MSR_WRITE)
                return kvm_emulate_wrmsr(vcpu);
        else if (exit_reason.basic == EXIT_REASON_PREEMPTION_TIMER)
index ea3a28e7b613ccbda58490702c6609057412e4c0..72cc9c90e9f307fa0ec2d9f225c4b43548c041bc 100644 (file)
@@ -49,7 +49,7 @@ lib-$(CONFIG_ARCH_HAS_COPY_MC) += copy_mc.o copy_mc_64.o
 lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
 lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
 lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
-lib-$(CONFIG_RETPOLINE) += retpoline.o
+lib-$(CONFIG_MITIGATION_RETPOLINE) += retpoline.o
 
 obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
 obj-y += iomem.o
index 144a5839acfe5df645d378f7a70c3c9ad12f1f40..ad1396b1df25337d0607d4f227233dcbb97829dc 100644 (file)
@@ -469,7 +469,7 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip)
                        emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip);
        } else {
                EMIT2(0xFF, 0xE0 + reg);        /* jmp *%\reg */
-               if (IS_ENABLED(CONFIG_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
+               if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
                        EMIT1(0xCC);            /* int3 */
        }
 
index b18ce19981ece42e0e8ee1aee9ad6c7a8f1181ab..c10083a8e68e62df31960d724b3bc4c0baca6d06 100644 (file)
@@ -1273,7 +1273,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip)
        u8 *prog = *pprog;
        int cnt = 0;
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));
 #else
        EMIT2(0xFF, 0xE2);
index 08aa0f25f12a0fb92b7f9002740c50a1c0f2ad9d..bc31863c5ee6389419cc24250f56d4b89e8ec0e4 100644 (file)
@@ -61,7 +61,7 @@ ifdef CONFIG_STACKPROTECTOR_STRONG
 PURGATORY_CFLAGS_REMOVE                += -fstack-protector-strong
 endif
 
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
 PURGATORY_CFLAGS_REMOVE                += $(RETPOLINE_CFLAGS)
 endif
 
index 2ceba3fe4ec16718d96c874c6eeba8e863631faa..d24f29091f4b0b96db4555290da07b061ec00b12 100644 (file)
@@ -35,7 +35,7 @@
        (typeof(ptr)) (__ptr + (off));                                  \
 })
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 #define __noretpoline __attribute__((__indirect_branch__("keep")))
 #endif
 
index c1c76a70a6ce9f667fa4eeb949a5403b48e7bf6e..fe050dab55a3824b988a587a09444f69e0bbd8fa 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef _LINUX_INDIRECT_CALL_WRAPPER_H
 #define _LINUX_INDIRECT_CALL_WRAPPER_H
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 
 /*
  * INDIRECT_CALL_$NR - wrapper for indirect calls with $NR known builtin
index 9cd0009bd050ca3814c3e246e7f4701f6a2f4917..087b369e8f17861187e866c4c11498451614645b 100644 (file)
@@ -885,7 +885,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
 static inline void module_bug_cleanup(struct module *mod) {}
 #endif /* CONFIG_GENERIC_BUG */
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 extern bool retpoline_module_ok(bool has_retpoline);
 #else
 static inline bool retpoline_module_ok(bool has_retpoline)
index 780a5f6ad4a671252836e3c53d6aa7eeaa4fef4a..ff27cb2e166207cf8b58a96944d9b07a1779afe3 100644 (file)
@@ -93,7 +93,7 @@ extern const struct nft_set_type nft_set_bitmap_type;
 extern const struct nft_set_type nft_set_pipapo_type;
 extern const struct nft_set_type nft_set_pipapo_avx2_type;
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 bool nft_rhash_lookup(const struct net *net, const struct nft_set *set,
                      const u32 *key, const struct nft_set_ext **ext);
 bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set,
index a6d481b5bcbcf308cc3dc27ff5a96ec3dc9b35c4..a13ba0326d5e0f57bd7715849c6d3b67bf768612 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <net/pkt_cls.h>
 
-#if IS_ENABLED(CONFIG_RETPOLINE)
+#if IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)
 
 #include <linux/cpufeature.h>
 #include <linux/static_key.h>
index 9286f88fcd32ac329bdd9b113d2bcb995de7f39b..9cb69332921d919a7c875b8b3e6c89ecfa260a5e 100644 (file)
@@ -1156,7 +1156,7 @@ static inline u64 rb_time_stamp(struct trace_buffer *buffer)
        u64 ts;
 
        /* Skip retpolines :-( */
-       if (IS_ENABLED(CONFIG_RETPOLINE) && likely(buffer->clock == trace_clock_local))
+       if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && likely(buffer->clock == trace_clock_local))
                ts = trace_clock_local();
        else
                ts = buffer->clock();
index d4958e7e763101e0c27a32d21e456d092bcc9b61..614815a3ed73878212d3860e1d89d582f28c5d2b 100644 (file)
@@ -101,7 +101,7 @@ endif
 endif
 
 ifdef CONFIG_NFT_CT
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_MITIGATION_RETPOLINE
 nf_tables-objs += nft_ct_fast.o
 endif
 endif
index c3e635364701cf1cc544c6910c2eaddb1281bf29..a48d5f0e2f3e127564107ba87b3982ff865bff8d 100644 (file)
@@ -21,7 +21,7 @@
 #include <net/netfilter/nf_log.h>
 #include <net/netfilter/nft_meta.h>
 
-#if defined(CONFIG_RETPOLINE) && defined(CONFIG_X86)
+#if defined(CONFIG_MITIGATION_RETPOLINE) && defined(CONFIG_X86)
 
 static struct static_key_false nf_tables_skip_direct_calls;
 
@@ -207,7 +207,7 @@ static void expr_call_ops_eval(const struct nft_expr *expr,
                               struct nft_regs *regs,
                               struct nft_pktinfo *pkt)
 {
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
        unsigned long e;
 
        if (nf_skip_indirect_calls())
@@ -236,7 +236,7 @@ static void expr_call_ops_eval(const struct nft_expr *expr,
        X(e, nft_objref_map_eval);
 #undef  X
 indirect_call:
-#endif /* CONFIG_RETPOLINE */
+#endif /* CONFIG_MITIGATION_RETPOLINE */
        expr->ops->eval(expr, regs, pkt);
 }
 
index 86bb9d7797d9eeaea730e463c389a958e0b6ec85..d3e66bcb2a910e471edc437f28c9bd6968ecc715 100644 (file)
@@ -751,7 +751,7 @@ static bool nft_ct_set_reduce(struct nft_regs_track *track,
        return false;
 }
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 static const struct nft_expr_ops nft_ct_get_fast_ops = {
        .type           = &nft_ct_type,
        .size           = NFT_EXPR_SIZE(sizeof(struct nft_ct)),
@@ -796,7 +796,7 @@ nft_ct_select_ops(const struct nft_ctx *ctx,
                return ERR_PTR(-EINVAL);
 
        if (tb[NFTA_CT_DREG]) {
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
                u32 k = ntohl(nla_get_be32(tb[NFTA_CT_KEY]));
 
                switch (k) {
index 870e5b113d13ec903b00a6f7921d7c162e57418f..a0055f510e31e9b77526a11c66c565b973897706 100644 (file)
@@ -24,7 +24,7 @@ struct nft_lookup {
        struct nft_set_binding          binding;
 };
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 bool nft_set_do_lookup(const struct net *net, const struct nft_set *set,
                       const u32 *key, const struct nft_set_ext **ext)
 {
index e9eaf637220e9cfc2145f7e7cfb8194b4cf77dc2..d577c9e1cb42040e358ffb6d41250103a890dec0 100644 (file)
@@ -2353,7 +2353,7 @@ static struct pernet_operations psched_net_ops = {
        .exit = psched_net_exit,
 };
 
-#if IS_ENABLED(CONFIG_RETPOLINE)
+#if IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)
 DEFINE_STATIC_KEY_FALSE(tc_skip_wrapper);
 #endif
 
index ee233ef916968be84ff43c1c7791f95e85a0949c..615f2612a7efb5662b8a3f1cd237b06bf6dcacdb 100644 (file)
@@ -262,7 +262,7 @@ ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
 objtool-args-$(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT)         += --mnop
 endif
 objtool-args-$(CONFIG_UNWINDER_ORC)                    += --orc
-objtool-args-$(CONFIG_RETPOLINE)                       += --retpoline
+objtool-args-$(CONFIG_MITIGATION_RETPOLINE)            += --retpoline
 objtool-args-$(CONFIG_RETHUNK)                         += --rethunk
 objtool-args-$(CONFIG_SLS)                             += --sls
 objtool-args-$(CONFIG_STACK_VALIDATION)                        += --stackval
index 3c6cbe2b278d302ebd6375e900dbe4875765805f..eaf5246037964c1ac2f7cc5a94264cbeb0c7a6cd 100644 (file)
@@ -155,7 +155,7 @@ fn main() {
             "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
         );
         let mut features = "-3dnow,-3dnowa,-mmx,+soft-float".to_string();
-        if cfg.has("RETPOLINE") {
+        if cfg.has("MITIGATION_RETPOLINE") {
             features += ",+retpoline-external-thunk";
         }
         ts.push("features", features);
index cb6406f485a960041db048a5f5e8ae5bfad40bb5..72fead5f973b7dee903762e307ef357abca11a65 100644 (file)
@@ -1843,7 +1843,7 @@ static void add_header(struct buffer *b, struct module *mod)
 
        buf_printf(b,
                   "\n"
-                  "#ifdef CONFIG_RETPOLINE\n"
+                  "#ifdef CONFIG_MITIGATION_RETPOLINE\n"
                   "MODULE_INFO(retpoline, \"Y\");\n"
                   "#endif\n");
 
index fb604ec95a5fa95eaf9798828417d47d98cc4460..24e4010c33b6a4e8d0e6f3acc0aba03fb1ae5594 100644 (file)
@@ -50,7 +50,7 @@
 # define DISABLE_PTI           (1 << (X86_FEATURE_PTI & 31))
 #endif
 
-#ifdef CONFIG_RETPOLINE
+#ifdef CONFIG_MITIGATION_RETPOLINE
 # define DISABLE_RETPOLINE     0
 #else
 # define DISABLE_RETPOLINE     ((1 << (X86_FEATURE_RETPOLINE & 31)) | \
index 29e949579ede616d62c0476d0ccab36339bf02d7..4134d27c696bdce8b5ce4b49a1cd94394ae22495 100644 (file)
@@ -83,7 +83,7 @@ bool arch_support_alt_relocation(struct special_alt *special_alt,
  *    TODO: Once we have DWARF CFI and smarter instruction decoding logic,
  *    ensure the same register is used in the mov and jump instructions.
  *
- *    NOTE: RETPOLINE made it harder still to decode dynamic jumps.
+ *    NOTE: MITIGATION_RETPOLINE made it harder still to decode dynamic jumps.
  */
 struct reloc *arch_find_switch_table(struct objtool_file *file,
                                    struct instruction *insn)
index 548ec3cd7c00ca532a286eca1e6ae46b20ae0101..84067f018f7ec5fd7f62b383ac020053eb4f5f59 100644 (file)
@@ -3984,7 +3984,7 @@ static int validate_retpoline(struct objtool_file *file)
                        } else
                                continue;
                } else {
-                       WARN_INSN(insn, "indirect %s found in RETPOLINE build",
+                       WARN_INSN(insn, "indirect %s found in MITIGATION_RETPOLINE build",
                                  insn->type == INSN_JUMP_DYNAMIC ? "jump" : "call");
                }