[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] multiboot2: do not set StdOut mode unconditionally



commit 60474e8e281807f384f4768a464d71406d0cf659
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Jul 10 12:18:39 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jul 10 12:18:39 2023 +0200

    multiboot2: do not set StdOut mode unconditionally
    
    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>
---
 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 88e715f4dd..92f4cfe8bd 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 )
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.