Skip to content

Commit 41c14f1

Browse files
committed
Merge tag 'x86-urgent-2024-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: - Fix a NOP-patching bug that resulted in valid but suboptimal NOP sequences in certain cases - Fix build warnings related to fall-through control flow * tag 'x86-urgent-2024-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/alternatives: Use the correct length when optimizing NOPs x86/boot: Address clang -Wimplicit-fallthrough in vsprintf() x86/boot: Add a fallthrough annotation
2 parents 8dde191 + 9dba9c6 commit 41c14f1

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

arch/x86/boot/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
5656
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
5757
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
5858
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
59+
KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
5960

6061
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
6162

arch/x86/boot/printf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,16 @@ int vsprintf(char *buf, const char *fmt, va_list args)
246246

247247
case 'x':
248248
flags |= SMALL;
249+
fallthrough;
249250
case 'X':
250251
base = 16;
251252
break;
252253

253254
case 'd':
254255
case 'i':
255256
flags |= SIGN;
257+
break;
258+
256259
case 'u':
257260
break;
258261

arch/x86/kernel/alternative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static void __apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen,
372372
void apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len)
373373
{
374374
__apply_relocation(buf, instr, instrlen, repl, repl_len);
375-
optimize_nops(instr, buf, repl_len);
375+
optimize_nops(instr, buf, instrlen);
376376
}
377377

378378
/* Low-level backend functions usable from alternative code replacements. */

0 commit comments

Comments
 (0)