From d98a39d4ceeb7204b33fc330fdfee8cdb5ddbb43 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Mon, 27 Jul 2026 14:19:37 +0300 Subject: [PATCH] OvmfPkg/VirtioInputDxe: handle Ctrl-Alt-Del Signed-off-by: Ivan Shapovalov Tested-by: Alexander Mikhalitsyn --- OvmfPkg/VirtioInputDxe/VirtioInput.inf | 1 + OvmfPkg/VirtioInputDxe/VirtioKeyboard.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/OvmfPkg/VirtioInputDxe/VirtioInput.inf b/OvmfPkg/VirtioInputDxe/VirtioInput.inf index 4a20f606fc..13c92c283d 100644 --- a/OvmfPkg/VirtioInputDxe/VirtioInput.inf +++ b/OvmfPkg/VirtioInputDxe/VirtioInput.inf @@ -32,6 +32,7 @@ DebugLib MemoryAllocationLib UefiBootServicesTableLib + UefiRuntimeServicesTableLib UefiDriverEntryPoint UefiLib VirtioLib diff --git a/OvmfPkg/VirtioInputDxe/VirtioKeyboard.c b/OvmfPkg/VirtioInputDxe/VirtioKeyboard.c index 1d508b46f9..52ac8138a2 100644 --- a/OvmfPkg/VirtioInputDxe/VirtioKeyboard.c +++ b/OvmfPkg/VirtioInputDxe/VirtioKeyboard.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "VirtioInput.h" @@ -441,6 +442,16 @@ VirtioKeyboardHandleEvent ( // Key pressed event received Dev->KeyActive[(UINT8)Event->Code] = TRUE; + // Handle Ctrl-Alt-Del (in any order) + if ( + (Dev->KeyActive[KEY_LEFTCTRL] || Dev->KeyActive[KEY_RIGHTCTRL]) && + (Dev->KeyActive[KEY_LEFTALT] || Dev->KeyActive[KEY_RIGHTALT]) && + Dev->KeyActive[KEY_DELETE] + ) + { + gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL); + } + // // Update toggle state // This must happen before EFI_KEY_DATA is populated, since the toggle state