Re: [PATCH] x86/tdx: Remove the early #VE handler
From: Verma, Vishal L
Date: Mon Sep 21 2026 - 17:21:52 EST
On Fri, 2026-09-11 at 11:37 +0100, Kiryl Shutsemau wrote:
>
> Rick, could you actually test it?
>
> Are we sure there's no other port I/O in before idt_setup_early_traps()?
>
> I don't see anything direct, but exception path is different story.
>
> native_machine_emergency_restart() does port I/O for BOOT_KBD which
> seems to be reachable and leads to #VE with the patch:
>
> machine_emergency_restart()
> __machine_emergency_restart(1)
> machine_ops.emergency_restart()
> native_machine_emergency_restart()
> reboot_type == BOOT_ACPI (default)
> acpi_reboot()
> reboot_type = BOOT_KBD
> kb_wait()
> inb(0x64) --> #VE
>
> Could you check if the patch changes panic() behaviour in the window
> before idt_setup_early_traps()?
Hi Kiryl - not sure how I would test this - but looking at it a bit
more -
vpanic() only goes to the machine_emergency_restart() path if
CONFIG_PANIC_TIMEOUT is something other than 0. Distros and Kconfig
both default it to 0. This could be overridden by panic=N on the
command line, but that is parsed after idt_setup_early_traps(), so that
would behave normally.
So at least this path should, in practice, never cause a problem.