Skip to content

Commit f73857e

Browse files
committed
Merge tag 'x86-boot-2024-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Ingo Molnar: - Ignore NMIs during very early boot, to address kexec crashes - Remove redundant initialization in boot/string.c's strcmp() * tag 'x86-boot-2024-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Remove redundant initialization of the 'delta' variable in strcmp() x86/boot: Ignore NMIs during very early boot
2 parents 106b88d + 257ca14 commit f73857e

5 files changed

Lines changed: 9 additions & 1 deletion

File tree

arch/x86/boot/compressed/ident_map_64.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,8 @@ void do_boot_page_fault(struct pt_regs *regs, unsigned long error_code)
386386
*/
387387
kernel_add_identity_map(address, end);
388388
}
389+
390+
void do_boot_nmi_trap(struct pt_regs *regs, unsigned long error_code)
391+
{
392+
/* Empty handler to ignore NMI during early boot */
393+
}

arch/x86/boot/compressed/idt_64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void load_stage2_idt(void)
6161
boot_idt_desc.address = (unsigned long)boot_idt;
6262

6363
set_idt_entry(X86_TRAP_PF, boot_page_fault);
64+
set_idt_entry(X86_TRAP_NMI, boot_nmi_trap);
6465

6566
#ifdef CONFIG_AMD_MEM_ENCRYPT
6667
/*

arch/x86/boot/compressed/idt_handlers_64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ SYM_FUNC_END(\name)
7070
.code64
7171

7272
EXCEPTION_HANDLER boot_page_fault do_boot_page_fault error_code=1
73+
EXCEPTION_HANDLER boot_nmi_trap do_boot_nmi_trap error_code=0
7374

7475
#ifdef CONFIG_AMD_MEM_ENCRYPT
7576
EXCEPTION_HANDLER boot_stage1_vc do_vc_no_ghcb error_code=1

arch/x86/boot/compressed/misc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ static inline void cleanup_exception_handling(void) { }
196196

197197
/* IDT Entry Points */
198198
void boot_page_fault(void);
199+
void boot_nmi_trap(void);
199200
void boot_stage1_vc(void);
200201
void boot_stage2_vc(void);
201202

arch/x86/boot/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int strcmp(const char *str1, const char *str2)
4949
{
5050
const unsigned char *s1 = (const unsigned char *)str1;
5151
const unsigned char *s2 = (const unsigned char *)str2;
52-
int delta = 0;
52+
int delta;
5353

5454
while (*s1 || *s2) {
5555
delta = *s1 - *s2;

0 commit comments

Comments
 (0)