[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/3] multiboot2: do not set StdOut mode unconditionally
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Thu, 1 Jun 2023 15:05:17 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=acbPmQOHVXpOvt2zjOfNJijiZJW8uhg4HOcOyYQ+YRY=; b=UaLR9SfeSKKw0YbAec20gg/R/NGc5xZKGYgSnj5y1Rxag7tuGs3v0FER87TpePVPbzgfxu9dZP0I4FFgJUcJcQh5x20svgcB7aO8cz1r67quAasVZf5qE4CxErAkGgr4slIaihjcHG5fBHAjmDZK7tZxfoNSZz1Jfo+1oCDpTUHSz2xtcVFd3Jj+in46dQNvrOGoNzzTkz4KiMzgl+yy0CdxNzIzPB/VqDjdoLqdHy1hY4cyw4PLHqBWcwqVgOxjt1ITbQY8BJRwKAIhwqwhNl5D/1o0JQ9DRYRpzTb7MNLF8xoKArqpUESoWKjmEEzk8PojR1YEZI5umEzIp/W1OA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZdFP7Y4KfV+NDzPLGrYPLd3tIQIw9IhQg3Yt0C2jGP7Hi8sdafseRjTGTiVl7NfuxYYqYBwuTMgr4Am769ufQ4wrwf+HO+wD44d/3BX7QG6YdAjgsIk2qW7oIWBxCnDGJCecAEOyFyT3u1jNgQeMcQdfzRQR6GpmiWJ2R4gcYdNrB74qfsm1mNid/DSU39+4izrFHOMuex06IHmxfAJnpo8lNCgyqifgQhK/iRzMLqgpk0b6JDaW5n0CPx9zF7KBOmtNtNgww8CbAnEL753EXy/FR3sqFayWAPaL7sCCSzouv49HB+7P1xeGZ2/ycgn668ZyoAOpHEGmBuOswsp7EQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 01 Jun 2023 13:05:57 +0000
- Ironport-data: A9a23:NIAHTqzQXJ+7ggatqHN6t+cRxyrEfRIJ4+MujC+fZmUNrF6WrkUFy mcdD2nSbP7ZNjP8KtoiO9zl8RkCuZ6BnIVqSQA+qCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EsHUMja4mtC5QRgPakT5zcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KUwS0 fcjNT8zVDqoo/iy7LSrZK50ne12eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVMsuFTuGIO9ltiiX8Jak1zev mvb12/4HgsbJJqUzj/tHneE37aWw3ijA9tCfFG+3sZxo0WOnCs1MhkLCX/8h76AiVa8Y+sKf iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZDYtE7sM49RRQxy 0SE2djuAFRHr7m9WX+bsLCOoluP1TM9KGYDYWoPSlID6ty6+YUr1EuQE5BkDbK/icDzFXfo2 TeWoSMihrIVy8kWy6G8+lOBiDWpznTUcjMICszsdjrNxmtEiESNPORENXCzAS58Ebuk
- Ironport-hdrordr: A9a23:U1H52K/Rb0+nZ4nv6sZuk+C7I+orL9Y04lQ7vn2ZKCY0TiX8ra uTdZsguCMc5Ax6ZJhCo7G90de7Lk80nKQdibX5Vo3PYOCJggWVEL0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Only initialize StdOut if the current StdOut mode is unusable. This
avoids forcefully switching StdOut to the maximum supported
resolution, and thus very likely changing the GOP mode without having
first parsed the command line options.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
The code is very similar to the approach suggested by Jan, please let
me know if you would be OK with your suggested-by tag added.
---
Changes since v2:
- Use approach suggested by Jan.
Changes since v1:
- New in this version.
---
xen/arch/x86/efi/efi-boot.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 003ef037bf07..5314f4293b12 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -820,7 +820,13 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle,
EFI_SYSTEM_TABLE *SystemTable
efi_init(ImageHandle, SystemTable);
- efi_console_set_mode();
+ if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
+ &cols, &rows) != EFI_SUCCESS )
+ /*
+ * If active StdOut mode is invalid init ConOut (StdOut) to the max
+ * supported size.
+ */
+ efi_console_set_mode();
if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
&cols, &rows) == EFI_SUCCESS )
--
2.40.0
|