[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 30 Mar 2023 18:17:36 +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=em7eAcOH84sb9CI6wNZvCbA9Cerek/Jl5dXFIQOBVp8=; b=NDMHCj9vdaO2fZFjjNjIwHjfa/VeOkzfbUd78KNTbrflrj2vfiA/OeAxNk//8kyYMw52NsLk2Vg7IGyKiZHa/ULZNrOQkWFj8Ta/XVEfNjq/mpId4kb2M89Fb/WdUFqx0N6Vvn71cjKVzzYNZIs3R1Y2yJ7urvyWtE0dDtIZw3TR+AA4dfAa+Z5Qp9aAe6dzrIXirGfsT53dPnxrkxLkEpCSeXIsY05UMlcNvZg8vylp5CmQE1pzTIu40yZF1XabERfbxWgesNnA+JSgGOD5dzYiKYTzrcNKEA56w1XvjJK5lnvfvTcYSisWRzP2wuHcTYTkFmhHAHz+fwtNm1KffQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YtoHFhMUsUzaVRRjPM00cMW6QtvkURZu9YUXQqZntcRrkf2gf+Pd9Nl1K2N81AT2gCEd/t2lnHGdiBffLDQovZZydWSQFC7PCsgsvGoSHzLO++K9aJZ8/vVoejlln5srqJLO55tAiLW8ABKwU7mq3hYoB/6A4QpSu4qxwbfB3Dojw0y76/8xGdmGDQCYY3RYVEedWsYhrHXh6+mrXXplJN5X6A2RQSrOXCfvMjI94xRPLc8OgtyV8gud6nlSj76ucmy5qy+m3zfPLIENukv3gOFNxVzy0GbUzdf9MQ+e0cs+SJsyZ/RHL1Gy+zVZLftBpsvCpH7s2fVend/ifPb2tQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: marmarek@xxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 30 Mar 2023 16:18:11 +0000
  • Ironport-data: A9a23:g6RGqavLWZEboSUg8x9Mo3aDR+fnVGtfMUV32f8akzHdYApBsoF/q tZmKWyBbvjcYGbyeN5/aY23o0NXvMOAmt42GwNupXszRSpG+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj6Fv0gnRkPaoQ5ASFzyFOZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwCS02LQyfpNiNxq/rbuxO2ugjNfPAFdZK0p1g5Wmx4fcOZ7nmGv2Pz/kHmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ouiP60aIq9lt+iHK25mm6Co W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiANlKS+Llqq8CbFu7yWAIAhQXCkKCvLql0kWVZOlYD mJIw397xUQ13AnxJjXnZDW6qnOZuh8XW/JLDvY3rgqKz8L85g+DA2EeQz1pado4tdQ3Tzgny l+ImdzyATVl9raSTBq15rqS6D+/JyURBWsDfjMfCxsI5cH5p4M+hQ6JScxseJNZlfXwEDD0h jqM8y43guxLidZRjv3ru1fanziru57FCBYv4RnaVX6k6QU/Y5O5Y4uv6h7Q6vMowJulc2Rtd UMsw6C2hN3ix7nW/MBRaI3hxI2U2ss=
  • Ironport-hdrordr: A9a23:4Onv36DEKzvPfjTlHela55DYdb4zR+YMi2TDt3oddfWaSKylfq GV7ZImPHrP4gr5N0tOpTntAse9qDbnhPxICOoqTNCftWvdyQiVxehZhOOP/9SjIVyaygc078 xdmsNFebnN5DZB7PoT4GODYqkdKNvsytHXuQ8JpU0dPD2DaMtbnndE4h7wKDwOeOHfb6BJaa Z14KB81kKdUEVSVOuXLF8fUdPOotXa/aiWHSLvV3YcmXKzZSrD0s+BLySl
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Mar 30, 2023 at 06:07:57PM +0200, Jan Beulich wrote:
> 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.

I will only take care of multiboot2, since I don't have a way to test
xen.efi ATM.

> >> 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.

Right, that's what I was missing.  I assumed that all modes available
in GOP would be compatible with the ConOut mode.

Would you be OK with leaving StdOut as-is when booted from multiboot2,
or there's a chance of things not being properly setup?

IMO it's not very friendly to change the StdOut mode if not explicitly
requested, as in the multiboot2 case that gets setup by the
bootloader.

Thanks, Roger.



 


Rackspace

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