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]
Date:	Thu, 22 Feb 2007 00:20:17 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Davide Libenzi <davidel@...ilserver.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Arjan van de Ven <arjan@...radead.org>,
	Christoph Hellwig <hch@...radead.org>,
	Andrew Morton <akpm@....com.au>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Ulrich Drepper <drepper@...hat.com>,
	Zach Brown <zach.brown@...cle.com>,
	Evgeniy Polyakov <johnpol@....mipt.ru>,
	"David S. Miller" <davem@...emloft.net>,
	Suparna Bhattacharya <suparna@...ibm.com>,
	Jens Axboe <jens.axboe@...cle.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 08/13] syslets: x86, add move_user_context() method


* Davide Libenzi <davidel@...ilserver.org> wrote:

> On Wed, 21 Feb 2007, Ingo Molnar wrote:
> 
> > From: Ingo Molnar <mingo@...e.hu>
> > 
> > add the move_user_context() method to move the user-space
> > context of one kernel thread to another kernel thread.
> > User-space might notice the changed TID, but execution,
> > stack and register contents (general purpose and FPU) are
> > still the same.
> 
> Also signal handling should/must be maintained, on top of TID. You 
> don't want the user to be presented with a different signal handling 
> after an sys_async_exec call.

right now CLONE_SIGNAL and CLONE_SIGHAND is used for new async threads, 
so they should inherit and share all the signal settings.

one area that definitely needs more work is that the ptrace parent (if 
any) should probably follow the 'head' context. gdb at the moment copes 
surprisingly well, but some artifacts are visible every now and then.

> > +	*new_regs = *old_regs;
> > +	/*
> > +	 * Flip around the FPU state too:
> > +	 */
> > +	tmp = new_task->thread.i387;
> > +	new_task->thread.i387 = old_task->thread.i387;
> > +	old_task->thread.i387 = tmp;
> > +}
> 
> This is not going to work in this case (already posted twice in other 
> emails):

i'm really sorry - i still have a huge email backlog.

> So NTSK loads a non up2date FPUo, instead of the FPUc that was the 
> "dirty" context to migrate (since TS_USEDFPU was set). I think you 
> need an early __unlazy_fpu() in that case, that would turn the above 
> into:

yes. My plan is to to avoid all these problems by having a 
special-purpose sched_yield_to(old_task, new_task) function.

this, besides being even faster than the default scheduler (because the 
runqueue balance does not change so no real scheduling decision has to 
be done - the true scheduling decisions happen later on at async-wakeup 
time), should also avoid all the FPU races: the FPU just gets flipped 
between old_task and new_task (and TS_USEDFPU needs to be moved as well, 
etc.). No intermediate task can come inbetween.

can you see a hole in this sched_yield_to() method as well?

	Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ