summaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2026-11-10 09:27:39 -0800
committerIngo Molnar <mingo@kernel.org>2026-11-15 12:53:02 +0100
commit0dc2a4dac3d04e9e4479aeb0b46172feab1cca0a (patch)
treee5052544214683cc67874802544b37e2844a2605 /scripts/const_structs.checkpatch
parent3b4c98b47ba7c3c57bcf54fb85f54a854622041c (diff)
x86/mm: Ensure write visibility during LDT installation
During LDT installation, the intent is to overwrite the old per-mm LDT value, then send an IPI to the mm user CPUs to have each load the new value. But there is an ordering problem: a new mm user CPU sets itself in mm_cpumask() and then reads mm->context.ldt. The LDT-installing CPU writes mm->context.ldt and then reads mm_cpumask(). But, there is nothing which orders the LDT installation side actions. The CPU can read mm_cpumask() before its write becomes visible. Ensure that new mm user CPUs see the new mm->context.ldt. Make mm->context.ldt visible before reading mm_cpumask(). Also convert the smp_store_release() over to a WRITE_ONCE(). smp_store_release() has an internal barrier which is weaker than the new smp_mb(). Avoid an extra barrier by converting it to WRITE_ONCE(). Also refresh/correct misleading comments. READ/WRITE_ONCE() do not "synchronize" anything themselves. Reported-by: Jaeyoung Chung <jjy600901@snu.ac.kr> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Jaeyoung Chung <jjy600901@snu.ac.kr> Acked-by: Linus Torvalds <torvalds@linuxfoundation.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions