x86/asm: Remove %P operand modifier from altinstr asm templates
authorUros Bizjak <ubizjak@gmail.com>
Tue, 19 Mar 2024 10:40:12 +0000 (11:40 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Mar 2024 12:15:34 +0000 (13:15 +0100)
commita3ff53167cef2b5c6c8948246172d6f9279f037f
tree011ca9e0a865e1e7d27d31747c60408ed28fd71e
parent4ae3dc83b047d51485cce1a72be277a110d77c91
x86/asm: Remove %P operand modifier from altinstr asm templates

The "P" asm operand modifier is a x86 target-specific modifier.

For x86_64, when used with a symbol reference, the "%P" modifier
emits "sym" instead of "sym(%rip)". This property is currently
used to prevent %RIP-relative addressing in .altinstr sections.

%RIP-relative addresses are nowadays correctly handled in .altinstr
sections, so remove %P operand modifier from altinstr asm templates.

Also note that unlike GCC, clang emits %rip-relative symbol
reference with "P" asm operand modifier, so the patch also unifies
symbol handling with both compilers.

No functional changes intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20240319104418.284519-2-ubizjak@gmail.com
arch/x86/include/asm/apic.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/special_insns.h