Files
Mauricio Faria de OliveiraandBorislav Petkov (AMD) a8c171c107 x86/boot: Add volatile, clobbers and zero-length test in memcmp()
Add the volatile qualifier and clobbers parameter to prevent bugs with
instruction reordering and optimization.

Also add TEST for the zero-length case to set ZF, as, if the count register
is zero, the REPE prefix does not run the CMPSB instruction, leaving the ZF
flag undetermined.

  [ bp: Add a comment about the len==0 case. ]

Fixes: 62bd0337d0 ("Top header file for new x86 setup code")
Closes: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/all/20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com
2026-07-28 16:32:44 -07:00
..
2025-11-28 20:29:52 +01:00
2026-05-04 14:26:13 +02:00