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

Re: [PATCH 2/5] efi: only set a console mode if the current one is invalid


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 30 Mar 2023 18:07:57 +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=WHPfIzER4JtM89tv8E0PaasF82WxqEoWR8fdYkGYY3w=; b=KGkeR3CjGZ39+DbT4GCR0es8sOiV2l+Oq3DWyYSXDUpZHSDca9i580HJjUD1eq5NlaQU+LRBVZyxTekSjQ1VHFQ/cPncrFiV781T3l3YlS6+qP/NMlm8nIxmOcYWAJvVVTAxSj0GXGobpdLqlghVD7Aiactz77ZpagUpltgWE3Gyp1UlWVDH4KuNXrF9HLLqJVL8IDEqXJSZ+Cvh3Iqyf/8smn2IbqIr06qJZ2WI9/Z02gFwqIo0Iv30OF2cVLH2eV//el/rkmt8U9Ff4Wzlld7JspV8RX/eNAUg7OR5pAL463pr9cgRYKJ4eNqS8isR3EdQH1MTRl5paW8Ujf7jow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bzi7QfqwjbvfZiMLqUgKy1wh4XRUq9e9D0s0cqDoCWSYPzOU065oepttEgtqsm4DWAWfKjbEepI1k8BKSBDqQLzwFahGPLwlhcxW5S4ulkBien1Q2jx3aqz5sPyEXgnnGgPm3awR2iX1nlrYDVl1Q5sKxz40aaC9JlqcWRpWg17UolMs46j+fuo8G4NtAKbfL+nvCPrRNvSxyQWP+zhGJLSCWSuXscsXhExSOvRHGJIySfCJtD8l6SY/Y7XAcf/36SA9hGaP3YjvAJcaS48zm4Z7yIQ2i/yWkNyCfp97rgRmbzj0dJpkHTrH6kuNgor43BkJg+jhG3Qtikz55fBX5g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: marmarek@xxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 30 Mar 2023 16:08:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.03.2023 17:44, Roger Pau Monné wrote:
> On Mon, Dec 05, 2022 at 03:19:13PM +0100, Jan Beulich wrote:
>> On 23.11.2022 16:45, Roger Pau Monne wrote:
>>> Do not unconditionally set a mode in efi_console_set_mode(), do so
>>> only if the currently set mode is not valid.
>>
>> You don't say why you want to do so. Furthermore ...
>>
>>> --- a/xen/common/efi/boot.c
>>> +++ b/xen/common/efi/boot.c
>>> @@ -799,6 +799,11 @@ static void __init efi_console_set_mode(void)
>>>      UINTN cols, rows, size;
>>>      unsigned int best, i;
>>>  
>>> +    /* Only set a mode if the current one is not valid. */
>>> +    if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode, &cols, &rows) ==
>>> +         EFI_SUCCESS )
>>> +        return;
>>
>> ... it might be okay if you put such a check in efi_multiboot2(), but
>> the call here from efi_start() is specifically guarded by a check of
>> whether "-basevideo" was passed to xen.efi. This _may_ not be as
>> relevant anymore today, but it certainly was 20 years ago (recall
>> that we've inherited this code from a much older project of ours) -
>> at that time EFI usually started in 80x25 text mode. And I think that
>> even today when you end up launching xen.efi from the EFI shell,
>> you'd be stuck with 80x25 text mode on at least some implementations.
> 
> Won't you use console=vga vga=gfx-...
> 
> To switch to a best mode?

I don't think "vga=gfx-..." is presently consumed in any way xen.efi.
Doing so would require a similar hack of peeking at the (ordinary)
command line options as in legacy booting, except that in xen.efi we
read that command line from a file, which iirc is done only after
fiddling with the video mode.

>> Overall, looking at (for now) just the titles of subsequent patches,
>> I'm not convinced the change here is needed at all. Or if anything it
>> may want to go at the end, taking action only when "vga=current" was
>> specified.
> 
> I guess I'm slightly confused by the usage of both GOP and StdOut, I
> would assume if we have a gop, and can correctly initialize it there's
> no need to fiddle with StdOut also?

Setting the GOP mode is done last before exiting boot services; this
may be a graphics mode which doesn't support a text output protocol.

Jan



 


Rackspace

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