On Sun, Jul 12, 2020 at 9:26 PM Jian Cai <caij2...@gmail.com> 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 <ndesaulni...@google.com> > Reported-by: Sedat Dilek <sedat.di...@gmail.com> > Suggested-by: Nick Desaulniers <ndesaulni...@google.com> > Tested-by: Sedat Dilek <sedat.di...@gmail.com> > Signed-off-by: Jian Cai <caij2...@gmail.com> > --- > arch/x86/include/asm/idtentry.h | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h > index f3d70830bf2a..77beed2cd6d9 100644 > --- a/arch/x86/include/asm/idtentry.h > +++ b/arch/x86/include/asm/idtentry.h > @@ -468,34 +468,32 @@ __visible noinstr void func(struct pt_regs *regs, > \ > */ > .align 8 > SYM_CODE_START(irq_entries_start) > - vector=FIRST_EXTERNAL_VECTOR > - pos = . > + i = 1
Start with index 0. > + pos1 = . pos1 is unnecessary, as it's equal to irq_entries_start. > .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) > UNWIND_HINT_IRET_REGS > - .byte 0x6a, vector > + .byte 0x6a, FIRST_EXTERNAL_VECTOR + i - 1 > jmp asm_common_interrupt > nop > /* Ensure that the above is 8 bytes max */ > - . = pos + 8 > - pos=pos+8 > - vector=vector+1 > + . = pos1 + 8 * i > + i = i + 1 If you swap these two lines then the index will be correct for the next stub if you start at 0.. > .endr > SYM_CODE_END(irq_entries_start) > > #ifdef CONFIG_X86_LOCAL_APIC > .align 8 > SYM_CODE_START(spurious_entries_start) > - vector=FIRST_SYSTEM_VECTOR > - pos = . > + i = 1 > + pos2 = . > .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR) > UNWIND_HINT_IRET_REGS > - .byte 0x6a, vector > + .byte 0x6a, FIRST_SYSTEM_VECTOR + i - 1 > jmp asm_spurious_interrupt > nop > /* Ensure that the above is 8 bytes max */ > - . = pos + 8 > - pos=pos+8 > - vector=vector+1 > + . = pos2 + 8 * i > + i = i + 1 > .endr > SYM_CODE_END(spurious_entries_start) > #endif -- Brian Gerst