Re: [PATCH v2 24/39] x86/text-patching: Make text_gen_insn() IBT aware
From: Josh Poimboeuf
Date: Thu Feb 24 2022 - 19:49:51 EST
On Thu, Feb 24, 2022 at 03:52:02PM +0100, Peter Zijlstra wrote:
> + /*
> + * Hide the addresses to avoid the compiler folding in constants when
> + * referencing code, these can mess up annotations like
> + * ANNOTATE_NOENDBR.
> + */
> + OPTIMIZER_HIDE_VAR(addr);
> + OPTIMIZER_HIDE_VAR(dest);
> +
> +#ifdef CONFIG_X86_KERNEL_IBT
> + if (is_endbr(*(u32 *)dest))
> + dest += 4;
> +#endif
Another unnecessary ifdef.
--
Josh