Re: [PATCH] x86/boot/compressed: Register NMI handler in EFI boot loader

From: Ingo Molnar
Date: Tue Jan 10 2023 - 06:03:12 EST



* Zeng Heng <zengheng4@xxxxxxxxxx> wrote:

> +void do_boot_nmi_fault(struct pt_regs *regs, unsigned long error_code)
> +{
> + /* ignore */
> +}
> diff --git a/arch/x86/boot/compressed/idt_64.c b/arch/x86/boot/compressed/idt_64.c
> index 6debb816e83d..b169c9728d52 100644
> --- a/arch/x86/boot/compressed/idt_64.c
> +++ b/arch/x86/boot/compressed/idt_64.c
> @@ -60,6 +60,7 @@ void load_stage2_idt(void)
> {
> boot_idt_desc.address = (unsigned long)boot_idt;
>
> + set_idt_entry(X86_TRAP_NMI, boot_nmi_fault);
> set_idt_entry(X86_TRAP_PF, boot_page_fault);

So it's a bit sad to install a dummy handler that does nothing, while
something clearly sent an NMI and expects an intelligent reaction - OTOH
the unexpected NMIs from from watchdog during a kdump clearly make things
worse by crashing the bootup.

Anyway, I cannot think of a better response here that the boot loading code
could do either, so I've applied your fix to tip:x86/boot.

Thanks,

Ingo