diff options
| author | Uros Bizjak <ubizjak@gmail.com> | 2026-03-30 07:57:43 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2026-03-30 09:10:15 +0200 |
| commit | 8379ca68a01c38485b620d36a72d8aeeca86e743 (patch) | |
| tree | bb14b692434dd3e4c3780c64bda6d5b3d137fef6 /tools/perf/scripts/python/bin | |
| parent | d9576c9cd6a3056435e8e974c36ef576816a6c99 (diff) | |
x86/asm/segment: Remove unnecessary "memory" clobber from savesegment()
The savesegment() macro uses inline assembly to copy a segment register
into a general-purpose register:
movl %seg, reg
This instruction does not access memory, yet the inline asm currently
declares a "memory" clobber, which unnecessarily acts as a compiler
barrier and may inhibit optimization.
Remove the "memory" clobber and mark the asm as `asm volatile` instead.
Segment register loads in the kernel are implemented using `asm volatile`,
so the compiler will not schedule segment register reads before those
loads. Using `asm volatile` preserves the intended ordering with other
segment register operations without imposing an unnecessary global memory
barrier.
No functional change intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: https://patch.msgid.link/20260330055823.5793-2-ubizjak@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
