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:	Fri, 22 Sep 2006 15:24:48 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Rusty Russell <rusty@...tcorp.com.au>
CC:	Andi Kleen <ak@....de>,
	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
	virtualization <virtualization@...ts.osdl.org>
Subject: Re: [PATCH 2/7]

Rusty Russell wrote:
> This patch implements save/restore of %gs in the kernel, so it can be
> used for per-cpu data.  This is not cheap, and we do it for UP as well
> as SMP, which is stupid.  Benchmarks, anyone?
>   
I measured the cost as adding 9 cycles to a null syscall on my Core Duo 
machine.  I have not explicitly measured it on other machines, but I run 
a number of other segment save/load tests on a wide range of machines, 
and didn't find much variability.

I think saving/restoring %gs will still be necessary. There are a number 
of places in the kernel which expect to find the usermode %gs on the 
kernel stack frame, including context switch, ptrace, vm86, signal 
context, and maybe something else.  If you don't save it on the stack, 
then you need to have UP variations of %gs handling in all those other 
places, which is pretty messy.  Also, unless you want to have two 
definitions of struct_pt regs (which would add even more mess into 
ptrace), you'd still need to sub/add %esp in entry.S to skip over the 
%gs hole.  I don't think this UP microoptimisation would be worth enough 
to justify the mess it would cause elsewhere.

How does this version of the patch differ from mine?  Is it just my 
patch+Ingo's fix, or are there other changes?  I couldn't see anything 
from a quick read-over.

    J
-
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