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]
Message-ID: <ACUA-ACHDo4PFmCPQ3ckzKr7.3.1617274177288.Hmail.zhouchuangao@vivo.com>
Date:   Thu, 1 Apr 2021 18:49:37 +0800 (GMT+08:00)
From:   周传高 <zhouchuangao@...o.com>
To:     Will Deacon <will@...nel.org>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Qais Yousef <qais.yousef@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re:Re: [PATCH] arm64/kernel/probes: Use BUG_ON instead of if condition followed by BUG.


>On Tue, Mar 30, 2021 at 04:57:50AM -0700, zhouchuangao wrote:>> It can be optimized at compile time.
>
>Hmm, I don't see it (and I also don't understand why we care). Do you have
>numbers showing that this is worthwhile?
>

#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)

BUG_ON uses unlikely in if(). Through disassembly, we can see that
brk #0x800 is compiled to the end of the function.
As you can see below:
    ......
    ffffff8008660bec:   d65f03c0    ret
    ffffff8008660bf0:   d4210000    brk #0x800

Usually, the condition in if () is not satisfied. For the multi-stage pipeline, 
we do not need to perform fetch decode and excute operation on brk 
instruction.

In my opinion, this can improve the efficiency of the multi-stage pipeline.

zhouchuangao

>Will


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ