aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/string.c
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2025-09-07 18:33:38 +0000
committerBorislav Petkov (AMD) <[email protected]>2025-09-08 13:38:06 +0000
commitc6c973dbfa5e34b1572bcd1852adcad1b5d08fab (patch)
treed7f0dfbf593ee77c79d6d3efe69c5877c446de98 /arch/x86/boot/string.c
parentx86/sgx: Use ENCLS mnemonic in <kernel/cpu/sgx/encls.h> (diff)
downloadkernel-c6c973dbfa5e34b1572bcd1852adcad1b5d08fab.tar.gz
kernel-c6c973dbfa5e34b1572bcd1852adcad1b5d08fab.zip
x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__
The minimum supported GCC version is 8.1, which supports flag output operands and always defines __GCC_ASM_FLAG_OUTPUTS__ macro. Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ and use the "=@ccCOND" flag output operand directly. Use the equivalent "=@ccz" instead of "=@cce" flag output operand for CMPXCHG8B and CMPXCHG16B instructions. These instructions set a single flag bit - the Zero flag - and "=@ccz" is used to distinguish the CC user from comparison instructions, where set ZERO flag indeed means that the values are equal. Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/20250905121723.GCaLrU04lP2A50PT-B@fat_crate.local
Diffstat (limited to 'arch/x86/boot/string.c')
-rw-r--r--arch/x86/boot/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index f35369bb14c5..b25c6a9303b7 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -32,8 +32,8 @@
int memcmp(const void *s1, const void *s2, size_t len)
{
bool diff;
- asm("repe cmpsb" CC_SET(nz)
- : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
+ asm("repe cmpsb"
+ : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
return diff;
}