lkml.org 
[lkml]   [2020]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [patch V4 part 5 13/31] x86/irq: Convey vector as argument and not in ptregs
    Hello

    On Mon, May 11, 2020 at 10:35 PM Thomas Gleixner <tglx@linutronix.de> wrote:
    >
    > Lai,
    >
    > Lai Jiangshan <jiangshanlai+lkml@gmail.com> writes:
    > > On Tue, May 5, 2020 at 10:23 PM Thomas Gleixner <tglx@linutronix.de> wrote:
    > >> +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)
    > >
    > > Using ".byte 0x6a, vector" is somewhat ugly.
    > >
    > > I hope it should be " pushq $(s8_to_s64(vector))", which can also
    > > help to reduce bunches of comments about ".byte 0x6a, vector".
    > >
    > > However, I don't know how to implement s8_to_s64() here.
    >
    > Neither do I.
    >
    > > But at least the following code works (generates the same two-byte
    > > machine code as ".byte 0x6a, vector" does):
    > >
    > > .if vector < 128
    > > pushq $(vector)
    > > .else
    > > pushq $(0xffffffffffffff00+vector)
    > > .endif
    >
    > Only slightly less ugly and needs as much commentry as the above.

    Agree.

    Just FYI, I tried this later, it can work.

    #define S8_TO_S64(vector) ((vector>>7)*0xffffffffffffff00+vector)

    Thanks
    Lai

    \
     
     \ /
      Last update: 2020-05-11 17:13    [W:2.419 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site