From patchwork Fri Jul 29 19:45:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 594392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCDE3C00144 for ; Fri, 29 Jul 2022 19:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238895AbiG2Tqz (ORCPT ); Fri, 29 Jul 2022 15:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238894AbiG2Tqv (ORCPT ); Fri, 29 Jul 2022 15:46:51 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B32D88747; Fri, 29 Jul 2022 12:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1wgWQHyf41Q4C/D0b3udJRG2sHG+B+p4zwm51LjrGK0=; b=oCPi7V9p9/OkdOMDupFy+1UUfk 7jRgYnYqnn0bjOD2MKIVi2UnGtBW+2GWtq+SejmyGPXMGE/CvyqOKYqCuNC8hisl8iujG7Oysk2fg YAiT92UIssrhaNbw3sL6Zr104YzxTchOaqVK8p9XBzgSKiRC/OhBg+XOZMEDBIZQVhKRxHLvQxEnN L1f3k0k6P5fAi1zV8/5BIzYunZ8UvkZ7Ntv4BkM44TLUeeZDoYExL582Yu2+TvWQ8OFsiFlMCSHp3 CszL1OT3wxpUsMdvKxxafF7c3xzyBvFsT5OS3BpgVSqCWWRSi3Avx0Lp5CsN9/qKO+nSVy3Y9x2B6 BkQkW/dQ==; Received: from [177.83.209.223] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oHVwa-00BMCN-NS; Fri, 29 Jul 2022 21:46:48 +0200 From: "Guilherme G. Piccoli" To: ardb@kernel.org, linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, anton@enomsg.org, ccross@android.com, keescook@chromium.org, matt@codeblueprint.co.uk, mjg59@srcf.ucam.org, tony.luck@intel.com, "Guilherme G. Piccoli" Subject: [PATCH v2 1/3] efi: Add a generic helper to convert strings to unicode Date: Fri, 29 Jul 2022 16:45:30 -0300 Message-Id: <20220729194532.228403-2-gpiccoli@igalia.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220729194532.228403-1-gpiccoli@igalia.com> References: <20220729194532.228403-1-gpiccoli@igalia.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Currently both efi-pstore and efibc rely in simple for-loops to convert from regular char pointers to u16/unicode strings; so let's export this functionality as a helper to common EFI code to prevent code duplication. This helper will also be used in a subsequent patch (adding a new module). Notice that efi-pstore didn't write the end NULL char in the unicode string before this patch, but this should not change anything in a relevant way for this module - other than that, no functional change is expected. Signed-off-by: Guilherme G. Piccoli --- drivers/firmware/efi/efi-pstore.c | 4 +--- drivers/firmware/efi/efibc.c | 9 ++++----- include/linux/efi.h | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c index 3bddc152fcd4..965a4c0d6e60 100644 --- a/drivers/firmware/efi/efi-pstore.c +++ b/drivers/firmware/efi/efi-pstore.c @@ -167,7 +167,6 @@ static int efi_pstore_write(struct pstore_record *record) char name[DUMP_NAME_LEN]; efi_char16_t efi_name[DUMP_NAME_LEN]; efi_status_t status; - int i; record->id = generic_id(record->time.tv_sec, record->part, record->count); @@ -180,8 +179,7 @@ static int efi_pstore_write(struct pstore_record *record) (long long)record->time.tv_sec, record->compressed ? 'C' : 'D'); - for (i = 0; i < DUMP_NAME_LEN; i++) - efi_name[i] = name[i]; + efi_str8_to_str16(efi_name, name, DUMP_NAME_LEN - 1); if (efivar_trylock()) return -EBUSY; diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 8ced7af8e56d..7e3bf60d24e0 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -39,7 +39,7 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier, : L"shutdown"; const u8 *str = data; efi_char16_t *wdata; - unsigned long l; + size_t len; int ret; ret = efibc_set_variable(L"LoaderEntryRebootReason", reason, @@ -48,11 +48,10 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier, return NOTIFY_DONE; wdata = kmalloc(MAX_DATA_LEN * sizeof(efi_char16_t), GFP_KERNEL); - for (l = 0; l < MAX_DATA_LEN - 1 && str[l] != '\0'; l++) - wdata[l] = str[l]; - wdata[l] = L'\0'; - efibc_set_variable(L"LoaderEntryOneShot", wdata, l); + len = efi_str8_to_str16(wdata, str, MAX_DATA_LEN - 1); + + efibc_set_variable(L"LoaderEntryOneShot", wdata, len); kfree(wdata); return NOTIFY_DONE; diff --git a/include/linux/efi.h b/include/linux/efi.h index d2b84c2fec39..c0ea01be3772 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1030,6 +1030,23 @@ struct efivars { #define EFI_VAR_NAME_LEN 1024 +/* + * Helper that converts regular char buffer to u16 unicode-like strings; + * notice that the unicode buffer requires to be at least len+1 in size. + */ +static inline size_t +efi_str8_to_str16(efi_char16_t *str16, const char *str8, size_t len) +{ + size_t i; + + for (i = 0; i < len && str8[i] != '\0'; i++) + str16[i] = str8[i]; + + str16[i] = L'\0'; + + return i; +} + int efivars_register(struct efivars *efivars, const struct efivar_operations *ops, struct kobject *kobject); From patchwork Fri Jul 29 19:45:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 594772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81110C04A68 for ; Fri, 29 Jul 2022 19:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238698AbiG2Tr5 (ORCPT ); Fri, 29 Jul 2022 15:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbiG2Tr4 (ORCPT ); Fri, 29 Jul 2022 15:47:56 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063E267586; Fri, 29 Jul 2022 12:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gSESq/zVK6WSQ3xcbCVSVTd/pkQVDwB+RHkhs8Ulxac=; b=gNAcLB5d5hgvc2ZzPkGFjiZVW7 0wze4qmrg6EMBcxInS7qXkVTjCCvh+IdzCRriHcL10eYbixF8Fqa7w/I9C07CmmJIMPxBDt7O5VHJ 75RVNHJd//nqO9xg5YO7UFgFbQE0GmGCv8A+gECGgvVeTpeGw3BSLBiW36dO/wStv3fsz7pxq1zAF wZU9FHxDfm8wx9NyiextdgXREkwhSoz4tRJ+r26MOhdEh9xz1DgVzY/qSM/+4kSZ9KKRdvsRn3Poo OPJHBOf05KYUFR+QRMLKXfLtzM7jqKM7B332IBErDQ21kEZKCnzqyZlETL3ipEjedfzqbpOsKuU3L M+ikN8QQ==; Received: from [177.83.209.223] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oHVxf-00BMHE-D5; Fri, 29 Jul 2022 21:47:54 +0200 From: "Guilherme G. Piccoli" To: ardb@kernel.org, linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, anton@enomsg.org, ccross@android.com, keescook@chromium.org, matt@codeblueprint.co.uk, mjg59@srcf.ucam.org, tony.luck@intel.com, "Guilherme G. Piccoli" Subject: [PATCH v2 2/3] efi: efibc: Guard against allocation failure Date: Fri, 29 Jul 2022 16:45:31 -0300 Message-Id: <20220729194532.228403-3-gpiccoli@igalia.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220729194532.228403-1-gpiccoli@igalia.com> References: <20220729194532.228403-1-gpiccoli@igalia.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org There is a single kmalloc in this driver, and it's not currently guarded against allocation failure. Do it here by just letting the reboot handler to proceed, in case this tentative allocation fails. Fixes: 416581e48679 ("efi: efibc: avoid efivar API for setting variables") Signed-off-by: Guilherme G. Piccoli --- Notice the sha-1 hash of the efibc patch we're fixing is from efi/next, might change in upstream once such patch is merged. Feel free to remove the fixes tag if it makes sense, no issues from me =) drivers/firmware/efi/efibc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 7e3bf60d24e0..9a8d914f91a6 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -48,6 +48,8 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier, return NOTIFY_DONE; wdata = kmalloc(MAX_DATA_LEN * sizeof(efi_char16_t), GFP_KERNEL); + if (!wdata) + return NOTIFY_DONE; len = efi_str8_to_str16(wdata, str, MAX_DATA_LEN - 1); From patchwork Fri Jul 29 19:45:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 594391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18C44C00144 for ; Fri, 29 Jul 2022 19:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238240AbiG2Tsq (ORCPT ); Fri, 29 Jul 2022 15:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237998AbiG2Tsp (ORCPT ); Fri, 29 Jul 2022 15:48:45 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A915E88E0B; Fri, 29 Jul 2022 12:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IIBd4JO9tjHfeGjjy6pkVi9dYz0wqG2cJ6lj/g2SiG4=; b=I2VaxXyS7tS1t2SfreP/xJuVJj JxJEHs03tnPSZE1E95bh2aCH+zc9XrgSn0MEeImpRw8+c6+JcTShDDQG2roisqt++Syksty+QD3/E KQ6SWESD2WgE0c+BYj3u1RJgD6i+E6i9I695AZNGeuj6l0rNw5+BbPyUDgLpdyPVtrEuUrjiKW5Jp EHdgPfijK76ETsB5nmACeG+wPVHIwK7wmN/R4G6OEQEESJtYwxbRMEiAB22AHLp67SgtbbuR8Gs+A /BePOTUv7QVLBZ1EAcSXzblhhldizDiMNUFCFUJRvE13nRDabzp+dJ1+dix6/KrkFjMJZQHRz7W5B 4DYpcLew==; Received: from [177.83.209.223] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oHVyS-00BML8-D5; Fri, 29 Jul 2022 21:48:42 +0200 From: "Guilherme G. Piccoli" To: ardb@kernel.org, linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, anton@enomsg.org, ccross@android.com, keescook@chromium.org, matt@codeblueprint.co.uk, mjg59@srcf.ucam.org, tony.luck@intel.com, "Guilherme G. Piccoli" Subject: [PATCH v2 3/3] efi-panic: Introduce the UEFI panic notification mechanism Date: Fri, 29 Jul 2022 16:45:32 -0300 Message-Id: <20220729194532.228403-4-gpiccoli@igalia.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220729194532.228403-1-gpiccoli@igalia.com> References: <20220729194532.228403-1-gpiccoli@igalia.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Despite we have pstore, kdump and other panic-time mechanisms, there's no generic way to let the firmware know a panic event happened. Some hypervisors might have special code for that, but that's not generic. The UEFI panic notification module hereby proposed aims to fill this need: once we face a panic, through the panic notifier infrastructure we set a UEFI variable named PanicWarn with a value - default is 0xFF, but it's adjustable via module parameter. The firmware is then enabled to take a proper action. The module also let the users know that last execution likely panicked if the UEFI variable is present on module load - then it clears that to avoid confusing users, only the last panic event is recorded. Signed-off-by: Guilherme G. Piccoli --- drivers/firmware/efi/Kconfig | 10 ++++ drivers/firmware/efi/Makefile | 1 + drivers/firmware/efi/efi-panic.c | 89 ++++++++++++++++++++++++++++++++ include/linux/efi.h | 1 + 4 files changed, 101 insertions(+) create mode 100644 drivers/firmware/efi/efi-panic.c diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig index 6cb7384ad2ac..f1ed6128d623 100644 --- a/drivers/firmware/efi/Kconfig +++ b/drivers/firmware/efi/Kconfig @@ -147,6 +147,16 @@ config EFI_BOOTLOADER_CONTROL bootloader reads this reboot reason and takes particular action according to its policy. +config EFI_PANIC_NOTIFIER + tristate "UEFI Panic Notifier" + depends on EFI + default n + help + With this module, kernel creates the UEFI variable "PanicWarn" if + the system faces a panic event. With that, the firmware is entitled + to take an action if the last kernel panicked; it also shows a + message during boot time if last run faced a panic event. + config EFI_CAPSULE_LOADER tristate "EFI capsule loader" depends on EFI && !IA64 diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile index 8d151e332584..c7cf3dcb284e 100644 --- a/drivers/firmware/efi/Makefile +++ b/drivers/firmware/efi/Makefile @@ -25,6 +25,7 @@ obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o subdir-$(CONFIG_EFI_STUB) += libstub obj-$(CONFIG_EFI_FAKE_MEMMAP) += fake_map.o obj-$(CONFIG_EFI_BOOTLOADER_CONTROL) += efibc.o +obj-$(CONFIG_EFI_PANIC_NOTIFIER) += efi-panic.o obj-$(CONFIG_EFI_TEST) += test/ obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o diff --git a/drivers/firmware/efi/efi-panic.c b/drivers/firmware/efi/efi-panic.c new file mode 100644 index 000000000000..02ffa4930039 --- /dev/null +++ b/drivers/firmware/efi/efi-panic.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * efi-panic: UEFI panic notification mechanism + */ + +#define pr_fmt(fmt) "efi-panic: " fmt + +#include +#include +#include + +#define EFI_PANIC_ATTR (EFI_VARIABLE_NON_VOLATILE |\ + EFI_VARIABLE_BOOTSERVICE_ACCESS |\ + EFI_VARIABLE_RUNTIME_ACCESS) + +#define EFI_DATA_SIZE (2 * sizeof(efi_char16_t)) + +static efi_char16_t *panic_warn_name = L"PanicWarn"; + +static u8 panic_warn_val = 0xFF; +module_param(panic_warn_val, byte, 0644); +MODULE_PARM_DESC(panic_warn_val, + "Value written to PanicWarn efivar on panic event [default=0xFF]"); + +static int efi_panic_cb(struct notifier_block *nb, unsigned long ev, + void *unused) +{ + efi_char16_t val[2]; + efi_status_t ret; + + efi_str8_to_str16(val, &panic_warn_val, 1); + ret = efi.set_variable_nonblocking(panic_warn_name, + &LINUX_EFI_PANIC_WARN_GUID, + EFI_PANIC_ATTR, EFI_DATA_SIZE, + val); + + if (ret != EFI_SUCCESS) + pr_err("failed notifying UEFI about the panic (0x%lx)\n", ret); + + return NOTIFY_DONE; +} + +static struct notifier_block efi_panic_notifier = { + .notifier_call = efi_panic_cb, +}; + +static int __init efi_panic_init(void) +{ + unsigned long sz = EFI_DATA_SIZE; + u8 data[EFI_DATA_SIZE]; + efi_status_t ret; + + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE)) + return -ENODEV; + + ret = efi.get_variable(panic_warn_name, &LINUX_EFI_PANIC_WARN_GUID, + NULL, &sz, data); + + if (ret == EFI_SUCCESS) { + pr_info("previous kernel (likely) had a panic\n"); + + ret = efi.set_variable(panic_warn_name, + &LINUX_EFI_PANIC_WARN_GUID, + EFI_PANIC_ATTR, 0, NULL); + if (ret != EFI_SUCCESS) + pr_warn("cannot delete the UEFI variable\n"); + + } else { + if (ret != EFI_NOT_FOUND) + pr_err("can't read the UEFI variable (err=%lx)\n", ret); + } + + atomic_notifier_chain_register(&panic_notifier_list, + &efi_panic_notifier); + + return 0; +} +module_init(efi_panic_init); + +static void __exit efi_panic_exit(void) +{ + atomic_notifier_chain_unregister(&panic_notifier_list, + &efi_panic_notifier); +} +module_exit(efi_panic_exit); + +MODULE_AUTHOR("Guilherme G. Piccoli "); +MODULE_DESCRIPTION("UEFI Panic Notification Mechanism"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/efi.h b/include/linux/efi.h index c0ea01be3772..38a5056cc72a 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -367,6 +367,7 @@ void efi_native_runtime_setup(void); #define EFI_GLOBAL_VARIABLE_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c) #define UV_SYSTEM_TABLE_GUID EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93) #define LINUX_EFI_CRASH_GUID EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0) +#define LINUX_EFI_PANIC_WARN_GUID EFI_GUID(0x9e85b665, 0x08d4, 0x42c9, 0x83, 0x24, 0x47, 0xed, 0x5f, 0xe5, 0x0b, 0xf3) #define LOADED_IMAGE_PROTOCOL_GUID EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a) #define EFI_UGA_PROTOCOL_GUID EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39)