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, 10 Mar 2021 10:14:35 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     hpa@...or.com
Cc:     Steven Rostedt <rostedt@...dmis.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: The killing of ideal_nops[]

On Tue, Mar 09, 2021 at 04:33:45PM -0800, hpa@...or.com wrote:
> On March 9, 2021 1:24:44 PM PST, Peter Zijlstra <peterz@...radead.org> wrote:
> >On Tue, Mar 09, 2021 at 12:05:19PM -0500, Steven Rostedt wrote:
> >> On Tue, 9 Mar 2021 17:58:17 +0100
> >> Peter Zijlstra <peterz@...radead.org> wrote:
> >> 
> >> > Hi,
> >> > 
> >> > AFAICT everything made in the past 10 years ends up using p6_nops.
> >Is it
> >> > time to kill off ideal_nops[] and simplify life?
> >> > 
> >> 
> >> Well, the one bug that was reported recently was due to a box that
> >uses a
> >> different "ideal_nops" than p6_nops. Perhaps we should ask him if
> >there's
> >> any noticeable difference between using p6_nops for every function
> >than the
> >> ideal_nops that as found for that box.
> >
> >If the machine is more than a decade old, I'm not really caring about
> >optimal performance. If it is 32bit, I really couldn't be arsed as long
> >as it boots.
> 
> p6_nops don't boot on all 32-bit chips.

Sure, but we can have one set on 32bit and another set on 64bit.

$ cat nops.s
.section .text
nop1: .nops 1
nop2: .nops 2
nop3: .nops 3
nop4: .nops 4
nop5: .nops 5
nop6: .nops 6
nop7: .nops 7
nop8: .nops 8

$ as --32 nops.s -o nops.o ; objdump -wd nops.o

nops.o:     file format elf32-i386


Disassembly of section .text:

00000000 <nop1>:
0:   90                      nop

00000001 <nop2>:
1:   66 90                   xchg   %ax,%ax

00000003 <nop3>:
3:   8d 76 00                lea    0x0(%esi),%esi

00000006 <nop4>:
6:   8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi

0000000a <nop5>:
a:   8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi
e:   90                      nop

0000000f <nop6>:
f:   8d b6 00 00 00 00       lea    0x0(%esi),%esi

00000015 <nop7>:
15:   8d b4 26 00 00 00 00    lea    0x0(%esi,%eiz,1),%esi

0000001c <nop8>:
1c:   8d b4 26 00 00 00 00    lea    0x0(%esi,%eiz,1),%esi
23:   90                      nop

$ as --64 nops.s -o nops.o ; objdump -wd nops.o

nops.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <nop1>:
0:   90                      nop

0000000000000001 <nop2>:
1:   66 90                   xchg   %ax,%ax

0000000000000003 <nop3>:
3:   0f 1f 00                nopl   (%rax)

0000000000000006 <nop4>:
6:   0f 1f 40 00             nopl   0x0(%rax)

000000000000000a <nop5>:
a:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

000000000000000f <nop6>:
f:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

0000000000000015 <nop7>:
15:   0f 1f 80 00 00 00 00    nopl   0x0(%rax)

000000000000001c <nop8>:
1c:   0f 1f 84 00 00 00 00 00         nopl   0x0(%rax,%rax,1)


---

Although I would use DS prefix nops for 32bit nop5/nop8 to keep them
single instructions.

Then we can do away with runtime nop selection and special atomic nops
and simplify things.

All this runtime faffing about nops is tedious and causes complications
we can do without.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ