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:   Mon, 10 Oct 2022 09:53:42 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     "Li, Xin3" <xin3.li@...el.com>
Cc:     Brian Gerst <brgerst@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "hpa@...or.com" <hpa@...or.com>
Subject: Re: [PATCH 6/6] x86/gsseg: use the LKGS instruction if available for
 load_gs_index()

On Mon, Oct 10, 2022 at 04:32:34AM +0000, Li, Xin3 wrote:
> > > > There are not that many call sites, so using something like this
> > > > (incorporating Peter Z's suggestion for the exception handler) would
> > > > be better from a code readability perspective vs. a tiny increase in code size.
> > >
> > > The existing approach patches the binary code thus we don't need to check it
> > at runtime.
> > 
> > static_cpu_has() uses alternatives to patch the branch, so there is no runtime
> > check after early boot.
> > 
> 
> Sorry, didn't know it, thanks for point it out.
> 
> If we prefer static_cpu_has, are you asking to replace all alternative macros with it?

No; the only reason to do it here would be to unconfuse that exception
thing. But even there I'm not convinced.

Yes, Brian's code is much easier to read, but code-gen is quite terrible
(also, my binutils can't seem to decode this -- GNU objdump (GNU
Binutils for Debian) 2.38.90.20220713)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ