lkml.org 
[lkml]   [2017]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 14/18] x86/boot/64: Stop initializing TSS.sp0 at boot
On Fri, Oct 27, 2017 at 11:21 AM, Dave Hansen <dave.hansen@intel.com> wrote:
> On 10/26/2017 01:26 AM, Andy Lutomirski wrote:
>> --- a/arch/x86/kernel/process.c
>> +++ b/arch/x86/kernel/process.c
>> @@ -48,7 +48,8 @@
>> */
>> __visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss) = {
>> .x86_tss = {
>> - .sp0 = TOP_OF_INIT_STACK,
>> + /* Initialize sp0 to a value that is definitely invalid. */
>> + .sp0 = (1UL << (BITS_PER_LONG-1)) + 1,
>
> This confused me at first: How does this not poison the init task's stack?
>
> Should the comment maybe say something like:
>
> The hardware only uses .sp0 (or sp1 or sp2 for that matter) when
> doing ring transitions. Since the init task never runs anything
> other than ring 0, it has no need for a valid value here.
> Poison it.
>
> to clarify what's going on?

Done.

\
 
 \ /
  Last update: 2017-10-28 20:22    [W:0.083 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site