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: <CAMuHMdXz9dYaWizBo1hxuPx_-Y40tx+TfzuTihR6BySU6a+3qw@mail.gmail.com>
Date:	Fri, 11 Jul 2014 12:19:43 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: Get rid of __HAVE_ARCH_CMPXCHG

On Fri, Jul 11, 2014 at 11:51 AM, Borislav Petkov <bp@...en8.de> wrote:
> From: Borislav Petkov <bp@...e.de>
>
> Both the 32-bit and 64-bit cmpxchg.h header define __HAVE_ARCH_CMPXCHG
> and there's ifdeffery which checks it. But since both bitness define it,
> we can just as well drop it and simpify a bit of code in doing that.
>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> ---
>  arch/x86/include/asm/cmpxchg.h     |  2 --
>  arch/x86/include/asm/cmpxchg_32.h  |  2 --
>  arch/x86/include/asm/cmpxchg_64.h  |  2 --
>  arch/x86/include/asm/mc146818rtc.h |  2 +-
>  arch/x86/include/asm/mutex_32.h    | 16 ++--------------
>  arch/x86/kernel/acpi/boot.c        |  4 ----
>  kernel/locking/rtmutex.c           |  2 +-
>  7 files changed, 4 insertions(+), 26 deletions(-)

> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -73,7 +73,7 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
>   * We can speed up the acquire/release, if the architecture
>   * supports cmpxchg and if there's no debugging state to be set up
>   */
> -#if defined(__HAVE_ARCH_CMPXCHG) && !defined(CONFIG_DEBUG_RT_MUTEXES)
> +#ifndef CONFIG_DEBUG_RT_MUTEXES
>  # define rt_mutex_cmpxchg(l,c,n)       (cmpxchg(&l->owner, c, n) == c)
>  static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
>  {

What about non-x86? __HAVE_ARCH_CMPXCHG isn't always defined.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ