mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@mips.com>
To: Paul Burton <pburton@wavecomp.com>
Cc: "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	Huacai Chen <chenhc@lemote.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Paul Burton <pburton@wavecomp.com>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>
Subject: Re: [PATCH v2 00/36] MIPS: barriers & atomics cleanups
Date: Mon, 7 Oct 2019 17:51:28 +0000	[thread overview]
Message-ID: <MWHPR2201MB1277091F2B297F9B47063E41C19B0@MWHPR2201MB1277.namprd22.prod.outlook.com> (raw)
In-Reply-To: <20191001215249.4157062-1-paul.burton@mips.com>

Hello,

Paul Burton wrote:
> This series consists of a bunch of cleanups to the way we handle memory
> barriers (though no changes to the sync instructions we use to implement
> them) & atomic memory accesses. One major goal was to ensure the
> Loongson3 LL/SC errata workarounds are applied in a safe manner from
> within inline-asm & that we can automatically verify the resulting
> kernel binary looks reasonable. Many patches are cleanups found along
> the way.
> 
> Applies atop v5.4-rc1.
> 
> Changes in v2:
> - Keep our fls/ffs implementations. Turns out GCC's builtins call
>   intrinsics in some configurations, and if we'd need to go implement
>   those then using the generic fls/ffs doesn't seem like such a win.
> - De-string __WEAK_LLSC_MB to allow use with __SYNC_ELSE().
> - Only try to build the loongson3-llsc-check tool from
>   arch/mips/Makefile when CONFIG_CPU_LOONGSON3_WORKAROUNDS is enabled.
> 
> Paul Burton (36):
>   MIPS: Unify sc beqz definition
>   MIPS: Use compact branch for LL/SC loops on MIPSr6+
>   MIPS: barrier: Add __SYNC() infrastructure
>   MIPS: barrier: Clean up rmb() & wmb() definitions
>   MIPS: barrier: Clean up __smp_mb() definition
>   MIPS: barrier: Remove fast_mb() Octeon #ifdef'ery
>   MIPS: barrier: Clean up __sync() definition
>   MIPS: barrier: Clean up sync_ginv()
>   MIPS: atomic: Fix whitespace in ATOMIC_OP macros
>   MIPS: atomic: Handle !kernel_uses_llsc first
>   MIPS: atomic: Use one macro to generate 32b & 64b functions
>   MIPS: atomic: Emit Loongson3 sync workarounds within asm
>   MIPS: atomic: Use _atomic barriers in atomic_sub_if_positive()
>   MIPS: atomic: Unify 32b & 64b sub_if_positive
>   MIPS: atomic: Deduplicate 32b & 64b read, set, xchg, cmpxchg
>   MIPS: bitops: Handle !kernel_uses_llsc first
>   MIPS: bitops: Only use ins for bit 16 or higher
>   MIPS: bitops: Use MIPS_ISA_REV, not #ifdefs
>   MIPS: bitops: ins start position is always an immediate
>   MIPS: bitops: Implement test_and_set_bit() in terms of _lock variant
>   MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit
>   MIPS: bitops: Use the BIT() macro
>   MIPS: bitops: Avoid redundant zero-comparison for non-LLSC
>   MIPS: bitops: Abstract LL/SC loops
>   MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG
>   MIPS: bitops: Emit Loongson3 sync workarounds within asm
>   MIPS: bitops: Use smp_mb__before_atomic in test_* ops
>   MIPS: cmpxchg: Emit Loongson3 sync workarounds within asm
>   MIPS: cmpxchg: Omit redundant barriers for Loongson3
>   MIPS: futex: Emit Loongson3 sync workarounds within asm
>   MIPS: syscall: Emit Loongson3 sync workarounds within asm
>   MIPS: barrier: Remove loongson_llsc_mb()
>   MIPS: barrier: Make __smp_mb__before_atomic() a no-op for Loongson3
>   MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler
>   MIPS: genex: Don't reload address unnecessarily
>   MIPS: Check Loongson3 LL/SC errata workaround correctness
> 
>  arch/mips/Makefile                     |   3 +
>  arch/mips/Makefile.postlink            |  10 +-

Series applied to mips-next.

> MIPS: Unify sc beqz definition
>   commit 878f75c7a253
>   https://git.kernel.org/mips/c/878f75c7a253
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: Use compact branch for LL/SC loops on MIPSr6+
>   commit ef85d057a605
>   https://git.kernel.org/mips/c/ef85d057a605
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Add __SYNC() infrastructure
>   commit bf92927251b3
>   https://git.kernel.org/mips/c/bf92927251b3
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Clean up rmb() & wmb() definitions
>   commit 21e3134b3ec0
>   https://git.kernel.org/mips/c/21e3134b3ec0
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Clean up __smp_mb() definition
>   commit 05e6da742b5b
>   https://git.kernel.org/mips/c/05e6da742b5b
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Remove fast_mb() Octeon #ifdef'ery
>   commit 5c12a6eff6ae
>   https://git.kernel.org/mips/c/5c12a6eff6ae
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Clean up __sync() definition
>   commit fe0065e56227
>   https://git.kernel.org/mips/c/fe0065e56227
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Clean up sync_ginv()
>   commit 185d7d7a5819
>   https://git.kernel.org/mips/c/185d7d7a5819
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Fix whitespace in ATOMIC_OP macros
>   commit 36d3295c5a0d
>   https://git.kernel.org/mips/c/36d3295c5a0d
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Handle !kernel_uses_llsc first
>   commit 9537db24c65a
>   https://git.kernel.org/mips/c/9537db24c65a
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Use one macro to generate 32b & 64b functions
>   commit a38ee6bb14a4
>   https://git.kernel.org/mips/c/a38ee6bb14a4
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Emit Loongson3 sync workarounds within asm
>   commit 4d1dbfe6cbec
>   https://git.kernel.org/mips/c/4d1dbfe6cbec
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Use _atomic barriers in atomic_sub_if_positive()
>   commit 77d281b7966e
>   https://git.kernel.org/mips/c/77d281b7966e
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Unify 32b & 64b sub_if_positive
>   commit 40e784b4d4bc
>   https://git.kernel.org/mips/c/40e784b4d4bc
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: atomic: Deduplicate 32b & 64b read, set, xchg, cmpxchg
>   commit 1da7bce8591d
>   https://git.kernel.org/mips/c/1da7bce8591d
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Handle !kernel_uses_llsc first
>   commit fe7cd97e68fa
>   https://git.kernel.org/mips/c/fe7cd97e68fa
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Only use ins for bit 16 or higher
>   commit 3d2920cf4fd4
>   https://git.kernel.org/mips/c/3d2920cf4fd4
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Use MIPS_ISA_REV, not #ifdefs
>   commit 59361e9975fd
>   https://git.kernel.org/mips/c/59361e9975fd
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: ins start position is always an immediate
>   commit 27aab27259ae
>   https://git.kernel.org/mips/c/27aab27259ae
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Implement test_and_set_bit() in terms of _lock variant
>   commit 6bbe043bd3f4
>   https://git.kernel.org/mips/c/6bbe043bd3f4
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit
>   commit a2e66b862cc7
>   https://git.kernel.org/mips/c/a2e66b862cc7
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Use the BIT() macro
>   commit d6103510e7cc
>   https://git.kernel.org/mips/c/d6103510e7cc
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Avoid redundant zero-comparison for non-LLSC
>   commit aad028cadb17
>   https://git.kernel.org/mips/c/aad028cadb17
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Abstract LL/SC loops
>   commit cc99987c375e
>   https://git.kernel.org/mips/c/cc99987c375e
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG
>   commit c042be02d730
>   https://git.kernel.org/mips/c/c042be02d730
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Emit Loongson3 sync workarounds within asm
>   commit 5bb29275df7a
>   https://git.kernel.org/mips/c/5bb29275df7a
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: bitops: Use smp_mb__before_atomic in test_* ops
>   commit 9026737703ae
>   https://git.kernel.org/mips/c/9026737703ae
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: cmpxchg: Emit Loongson3 sync workarounds within asm
>   commit 6a57d2d1e7c3
>   https://git.kernel.org/mips/c/6a57d2d1e7c3
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: cmpxchg: Omit redundant barriers for Loongson3
>   commit a91f2a1dba44
>   https://git.kernel.org/mips/c/a91f2a1dba44
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: futex: Emit Loongson3 sync workarounds within asm
>   commit 3c1d3f097972
>   https://git.kernel.org/mips/c/3c1d3f097972
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: syscall: Emit Loongson3 sync workarounds within asm
>   commit e84957e6ae04
>   https://git.kernel.org/mips/c/e84957e6ae04
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Remove loongson_llsc_mb()
>   commit 7f56b1235481
>   https://git.kernel.org/mips/c/7f56b1235481
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: barrier: Make __smp_mb__before_atomic() a no-op for Loongson3
>   commit ae4cd0b1a475
>   https://git.kernel.org/mips/c/ae4cd0b1a475
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler
>   commit 12dbb04f2ac1
>   https://git.kernel.org/mips/c/12dbb04f2ac1
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: genex: Don't reload address unnecessarily
>   commit 4dee90d7b579
>   https://git.kernel.org/mips/c/4dee90d7b579
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: Check Loongson3 LL/SC errata workaround correctness
>   commit e4acfbc18fc9
>   https://git.kernel.org/mips/c/e4acfbc18fc9
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

      parent reply	other threads:[~2019-10-07 17:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 21:53 Paul Burton
2019-10-01 21:53 ` [PATCH v2 01/36] MIPS: Unify sc beqz definition Paul Burton
2019-10-01 21:53 ` [PATCH v2 02/36] MIPS: Use compact branch for LL/SC loops on MIPSr6+ Paul Burton
2019-10-01 21:53 ` [PATCH v2 03/36] MIPS: barrier: Add __SYNC() infrastructure Paul Burton
2019-10-01 21:53 ` [PATCH v2 04/36] MIPS: barrier: Clean up rmb() & wmb() definitions Paul Burton
2019-10-01 21:53 ` [PATCH v2 05/36] MIPS: barrier: Clean up __smp_mb() definition Paul Burton
2019-10-01 21:53 ` [PATCH v2 06/36] MIPS: barrier: Remove fast_mb() Octeon #ifdef'ery Paul Burton
2019-10-01 21:53 ` [PATCH v2 07/36] MIPS: barrier: Clean up __sync() definition Paul Burton
2019-10-01 21:53 ` [PATCH v2 08/36] MIPS: barrier: Clean up sync_ginv() Paul Burton
2019-10-01 21:53 ` [PATCH v2 09/36] MIPS: atomic: Fix whitespace in ATOMIC_OP macros Paul Burton
2019-10-01 21:53 ` [PATCH v2 10/36] MIPS: atomic: Handle !kernel_uses_llsc first Paul Burton
2019-10-01 21:53 ` [PATCH v2 11/36] MIPS: atomic: Use one macro to generate 32b & 64b functions Paul Burton
2019-10-01 21:53 ` [PATCH v2 12/36] MIPS: atomic: Emit Loongson3 sync workarounds within asm Paul Burton
2019-10-01 21:53 ` [PATCH v2 13/36] MIPS: atomic: Use _atomic barriers in atomic_sub_if_positive() Paul Burton
2019-10-01 21:53 ` [PATCH v2 14/36] MIPS: atomic: Unify 32b & 64b sub_if_positive Paul Burton
2019-10-01 21:53 ` [PATCH v2 15/36] MIPS: atomic: Deduplicate 32b & 64b read, set, xchg, cmpxchg Paul Burton
2019-10-01 21:53 ` [PATCH v2 16/36] MIPS: bitops: Handle !kernel_uses_llsc first Paul Burton
2019-10-01 21:53 ` [PATCH v2 17/36] MIPS: bitops: Only use ins for bit 16 or higher Paul Burton
2019-10-01 21:53 ` [PATCH v2 18/36] MIPS: bitops: Use MIPS_ISA_REV, not #ifdefs Paul Burton
2019-10-01 21:53 ` [PATCH v2 19/36] MIPS: bitops: ins start position is always an immediate Paul Burton
2019-10-01 21:53 ` [PATCH v2 20/36] MIPS: bitops: Implement test_and_set_bit() in terms of _lock variant Paul Burton
2019-10-01 21:53 ` [PATCH v2 22/36] MIPS: bitops: Use the BIT() macro Paul Burton
2019-10-01 21:53 ` [PATCH v2 21/36] MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit Paul Burton
2019-10-01 21:53 ` [PATCH v2 23/36] MIPS: bitops: Avoid redundant zero-comparison for non-LLSC Paul Burton
2019-10-01 21:53 ` [PATCH v2 24/36] MIPS: bitops: Abstract LL/SC loops Paul Burton
2019-10-01 21:53 ` [PATCH v2 25/36] MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG Paul Burton
2019-10-01 21:53 ` [PATCH v2 26/36] MIPS: bitops: Emit Loongson3 sync workarounds within asm Paul Burton
2019-10-01 21:53 ` [PATCH v2 27/36] MIPS: bitops: Use smp_mb__before_atomic in test_* ops Paul Burton
2019-10-01 21:53 ` [PATCH v2 28/36] MIPS: cmpxchg: Emit Loongson3 sync workarounds within asm Paul Burton
2019-10-01 21:53 ` [PATCH v2 30/36] MIPS: futex: " Paul Burton
2019-10-01 21:53 ` [PATCH v2 29/36] MIPS: cmpxchg: Omit redundant barriers for Loongson3 Paul Burton
2019-10-01 21:53 ` [PATCH v2 31/36] MIPS: syscall: Emit Loongson3 sync workarounds within asm Paul Burton
2019-10-01 21:53 ` [PATCH v2 32/36] MIPS: barrier: Remove loongson_llsc_mb() Paul Burton
2019-10-01 21:53 ` [PATCH v2 33/36] MIPS: barrier: Make __smp_mb__before_atomic() a no-op for Loongson3 Paul Burton
2019-10-01 21:53 ` [PATCH v2 34/36] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler Paul Burton
2019-10-01 21:53 ` [PATCH v2 35/36] MIPS: genex: Don't reload address unnecessarily Paul Burton
2019-10-01 21:53 ` [PATCH v2 36/36] MIPS: Check Loongson3 LL/SC errata workaround correctness Paul Burton
2019-10-07 17:51 ` Paul Burton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR2201MB1277091F2B297F9B47063E41C19B0@MWHPR2201MB1277.namprd22.prod.outlook.com \
    --to=paul.burton@mips.com \
    --cc=chenhc@lemote.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=pburton@wavecomp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®