Skip to content

Commit

Permalink
Merge tag 'x86-urgent-2024-05-18' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
torvalds committed May 19, 2024
2 parents 8dde191 + 9dba9c6 commit 41c14f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/x86/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)

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

Expand Down
3 changes: 3 additions & 0 deletions arch/x86/boot/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,16 @@ int vsprintf(char *buf, const char *fmt, va_list args)

case 'x':
flags |= SMALL;
fallthrough;
case 'X':
base = 16;
break;

case 'd':
case 'i':
flags |= SIGN;
break;

case 'u':
break;

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/alternative.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static void __apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen,
void apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len)
{
__apply_relocation(buf, instr, instrlen, repl, repl_len);
optimize_nops(instr, buf, repl_len);
optimize_nops(instr, buf, instrlen);
}

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

0 comments on commit 41c14f1

Please sign in to comment.