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....@citrix.com> Reviewed-by: Jan Beulich <jbeul...@suse.com> --- 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