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, 1 Oct 2018 12:28:03 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Uros Bizjak <ubizjak@...il.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH resend] x86, asm: Use CC_SET()/CC_OUT() for
 __cmpxchg_double

On Fri, Sep 28, 2018 at 10:33:05AM +0200, Uros Bizjak wrote:
> Remove open-coded uses of set instructions to use CC_SET()/CC_OUT()
> for __cmpxchg_double.
> 
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> ---
>  arch/x86/include/asm/cmpxchg.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
> index a55d79b233d3..bfb85e5844ab 100644
> --- a/arch/x86/include/asm/cmpxchg.h
> +++ b/arch/x86/include/asm/cmpxchg.h
> @@ -242,10 +242,12 @@ extern void __add_wrong_size(void)
>         BUILD_BUG_ON(sizeof(*(p2)) != sizeof(long));                    \
>         VM_BUG_ON((unsigned long)(p1) % (2 * sizeof(long)));            \
>         VM_BUG_ON((unsigned long)((p1) + 1) != (unsigned long)(p2));    \
> -       asm volatile(pfx "cmpxchg%c4b %2; sete %0"                      \
> -                    : "=a" (__ret), "+d" (__old2),                     \
> -                      "+m" (*(p1)), "+m" (*(p2))                       \
> -                    : "i" (2 * sizeof(long)), "a" (__old1),            \
> +       asm volatile(pfx "cmpxchg%c5b %1"                               \
> +                    CC_SET(e)                                          \
> +                    : CC_OUT(e) (__ret),                               \
> +                      "+m" (*(p1)), "+m" (*(p2)),                      \
> +                      "+a" (__old1), "+d" (__old2)                     \
> +                    : "i" (2 * sizeof(long)),                          \

To quote checkpatch:

WARNING: please, no spaces at the start of a line
#34: FILE: arch/x86/include/asm/cmpxchg.h:245:
+       asm volatile(pfx "cmpxchg%c5b %1"                               \$

ERROR: code indent should use tabs where possible
#35: FILE: arch/x86/include/asm/cmpxchg.h:246:
+                    CC_SET(e)                                          \$

WARNING: please, no spaces at the start of a line
#35: FILE: arch/x86/include/asm/cmpxchg.h:246:
+                    CC_SET(e)                                          \$

ERROR: code indent should use tabs where possible
#36: FILE: arch/x86/include/asm/cmpxchg.h:247:
+                    : CC_OUT(e) (__ret),                               \$


...

-- 
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