Re: [RFC PATCH v3 1/6] x86/entry/64: move PUSH_AND_CLEAR_REGS from interrupt macro to helper function

From: Linus Torvalds
Date: Tue Feb 20 2018 - 17:25:10 EST


On Tue, Feb 20, 2018 at 1:01 PM, Dominik Brodowski
<linux@xxxxxxxxxxxxxxxxxxxx> wrote:
> +ENTRY(interrupt_entry)
> + UNWIND_HINT_FUNC
> +
> + PUSH_AND_CLEAR_REGS save_ret=1
> + ENCODE_FRAME_POINTER 8
> +
> + ret
> +END(interrupt_entry)

There's nothing wrong with this patch, but it does expose what a nasty
hack our "ENCODE_FRAME_POINTER" thing is.

It generates (when there is an offset, like this):

leaq \ptregs_offset(%rsp), %rbp
orq $0x1, %rbp

and I would _really_ hope that the stack pointer is always aligned on
interrupt entry, so I don't see why it's not just

leaq 1+\ptregs_offset(%rsp), %rbp

instead.

I dunno. Let's ask Josh what the reason for the separate "or" was.

But this is an independent issue of this patch, really.

Linus