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:	Wed, 15 Nov 2006 19:43:15 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Arjan van de Ven <arjan@...radead.org>, akpm@...l.org, ak@...e.de,
	linux-kernel@...r.kernel.org, Michael.Fetterman@...cam.ac.uk,
	Ian Campbell <Ian.Campbell@...Source.com>
Subject: Re: i386 PDA patches use of %gs


* Jeremy Fitzhardinge <jeremy@...p.org> wrote:

> Ingo Molnar wrote:
> > no, that's not what it does. It measures 50000000 switches of the _same_ 
> > selector value, without using any of the selectors in the loop itself. 
> > I.e. no mixing at all! But when the kernel and userspace uses %gs, it's 
> > the cost of switching between two selector values of %gs that has to be 
> > measured. Your code does not measure that at all, AFAICS.
> >   
> I think you're misreading it.  This is the inner loop:
> 
>         for(i = 0; i < COUNT; i++) {
>                 asm volatile("push %%gs; mov %1, %%gs; addl $1, %%gs:%0; popl %%gs"
>                              : "+m" (*offset): "r" (seg) : "memory");
>                 sync();
>         }
>         return "gs";
> 
> On entry, %gs will contain the normal usermode TLS selector.  "seg" is 
> another selector allocated with set_thread_area().  The asm pushes the 
> old %gs, loads the new one, uses a memory address via the new segment, 
> then restores the previous %gs.

but it does not actually use the 'normal usermode TLS selector' - it 
only loads it.

a meaningful test would be to allocate two selector values and load and 
read+write memory through both of them.

	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