Re: [PATCH v5 12/15] objtool: Add support for more complex UACCESS control
From: Peter Zijlstra
Date: Thu Jan 16 2025 - 04:28:50 EST
On Wed, Jan 15, 2025 at 11:42:52PM +0100, Christophe Leroy wrote:
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 91436f4b3622..54625f09d831 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -2422,6 +2422,14 @@ static int __annotate_late(struct objtool_file *file, int type, struct instructi
> insn->dead_end = false;
> break;
>
> + case ANNOTYPE_UACCESS_BEGIN:
> + insn->type = INSN_STAC;
> + break;
> +
> + case ANNOTYPE_UACCESS_END:
> + insn->type = INSN_CLAC;
> + break;
I would feel better if this had something like:
if (insn->type != INSN_OTHER)
WARN_INSN(insn, "over-riding instruction type: %d", insn->type);
Adding these annotations to control flow instruction would be bad etc.