All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: marmarek@invisiblethingslab.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/5] efi: only set a console mode if the current one is invalid
Date: Thu, 30 Mar 2023 18:17:36 +0200	[thread overview]
Message-ID: <ZCW2IHKP4GHNmBuk@Air-de-Roger> (raw)
In-Reply-To: <50fe2ff9-9633-1cbb-4afb-b577778d3edd@suse.com>

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.


  reply	other threads:[~2023-03-30 16:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 15:45 [PATCH 0/5] gfx: improvements when using multiboot2 and EFI + misc Roger Pau Monne
2022-11-23 15:45 ` [PATCH 1/5] x86/platform: introduce hypercall to get initial video console settings Roger Pau Monne
2022-12-05 13:00   ` Jan Beulich
2022-11-23 15:45 ` [PATCH 2/5] efi: only set a console mode if the current one is invalid Roger Pau Monne
2022-12-05 14:19   ` Jan Beulich
2023-03-30 15:44     ` Roger Pau Monné
2023-03-30 16:07       ` Jan Beulich
2023-03-30 16:17         ` Roger Pau Monné [this message]
2023-03-31  6:51           ` Jan Beulich
2023-03-31  7:37             ` Roger Pau Monné
2023-04-03 11:03               ` Jan Beulich
2022-11-23 15:45 ` [PATCH 3/5] efi: try to use the currently set GOP mode Roger Pau Monne
2022-12-05 14:32   ` Jan Beulich
2022-11-23 15:45 ` [PATCH 4/5] multiboot2: parse console= option when setting " Roger Pau Monne
2022-12-05 15:10   ` Jan Beulich
2022-12-05 16:01     ` Jan Beulich
2022-12-13 11:41     ` Daniel Kiper
2023-03-29 16:29     ` Roger Pau Monné
2023-03-30  6:24       ` Jan Beulich
2023-03-30  8:11         ` Roger Pau Monné
2023-03-30  8:52           ` Jan Beulich
2022-11-23 15:45 ` [PATCH 5/5] multiboot2: parse vga= " Roger Pau Monne
2022-12-05 16:26   ` Jan Beulich
2022-11-24  5:15 ` [PATCH 0/5] gfx: improvements when using multiboot2 and EFI + misc Marek Marczykowski-Górecki
2022-11-24  8:11   ` Jan Beulich
2022-11-24  8:59   ` Roger Pau Monné
2022-11-24  9:56     ` Roger Pau Monné
2022-11-24 15:00       ` Marek Marczykowski-Górecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCW2IHKP4GHNmBuk@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.