]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
memtest: use {READ,WRITE}_ONCE in memory scanning
authorQiang Zhang <qiang4.zhang@intel.com>
Tue, 12 Mar 2024 08:04:23 +0000 (16:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:26 +0000 (15:11 +0200)
commit05ee20c397530f73f193ccd026373347ed7a8fe3
tree02bb311855b0c9fd33d3c2264ea1b54103922418
parenta0353e21a622b360d1aae214ba0adc4188bec488
memtest: use {READ,WRITE}_ONCE in memory scanning

[ Upstream commit 82634d7e24271698e50a3ec811e5f50de790a65f ]

memtest failed to find bad memory when compiled with clang.  So use
{WRITE,READ}_ONCE to access memory to avoid compiler over optimization.

Link: https://lkml.kernel.org/r/20240312080422.691222-1-qiang4.zhang@intel.com
Signed-off-by: Qiang Zhang <qiang4.zhang@intel.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/memtest.c