Re: [PATCH] x86/entry: add compatibility with IAS

From: Arvind Sankar
Date: Mon Jul 13 2020 - 18:23:29 EST


On Mon, Jul 13, 2020 at 02:38:01PM -0700, Jian Cai wrote:
> Clang's integrated assembler does not allow symbols with non-absolute
> values to be reassigned. This patch allows the affected code to be
> compatible with IAS.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1043
> Reported-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> Reported-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
> Suggested-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> Suggested-by: Brian Gerst <brgerst@xxxxxxxxx>
> Suggested-by: Arvind Sankar <nivedita@xxxxxxxxxxxx>
> Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
> Signed-off-by: Jian Cai <caij2003@xxxxxxxxx>
> ---
> arch/x86/include/asm/idtentry.h | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
> index f3d70830bf2a..7d22684eafdf 100644
> --- a/arch/x86/include/asm/idtentry.h
> +++ b/arch/x86/include/asm/idtentry.h
> @@ -469,16 +469,15 @@ __visible noinstr void func(struct pt_regs *regs, \
> .align 8
> SYM_CODE_START(irq_entries_start)
> vector=FIRST_EXTERNAL_VECTOR
> - pos = .
> .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
> +0 :
> UNWIND_HINT_IRET_REGS

I know I had it this way, but I think it may be slightly safer to put
the label immediately after UNWIND_HINT_IRET_REGS instead of before,
just in case anyone adds a 0: inside that macro.