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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <401dbbe1-096c-8af5-4e21-e355e602272e@roeck-us.net>
Date:   Wed, 10 Feb 2021 07:05:40 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Waiman Long <longman@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Chris Zankel <chris@...kel.net>,
        Max Filippov <jcmvbkbc@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mips@...r.kernel.org, linux-xtensa@...ux-xtensa.org,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        Ben Gardon <bgardon@...gle.com>
Subject: Re: [PATCH] locking/arch: Move qrwlock.h include after qspinlock.h

On 2/10/21 6:45 AM, Waiman Long wrote:
> The queued rwlock code has a dependency on the current spinlock
> implementation (likely to be qspinlock), but not vice versa. Including
> qrwlock.h before qspinlock.h can be problematic when expanding qrwlock
> functionality.
> 
> If both qspinlock.h and qrwlock.h are to be included, the qrwlock.h
> include should always be after qspinlock.h. Update the current set of
> asm/spinlock.h files to enforce that.
> 
> Signed-off-by: Waiman Long <longman@...hat.com>

There should be a Fixes: tag here. If the SHA of the offending commit is not
stable, there should be a better reference than "The queued rwlock code".

This patch fixes the build problem I had observed on mips. I also tested
xtensa:defconfig and arm64:defconfig with no problems observed.

Tested-by: Guenter Roeck <linux@...ck-us.net>

Guenter

> ---
>  arch/arm64/include/asm/spinlock.h  | 2 +-
>  arch/mips/include/asm/spinlock.h   | 2 +-
>  arch/xtensa/include/asm/spinlock.h | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h
> index 9083d6992603..0525c0b089ed 100644
> --- a/arch/arm64/include/asm/spinlock.h
> +++ b/arch/arm64/include/asm/spinlock.h
> @@ -5,8 +5,8 @@
>  #ifndef __ASM_SPINLOCK_H
>  #define __ASM_SPINLOCK_H
>  
> -#include <asm/qrwlock.h>
>  #include <asm/qspinlock.h>
> +#include <asm/qrwlock.h>
>  
>  /* See include/linux/spinlock.h */
>  #define smp_mb__after_spinlock()	smp_mb()
> diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
> index 8a88eb265516..6ce2117e49f6 100644
> --- a/arch/mips/include/asm/spinlock.h
> +++ b/arch/mips/include/asm/spinlock.h
> @@ -10,7 +10,6 @@
>  #define _ASM_SPINLOCK_H
>  
>  #include <asm/processor.h>
> -#include <asm/qrwlock.h>
>  
>  #include <asm-generic/qspinlock_types.h>
>  
> @@ -27,5 +26,6 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
>  }
>  
>  #include <asm/qspinlock.h>
> +#include <asm/qrwlock.h>
>  
>  #endif /* _ASM_SPINLOCK_H */
> diff --git a/arch/xtensa/include/asm/spinlock.h b/arch/xtensa/include/asm/spinlock.h
> index 584b0de6f2ca..41c449ece2d8 100644
> --- a/arch/xtensa/include/asm/spinlock.h
> +++ b/arch/xtensa/include/asm/spinlock.h
> @@ -12,8 +12,8 @@
>  #define _XTENSA_SPINLOCK_H
>  
>  #include <asm/barrier.h>
> -#include <asm/qrwlock.h>
>  #include <asm/qspinlock.h>
> +#include <asm/qrwlock.h>
>  
>  #define smp_mb__after_spinlock()	smp_mb()
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ