[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3be26a9-a0ed-fc6c-f25c-3fd41e718292@oracle.com>
Date: Fri, 22 May 2020 14:48:53 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Andy Lutomirski <luto@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Frederic Weisbecker <frederic@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Joel Fernandes <joel@...lfernandes.org>,
Juergen Gross <jgross@...e.com>,
Brian Gerst <brgerst@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Will Deacon <will@...nel.org>,
Tom Lendacky <thomas.lendacky@....com>,
Wei Liu <wei.liu@...nel.org>,
Michael Kelley <mikelley@...rosoft.com>,
Jason Chen CJ <jason.cj.chen@...el.com>,
Zhao Yakui <yakui.zhao@...el.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: Re: [patch V6 19/37] x86/irq: Convey vector as argument and not in
ptregs
On 5/21/20 9:22 AM, Thomas Gleixner wrote:
> Andy Lutomirski <luto@...nel.org> writes:
>> On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner <tglx@...utronix.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) - .
Unfortunately this (.nops directive) only works for newer assemblers
(2.31, per
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gas/NEWS;h=9a3f352108e439754688e19e63a6235b38801182;hb=5eb617a71463fa6810cd14f57adfe7a1efc93a96)
I have 2.27 and things don't go well.
-boris
>
> That works ...
Powered by blists - more mailing lists