lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c78d1f91-b99a-bdf4-ebec-f0aca9c40e8a@c-s.fr>
Date:   Wed, 3 Oct 2018 11:30:29 +0200
From:   Christophe LEROY <christophe.leroy@....fr>
To:     Nicholas Piggin <npiggin@...il.com>
Cc:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        aneesh.kumar@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [RFC PATCH v3 4/7] powerpc: regain entire stack space



Le 03/10/2018 à 09:07, Nicholas Piggin a écrit :
> On Wed, 3 Oct 2018 08:45:25 +0200
> Christophe LEROY <christophe.leroy@....fr> wrote:
> 
>> Le 03/10/2018 à 08:30, Nicholas Piggin a écrit :
>>> On Wed, 3 Oct 2018 07:52:59 +0200
>>> Christophe LEROY <christophe.leroy@....fr> wrote:
>>>    
>>>> Le 03/10/2018 à 07:34, Nicholas Piggin a écrit :
>>>>> On Mon,  1 Oct 2018 12:30:25 +0000 (UTC)
>>>>> Christophe Leroy <christophe.leroy@....fr> wrote:
>>>>>       
>>>>>> thread_info is not anymore in the stack, so the entire stack
>>>>>> can now be used.
>>>>>
>>>>> Nice.
>>>>>       
>>>>>>
>>>>>> In the meantime, all pointers to the stacks are not anymore
>>>>>> pointers to thread_info so this patch changes them to void*
>>>>>
>>>>> Wasn't this previously effectively already the case with patch
>>>>> 3/7? You had thread_info sized space left there, but it was not
>>>>> used or initialized right? Does it make sense to move this part
>>>>> of it to the previous patch?
>>>>
>>>> Not really.
>>>>
>>>> In 3/7 I changed the prototypes of two functions that really used the
>>>> pointer as a task pointer only.
>>
>> I meant 2/7 here sorry.
>>
>>>>
>>>> Here it change things that before 4/7 were really used as both stack
>>>> pointers and thread_info pointers.
>>
>> And here I meant 3/7
>>
>>>
>>> What uses it as a thread_info pointer? It seems more like a stack
>>> with some amount of unused space in it but that's all.
>>
>> Before 3/7, we have
>>
>> void do_softirq_own_stack(void)
>> {
>> 	struct thread_info *curtp, *irqtp;
>>
>> 	curtp = current_thread_info();
>> 	irqtp = softirq_ctx[smp_processor_id()];
>> 	irqtp->task = curtp->task;
>> 	irqtp->flags = 0;
>> 	call_do_softirq(irqtp);
>> 	irqtp->task = NULL;
>>
>> 	/* Set any flag that may have been set on the
>> 	 * alternate stack
>> 	 */
>> 	if (irqtp->flags)
>> 		set_bits(irqtp->flags, &curtp->flags);
>> }
>>
>> After 3/7, we have
>>
>>    void do_softirq_own_stack(void)
>>    {
>> 	struct thread_info *irqtp;
>>
>>    	irqtp = softirq_ctx[smp_processor_id()];
>>    	call_do_softirq(irqtp);
>>    }
>>
>>
>> So now only we can change irqtp to void* can't we ?
> 
> In patch 3 we can, right? That's what I mean by moving from
> thread_info * to void * in patch 3 rather than 4.

Ah ok, that's what you meant. Sorry.

> 
> But if you prefer not to, it's fine. Maybe it keeps patch 3
> a little smaller.

Yes indeed, that's the idea, keep patch 3 to the strict minimum and do 
cleanups afterwards.

Christophe

> 
> Thanks,
> Nick
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ