lkml.org 
[lkml]   [2020]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch V6 19/37] x86/irq: Convey vector as argument and not in ptregs
Date
Andy Lutomirski <luto@kernel.org> writes:
> On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> + .align 8
>> +SYM_CODE_START(irq_entries_start)
>> + vector=FIRST_EXTERNAL_VECTOR
>> + .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
>> + UNWIND_HINT_IRET_REGS
>> + .byte 0x6a, vector
>> + jmp common_interrupt
>> + .align 8
>> + vector=vector+1
>> + .endr
>> +SYM_CODE_END(irq_entries_start)
>
> Having battled code like this in the past (for early exceptions), I
> prefer the variant like:
>
> pos = .;
> .rept blah blah blah
> .byte whatever
> jmp whatever
> . = pos + 8;
> vector = vector + 1
> .endr
>
> or maybe:
>
> .rept blah blah blah
> .byte whatever
> jmp whatever;
> . = irq_entries_start + 8 * vector;
> vector = vector + 1
> .endr
>
> The reason is that these variants will fail to assemble if something
> goes wrong and the code expands to more than 8 bytes, whereas using
> .align will cause gas to happily emit 16 bytes and result in
> hard-to-debug mayhem.

Yes. They just make objtool very unhappy:

arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0xfd0: special:
can't find orig instruction

Peter suggested to use:

.pos = .
.byte..
jmp
.nops (pos + 8) - .

That works ...

\
 
 \ /
  Last update: 2020-05-21 15:24    [W:0.131 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site