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

Re: [PATCH v2 3/3] multiboot2: do not set StdOut mode unconditionally


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 31 May 2023 16:16:26 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=1CJmBLPeRlDKIRxTBOqjIyefB49v71BzfBsGzuhbnV8=; b=oaXkIKok5ogkKbNMjnsYgd/A28MjHTWk5YWfOINmBVCNpU/Tu7eZ/1vwBOBiln9wIuyGEPXzeAGFRBsl2P3pII297mBjzAyVu6cPA36fFhSeI8xnG1hF2X5q/POrVZ6lwriXTtcLdtApc7arYJz9UifkA2KeaPe0pHWnLBlHfzXZQ/EvXb+5etqnr8Sq3Oi4S4UosF/Wa2A2SlTDjYEx6NC0WkXczpupW31fh/0KjVqPMe7cSmQ6iqNz7RCUftFJAkPSMFoxcw+1TbBQSLhj3qirW4eV0WZLyfx79ScrwU9WbeGVCKHDlwvOJF7IkyMH3afkwkYjB4wYFEsw+5fMOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PVe7x3jlu8HB++0iPIOPxJY9Y5JHGH5zRSjFqp5+Um2GLFuDAbzL56hAwDGku1URowQkX9+TJExmtl1IyibqAmZ0EL6Qx/mG6J18fpnZnPfiQyfcL3mWZp76Dv8JFOesqs8vN1ARkPay/IdDAOb3OPrDGkh9IuPisRJgSV8OpcFeX1e+BwSBogwU76XDwk1aE5fCwDiMt1H7SCiV9J6w3tI/KxzXBaZvXhUvXc9FHLIh8uDE9c6r+tqTlPqMf7RiQcuMx07XW8vU6kIGZ6Xm75GW/uGtOsDFOKePGgdrzY+46KNaYS+1f5TNFK/9WPX1FdMbcuxn9ImjuHWqf5QdZQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 31 May 2023 14:16:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.05.2023 12:57, Roger Pau Monné wrote:
> On Wed, Apr 05, 2023 at 12:36:55PM +0200, Jan Beulich wrote:
>> On 31.03.2023 11:59, Roger Pau Monne wrote:
>>> @@ -887,6 +881,15 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, 
>>> EFI_SYSTEM_TABLE *SystemTable
>>>  
>>>          efi_arch_edid(gop_handle);
>>>      }
>>> +    else
>>> +    {
>>> +        /* If no GOP, init ConOut (StdOut) to the max supported size. */
>>> +        efi_console_set_mode();
>>> +
>>> +        if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
>>> +                               &cols, &rows) == EFI_SUCCESS )
>>> +            efi_arch_console_init(cols, rows);
>>> +    }
>>
>> Instead of making this an "else", wouldn't you better check that a
>> valid gop_mode was found? efi_find_gop_mode() can return ~0 after all.
> 
> When using vga=current gop_mode would also be ~0, in order for
> efi_set_gop_mode() to not change the current mode,

And then we'd skip efi_console_set_mode() here as well, which I think
is what we want with "vga=current"?

> I was trying to
> avoid exposing keep_current or similar extra variable to signal this.
> 
>> Furthermore, what if the active mode doesn't support text output? (I
>> consider the spec unclear in regard to whether this is possible, but
>> maybe I simply didn't find the right place stating it.)
>>
>> Finally I think efi_arch_console_init() wants calling nevertheless.
>>
>> So altogether maybe
>>
>>     if ( gop_mode == ~0 ||
>>          StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
>>                            &cols, &rows) != EFI_SUCCESS )
> 
> I think it would make more sense to call efi_console_set_mode() only
> if the current StdOut mode is not valid, as anything different from
> vga=current will already force a GOP mode change.

Hmm, this may also make sense. I guess I'd like to see the combined
result to be better able to judge.

Jan



 


Rackspace

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