Re: [PATCHv2 2/4] x86_64: embrace KERNEL_STACK_OFFSET

From: Alexander van Heukelum
Date: Wed Jan 21 2015 - 11:29:25 EST


On Wed, Jan 21, 2015, at 14:44, Denys Vlasenko wrote:
> On Sun, Jan 18, 2015 at 12:45 PM, Alexander van Heukelum
> <heukelum@xxxxxxxxxxx> wrote:
> > KERNEL_STACK_OFFSET is the offset from the top of the kernel stack
> > page to the value of the kernel_stack percpu variable. This patch
> > changes KERNEL_STACK_OFFSET to configure a reserved space of 16
> > bytes above the user ptregs frame. KERNEL_STACK_OFFSET must be
> > set to a multiple of 16 bytes due to the automatic stack alignment
> > of interrupts, traps, and exceptions on x86_64.
>
> I propose to set kernel_stack percpu variable to point
> to the top of kernel stack (obvious, isn't it?)
> and eliminate KERNEL_STACK_OFFSET altogether.

By "top of kernel stack", do you mean the page boundary or the
top of struct pt_regs on the kernel stack? (is it really that obvious?)
I think Borislav did the latter for x86_64 in his patchset.

Eliminating KERNEL_STACK_OFFSET was what I did in my first
attempt, and I broke i386 by not thinking through what x86 common
code was really doing :).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/