]> git.baikalelectronics.ru Git - kernel.git/commit
x86/irq: Convey vector as argument and not in ptregs
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 May 2020 20:05:34 +0000 (22:05 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 11 Jun 2020 13:15:11 +0000 (15:15 +0200)
commitb9552f46da5fd97ab9b7c2d63affc98da26f4018
tree7a9dfe7624f2df0400408aa401bd80aca41c3f90
parentd991b3b77fbdbef5b0a1fb1921e19704132632f3
x86/irq: Convey vector as argument and not in ptregs

Device interrupts which go through do_IRQ() or the spurious interrupt
handler have their separate entry code on 64 bit for no good reason.

Both 32 and 64 bit transport the vector number through ORIG_[RE]AX in
pt_regs. Further the vector number is forced to fit into an u8 and is
complemented and offset by 0x80 so it's in the signed character
range. Otherwise GAS would expand the pushq to a 5 byte instruction for any
vector > 0x7F.

Treat the vector number like an error code and hand it to the C function as
argument. This allows to get rid of the extra entry code in a later step.

Simplify the error code push magic by implementing the pushq imm8 via a
'.byte 0x6a, vector' sequence so GAS is not able to screw it up. As the
pushq imm8 is sign extending the resulting error code needs to be truncated
to 8 bits in C code.

Originally-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20200521202118.796915981@linutronix.de
arch/x86/entry/calling.h
arch/x86/entry/entry_32.S
arch/x86/entry/entry_64.S
arch/x86/include/asm/entry_arch.h
arch/x86/include/asm/hw_irq.h
arch/x86/include/asm/idtentry.h
arch/x86/include/asm/irq.h
arch/x86/include/asm/traps.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/idt.c
arch/x86/kernel/irq.c