[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 2/3] multiboot2: do not set StdOut mode unconditionally
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Wed, 5 Jul 2023 13:47:40 +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=R8YvMDDpI8T971tJbHPd1tPqKr7FAFvy+J0vBuvNH0M=; b=Yf3ZS/gHweAnZwu0ozs3exFprFZ495m9olHaMOwaIpi8XJDYyFLtdz4ndhaBMuzt1xnp6X2osKqwN/2JnEeB/p19SuEOgV/a5mk9fKV/gXwSoygkD8V3XICOXvu9YEcVpQ0Wnk+z7D044zuEjiF7em1eV2fzodQ7zSgeiYxQAOjwrXKIv9a14EpTLNrFJtDiKhIibmB5zLNgLe84X6j3V0OCdSQV7DivEe0CSLxC3EcB8fHiyb56k+daDb5p01gaRhdtb8KtCcjeZI0MKXAB+p0rlvSxkdJeElH2XMJ/zOhNw7v8pYD1j3BA4yni1f9/Heejy8KoPkRFFZmS1ao2Lg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7Xuq6eGwamhDmbLx/4tEZKg74Y4e50w2ihqYo/dl0FcVBC6VdZt/+2kw92LC8Duw8slymrmHq+PUvA2o1LJD+XcWB8L2YH04Tbvdo4hIgjVddzKPWy41boJI0NzcSzymq9x5lPUS2txUSr36SXc9+c9Nr8zM0j4QpXJmiOEqhh5sL3o7hXdnAj+Lh8V1d6yylSbsbaey90+WNuPpUogbEYmqsJKDauE95iIF38/xWe2uLCazZQ17KlPeeBYFQV39iQtZMccG9lhCxBjairdKuUm40U0MLSCC6hS7k0jHou8/1AslCYEmLoamBHvLFnTnYe/feO8v5PK+R4W1L5RPg==
- 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: Wed, 05 Jul 2023 11:48:15 +0000
- Ironport-data: A9a23:5pvWsawrgW9FfL6YxIR6t+cQxyrEfRIJ4+MujC+fZmUNrF6WrkUAy GZLXz/UOamJZzekKtFxbo6180wEuZ6Bm9JnTVE+ryAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPa0T5jcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTto2 NcyA2sHVQLZnv/v++K+ZLZwmMt2eaEHPKtH0p1h5RfwKK58BKvlGuDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjeVkFYZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r137CQzX2lB9J6+LuQ1sVqnHS2+HMpNCIVbEG9rKeHiEKSVIcKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZjxLZcEitcQ2bSc3z VLPlNTsbRRwtJWFRHTb8a2bxQ5eIgAQJG4GIDQCFA0M5oG5pJlp1k6VCNF+DKSyk9v5Xynqx CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb8D2B0wTA3Ncp9Ebs=
- Ironport-hdrordr: A9a23:OWV6oq9mjMz71UJkHcRuk+G/dr1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwWpVoJkmsj6KdgLNhRotKOTOLhILGFvAH0WKP+V3d8mjFh5dgPM RbAtdD4b/LfD9HZK/BiWHXcurIguP3iJxA7d2us0uFJjsaDp2IgT0JaTpyRSZNNXR77NcCZd OhDo0tnUvSRV0nKuCAQlUVVenKoNPG0LrgfB49HhYirCWekD+y77b+Mh6AmjMTSSlGz7sO+X XM11WR3NTvj9iLjjvnk0PD5ZVfn9XsjvNFGcy3k8AQbhn8lwqyY4xlerua+BQ4uvum5loGmM TF5z0gI8NwwXXMeXzdm2qm5yDQlBIVr1Pyw16RhnXu5eT/WTIBEsJEwaZUaAHQ5UYMtMx1lP sj5RPTi7NnSTf72Ajt7dnBUB9n0mKyvHoZiOYWy1hSS5EXZrN9pZEWuGlVDJADNiTn751PKp gnMOjsoNJtNX+KZXHQuWdihPSqQ3QIBx+DBnMPv8SEugIm6ExR/g89/ogyj30A/JUyR91v/O LfKJllk7lIU4s/cb99LP1pe7r3NkX9BTb3dE6CK1XuE68Kf1jXrYTs3bkz7Oa2PLQV0ZoJno jbWl8wjx99R6vXM7zM4HR3yGGOfI3kNg6dj/22pqIJ9YEUfYCbcRFqEzsV4o+dS/Z2OLyvZx /8AuMQPxbZFxqfJW945XyBZ3BsEwhubCRsgKdcZ7uvmLO9FmS4jJ2sTN/jYJzQLB0DZkTTRl M+YRmbHrQz0qnsYA61vCTs
- 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>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
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 4394c7276aa3..a13a335d24a9 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -829,7 +829,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.41.0
|