[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <429FD204-476B-4F5B-B007-A444F6562E79@amacapital.net>
Date: Thu, 2 Nov 2017 11:32:38 +0100
From: Andy Lutomirski <luto@...capital.net>
To: Ingo Molnar <mingo@...nel.org>
Cc: Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
Borislav Petkov <bpetkov@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v2 13/20] x86/asm/64: Pass sp0 directly to load_sp0()
> On Nov 2, 2017, at 10:48 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
>
> * Andy Lutomirski <luto@...nel.org> wrote:
>
>> load_sp0() had an odd signature:
>>
>> void load_sp0(struct tss_struct *tss, struct thread_struct *thread);
>>
>> Simplify it to:
>>
>> void load_sp0(unsigned long sp0);
>
> I also added this to the changelog:
>
>> Also simplify a few get_cpu()/put_cpu() sequences to
>> preempt_disable()/preempt_enable().
>
> Plus:
>
>> --- a/arch/x86/kernel/cpu/common.c
>> +++ b/arch/x86/kernel/cpu/common.c
>> @@ -1572,7 +1572,7 @@ void cpu_init(void)
>> initialize_tlbstate_and_flush();
>> enter_lazy_tlb(&init_mm, me);
>>
>> - load_sp0(t, ¤t->thread);
>> + load_sp0(current->thread.sp0);
>> set_tss_desc(cpu, t);
>> load_TR_desc();
>> load_mm_ldt(&init_mm);
>> @@ -1627,7 +1627,7 @@ void cpu_init(void)
>> initialize_tlbstate_and_flush();
>> enter_lazy_tlb(&init_mm, curr);
>>
>> - load_sp0(t, thread);
>> + load_sp0(thread->sp0);
>> set_tss_desc(cpu, t);
>> load_TR_desc();
>> load_mm_ldt(&init_mm);
>
> In the 32-bit path this was the last use of 'thread', making the local variable
> unused - I removed it.
>
> Just curious: did you build/boot-test 32-bit kernels, or should we consider it
> mostly untested?
I tested it in an earlier version, but I'm away from my real computer, so I haven't tested as well as I should. It should be run through at least the selftests on 32-bit, 64-bit, and Xen PV.
>
> Thanks,
>
> Ingo
Powered by blists - more mailing lists