]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/asm/segment: Implement loadsegment()/savesegment() macros with static inline...
authorUros Bizjak <ubizjak@gmail.com>
Mon, 30 Mar 2026 05:57:45 +0000 (07:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 30 Mar 2026 07:10:16 +0000 (09:10 +0200)
commitec631bc3fb342ad7a2ec09433821e7201b7b15f9
treefe293ce7af5bbbe7a818547eb2986f3f25374990
parentcaf3cb2ef22e4b4ff9f6bb48f71ce30dae663326
x86/asm/segment: Implement loadsegment()/savesegment() macros with static inline helpers

Convert the __loadsegment_simple() and savesegment() macro
implementations into static inline helper functions generated
via small helper macros.

Historically loadsegment() and savesegment() relied on macros that
embedded inline assembly. This approach obscures types, complicates
debugging, and makes the call sites harder for the compiler and static
analysis tools to reason about.

This change is purely mechanical and does not alter the generated code,
but improves readability, type safety, and compiler visibility of the
helpers.

Suggested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330055823.5793-4-ubizjak@gmail.com
arch/x86/include/asm/segment.h