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

Re: [PATCH v3 1/3] multiboot2: parse vga= option when setting GOP mode


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 4 Jul 2023 12:54:50 +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=wfCVpSC+fn+ZuRimJA0iZdnw9KK8inwYWaNoCTxnk80=; b=PAjP/CEMiqIXFc4jX6L3FkEqTNXoaZPBAxaKc2JolOaaC6K2LYg7+kXnqI9dlNAoQ085/X/ONBt6H3zCuYLI+eV8S4xT0tTNckYaorAnXeTVun7einGHTSipF1A48mjygY8cQZ2FDqiq+s9kU7WxLTppeDq/1UBil8/a4wjHy76IvrCvfnYQXXWG3OhCBVYJqqnrYp2Lja6pU8Z8ZE7mxnYrqoaWOEQpsuuLKMHoR8vR6UXc5ov8p2Y8I/Kzof7o8dD2hlobkZDLnkN+NX6Rcbjc5cvocbiIx5gT6//KnSQceCGvcJHYfSHkQLL+TaYl8UCivNkiIUES1yddMg3GMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mx4AP+2zc3UQKuNfSc0ietpH/xLeLDUBatiVZT4EHWaiFlaPvxC37jQ+GaCYB5z27GcN/bABe7Z7JFGI8NMaJzT7X1ogThzZFcejFEFEX1mesEFbHqmbHlJhMeQUDBbe6zg1N86e7Q/Fzj6i3NGTAlSjf/9Op4eYt9/zdaXB4Mk2ilRR8OV0F/2D51Vx1LkictGW4AgmUdhNuVGaPdY33M8WLuhSpUofqjat8QLsfGGfjeWinYcZYeCLugaudGpxlICQgXej/CrHHQzpwXKuuylq/b76MUpZnfkXXSYoxwB0fEV5ypjDq5CzsKSx0kIOP+Rv7IWowSNh8gV2xzatMA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 04 Jul 2023 10:55:26 +0000
  • Ironport-data: A9a23:LUe3MKIdrVsrgb+oFE+R95QlxSXFcZb7ZxGr2PjKsXjdYENS32YHm DcdWzjSPPmONDTyL4wjPY2ypBkBu5HRnIA3TQtlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QRiPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5nWFNq/ N4/CwwgSTqEg+y/nY2qePBV05FLwMnDZOvzu1lG5BSAVbMDfsqGRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dqpTGLlWSd05C0WDbRUsaNSshP2F6Ru 0rN/njjAwFcP9uaodaA2iv12bGRw3iiBOr+EpWCxvM0vQaty1UdUho0BEeG/Pzjo0iHDoc3x 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8Ul7Cmdx6yS5ByWbkAUQzgEZNE4ucseQT0xy kTPj97vHSZosrCeVTSa7Lj8kN+pES0cLGtHYDBeSwIAuoHnuNtq1kuJSct/GqmoiNGzASv33 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNfNi1CAgbQD0ct9EQ==
  • Ironport-hdrordr: A9a23:Maai6KuI6hdekNV6MBOJ126t7skDU9V00zEX/kB9WHVpm62j9/ xG+c5x6faaslgssR0b6LW90cq7Lk80l6QV3WB5B97LNmSLhILPFvAa0WKL+UyGJ8TQzJ8+6U 4KSdkbNDSfNykBse/KpCW+DtY80J2m3cmT9JrjJzwEd3ANV0ga1XYbNu9DKDwPeOCRP+tDKK ah
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jun 07, 2023 at 11:41:24AM +0200, Jan Beulich wrote:
> On 01.06.2023 15:05, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/boot/head.S
> > +++ b/xen/arch/x86/boot/head.S
> > @@ -329,7 +337,8 @@ __efi64_mb2_start:
> >  
> >          /*
> >           * efi_multiboot2() is called according to System V AMD64 ABI:
> > -         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable.
> > +         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable,
> > +         *          %rdx - MB2 cmdline
> >           */
> >          call    efi_multiboot2
> 
> All you obtain is a pointer to the string, which is fine from what I
> was able to establish, but that's not entirely obvious: The MBI
> structure used has a size field, so it could have been that the
> string isn't nul-terminated, and hence the size would also need
> passing. May I ask that this be mentioned at least in the description?

Sure.  The multiboot2 specification already states that the string
must be zero terminated.  It's my understanding the size field is part
of all the tags, so that a parser can find the next tag even if it
doesn't know how to parse the current one.

> > --- a/xen/arch/x86/efi/efi-boot.h
> > +++ b/xen/arch/x86/efi/efi-boot.h
> > @@ -786,7 +786,30 @@ static bool __init 
> > efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> >  
> >  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN 
> > size) { }
> >  
> > -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
> > *SystemTable)
> > +/* Return the first occurrence of opt in cmd. */
> > +static const char __init *get_option(const char *cmd, const char *opt)
> > +{
> > +    const char *s = cmd, *o = NULL;
> > +
> > +    if ( !cmd || !opt )
> > +        return NULL;
> > +
> > +    while ( (s = strstr(s, opt)) != NULL )
> > +    {
> > +        if ( s == cmd || *(s - 1) == ' ' )
> 
> Iirc I had asked before: Not allowing for at least tab? (See
> cmdline.c:delim_chars_comma[] for what the non-EFI parsing permits,
> which in turn might be going a little too far especially with
> permitting comma as well.)

I've fixed this when parsing the gfx- option but not here, sorry.

> 
> > +        {
> > +            o = s + strlen(opt);
> 
> I don't think the comment ahead of the function describes this
> behavior, i.e. in particular the adding of the length of the
> option.

I've changed the comment to:

Return a pointer to the character after the first occurrence of opt in cmd.

Thanks, Roger.



 


Rackspace

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