Rework of the X86 irq stack handling:

  The irq stack switching was moved out of the ASM entry code in course of
  the entry code consolidation. It ended up being suboptimal in various
  ways.

  - Make the stack switching inline so the stackpointer manipulation is not
    longer at an easy to find place.

  - Get rid of the unnecessary indirect call.

  - Avoid the double stack switching in interrupt return and reuse the
    interrupt stack for softirq handling.

  - A objtool fix for CONFIG_FRAME_POINTER=y builds where it got confused
    about the stack pointer manipulation.
objtool: Fix stack-swizzle for FRAME_POINTER=y

When objtool encounters the stack-swizzle:

	mov %rsp, (%[tos])
	mov %[tos], %rsp
	...
	pop %rsp

Inside a FRAME_POINTER=y build, things go a little screwy because
clearly we're not adjusting the cfa->base. This then results in the
pop %rsp not being detected as a restore of cfa->base so it will turn
into a regular POP and offset the stack, resulting in:

  kernel/softirq.o: warning: objtool: do_softirq()+0xdb: return with modified stack frame

Therefore, have "mov %[tos], %rsp" act like a PUSH (it sorta is
anyway) to balance the things out. We're not too concerned with the
actual stack_size for frame-pointer builds, since we don't generate
ORC data for them anyway.

Fixes: aafeb14e9da2 ("objtool: Support stack-swizzle")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/YC6UC+rc9KKmQrkd@hirez.programming.kicks-ass.net
1 file changed