[PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-18 Thread Joerg Roedel
From: Joerg Roedel We want x86_tss.sp0 point to the entry stack later to use it as a trampoline stack for other kernel entry points besides SYSENTER. So store the task stack pointer in x86_tss.sp1, which is otherwise unused by the hardware, as Linux doesn't make use of Ring 1. Signed-off-by:

[PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-18 Thread Joerg Roedel
From: Joerg Roedel We want x86_tss.sp0 point to the entry stack later to use it as a trampoline stack for other kernel entry points besides SYSENTER. So store the task stack pointer in x86_tss.sp1, which is otherwise unused by the hardware, as Linux doesn't make use of Ring 1. Signed-off-by:

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-17 Thread Andy Lutomirski
On Tue, Jul 17, 2018 at 12:05 AM, Joerg Roedel wrote: > On Fri, Jul 13, 2018 at 04:17:40PM -0700, Andy Lutomirski wrote: >> I re-read it again. How about keeping TSS_entry_stack but making it >> be the offset from the TSS to the entry stack. Then do the arithmetic >> in asm. > > Hmm, I think

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-17 Thread Andy Lutomirski
On Tue, Jul 17, 2018 at 12:05 AM, Joerg Roedel wrote: > On Fri, Jul 13, 2018 at 04:17:40PM -0700, Andy Lutomirski wrote: >> I re-read it again. How about keeping TSS_entry_stack but making it >> be the offset from the TSS to the entry stack. Then do the arithmetic >> in asm. > > Hmm, I think

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-17 Thread Joerg Roedel
On Fri, Jul 13, 2018 at 04:17:40PM -0700, Andy Lutomirski wrote: > I re-read it again. How about keeping TSS_entry_stack but making it > be the offset from the TSS to the entry stack. Then do the arithmetic > in asm. Hmm, I think its better to keep the arithmetic in the C file for better

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-17 Thread Joerg Roedel
On Fri, Jul 13, 2018 at 04:17:40PM -0700, Andy Lutomirski wrote: > I re-read it again. How about keeping TSS_entry_stack but making it > be the offset from the TSS to the entry stack. Then do the arithmetic > in asm. Hmm, I think its better to keep the arithmetic in the C file for better

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Andy Lutomirski
On Fri, Jul 13, 2018 at 10:19 AM, Andy Lutomirski wrote: > On Fri, Jul 13, 2018 at 2:48 AM, Joerg Roedel wrote: >> On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: >>> > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: >>> >/* Offset from the sysenter stack to tss.sp0 */ >>>

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Andy Lutomirski
On Fri, Jul 13, 2018 at 10:19 AM, Andy Lutomirski wrote: > On Fri, Jul 13, 2018 at 2:48 AM, Joerg Roedel wrote: >> On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: >>> > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: >>> >/* Offset from the sysenter stack to tss.sp0 */ >>>

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Andy Lutomirski
On Fri, Jul 13, 2018 at 2:48 AM, Joerg Roedel wrote: > On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: >> > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: >> >/* Offset from the sysenter stack to tss.sp0 */ >> > -DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area,

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Andy Lutomirski
On Fri, Jul 13, 2018 at 2:48 AM, Joerg Roedel wrote: > On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: >> > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: >> >/* Offset from the sysenter stack to tss.sp0 */ >> > -DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area,

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Joerg Roedel
On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: > > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: > >/* Offset from the sysenter stack to tss.sp0 */ > > -DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area, > > tss.x86_tss.sp0) - > > +DEFINE(TSS_entry_stack,

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-13 Thread Joerg Roedel
On Thu, Jul 12, 2018 at 01:49:13PM -0700, Andy Lutomirski wrote: > > On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: > >/* Offset from the sysenter stack to tss.sp0 */ > > -DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area, > > tss.x86_tss.sp0) - > > +DEFINE(TSS_entry_stack,

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-12 Thread Andy Lutomirski
> On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: > > From: Joerg Roedel > We want x86_tss.sp0 point to the entry stack later to use > it as a trampoline stack for other kernel entry points > besides SYSENTER. Makes sense: sp0 will be the entry stack. But: > > >/* Offset from the

Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-12 Thread Andy Lutomirski
> On Jul 11, 2018, at 4:29 AM, Joerg Roedel wrote: > > From: Joerg Roedel > We want x86_tss.sp0 point to the entry stack later to use > it as a trampoline stack for other kernel entry points > besides SYSENTER. Makes sense: sp0 will be the entry stack. But: > > >/* Offset from the

[PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-11 Thread Joerg Roedel
From: Joerg Roedel We want x86_tss.sp0 point to the entry stack later to use it as a trampoline stack for other kernel entry points besides SYSENTER. So store the task stack pointer in x86_tss.sp1, which is otherwise unused by the hardware, as Linux doesn't make use of Ring 1. Signed-off-by:

[PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

2018-07-11 Thread Joerg Roedel
From: Joerg Roedel We want x86_tss.sp0 point to the entry stack later to use it as a trampoline stack for other kernel entry points besides SYSENTER. So store the task stack pointer in x86_tss.sp1, which is otherwise unused by the hardware, as Linux doesn't make use of Ring 1. Signed-off-by: