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>] [day] [month] [year] [list]
Message-ID: <1487963247.115017.10.camel@ranerica-desktop>
Date:   Fri, 24 Feb 2017 11:07:27 -0800
From:   Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To:     Nathan Howard <liverlint@...il.com>
Cc:     Joe Perches <joe@...ches.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, linux-msdos@...r.kernel.org,
        Lorenzo Stoakes <lstoakes@...il.com>,
        "Ravi V. Shankar" <ravi.v.shankar@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Adam Buchbinder <adam.buchbinder@...il.com>,
        Alexandre Julliard <julliard@...ehq.org>,
        Qiaowei Ren <qiaowei.ren@...el.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Chris Metcalf <cmetcalf@...lanox.com>, wine-devel@...ehq.org,
        Jiri Slaby <jslaby@...e.cz>, x86@...nel.org,
        Liang Z Li <liang.z.li@...el.com>,
        Stas Sergeev <stsp@...t.ru>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Andy Lutomirski <luto@...nel.org>,
        Brian Gerst <brgerst@...il.com>,
        Colin Ian King <colin.king@...onical.com>,
        Shuah Khan <shuah@...nel.org>,
        Fenghua Yu <fenghua.yu@...el.com>,
        linux-kernel@...r.kernel.org, Borislav Petkov <bp@...e.de>,
        Chen Yucong <slaoub@...il.com>, Huang Rui <ray.huang@....com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points
 to R/ESP

On Fri, 2017-02-24 at 09:47 -0500, Nathan Howard wrote:
>         Also, this code would read better with the inner test
>         reversed or done first
>         
>                         if (indx_offset < 0) {
>                                 if (indx_offset != -EDOM)
>                                         goto out_err;
>                                 indx = 0;
>                         } else {
>                                 indx = regs_get_register(etc...)
>                         }
>         
>         or
>                         if (indx_offset == -EDOM)
>                                 indx = 0;
>                         else if (indx_offset < 0)
>                                 goto err;
> 
> 
> Or goto out_err;
> 
> 
>                         else
>                                 indx = regs_get_register(etc...)
>         
>         The compiler should generate the same code in any
>         case, but either could improve reader understanding.
> 
> 
> Also, it may be a tweak more efficient to handle the most likely
> runtime case in the conditional stack first (whichever that may be).

The most likely case will be a positive value but I need to check for
negatives first :( I could wrap the first conditional in an "unlikely".

Thanks and BR,
Ricardo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ