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:   Sun, 14 Oct 2018 22:02:41 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Uros Bizjak <ubizjak@...il.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Use assembly instruction mnemonics instead of .byte
 streams in arch_hweight.h

On Sun, Oct 14, 2018 at 09:15:00PM +0200, Uros Bizjak wrote:
> The ChangeLog says "real INSTRUCTION mnemonics", e.g. POPCNTQ and POPCNTL.

Right, INSTRUCTION.

> The compiler will generate the register name with the correct implied
> width (e.g. %rax for long, %eax for int), so the assembler will be
> able to cross check if operands fit the instruction

The __arch_hweightXX functions already enforce the proper type and
the inline asm() operands already place the arguments in the proper
registers where the instruction encoding expects them.

So if you're going to relax this, then you could relax the inline asm
operand specifications too. I say you "could" because then you need to
fix arch/x86/lib/hweight.S too, which would be at least ugly. So I think
we're stuck with %xDI/xAX and %xAX as operands, where 'x' is either 'r'
or 'e'.

> And there will be a couple of ugly #defines less.

That's the only advantage of this change AFAICT. How about you reflect
that in your commit message?

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ