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

Re: [PATCH 4/5] multiboot2: parse console= option when setting GOP mode


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 29 Mar 2023 18:29:07 +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=j/hf9iMuXvPEwEJIrbkvmsceAV6+KICMdxj4UgfOnBw=; b=nNTiwI4XrsJpglIDiXEmJLhNdtT7KfyIPyS+EN2keIjZUTDilNcUuY98E0IsN2sQafDaNvRzhnfZsmW7SKb7jRnBADRw1VxLec+KVC0lukn9HlOU9XIiEFHBfRKn0DKlSDqTZzu11BFv8dWPMCrD57T3gcPcPnXk4SS4OAvV66U8aC9eDxgrJm6wt9JSXFtqD0Asjv1hBeR7P2G6SoY+yue5FGtSsI/L0EtFofeWLh8gT6+4E5Zd5/1WqkhY0xO1SUoQ8O6UVB4uorv5BKp+nbFjdTeHcXCdNa9SRG6GOzavVIlsOYlCu+ByXYEC6ek4vUFI0qnU2v/bhg9YBjsGpA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Knc1amvfZU79ofvohnGl9Y8E961Yo0rumjKQJkRPk7YXpHFr3Chb2oZla25QafAIsIyEEatr/IzfXDwQY5zEooMB99iQ4xR6ll4sV12KB6DtgwGv4LHF//l5Z/0hhZJk43C1+mMdTxOtmRa3pogEQX08oVYLuiz4G4jT+yDievtKiCDx20oyWOMf5pJPPQ8Hocs8aA8MRa89QRL+hiIztOFos4XL4LfICUle8amu5ih/Ccq+egMgLm8E6JyV4rdszb/eTy/94Qb6K1WlxoF/2FazLC/jTutc01Z/wy53gzmPqeZJxzKpDo1YWV4CfRyEr6rTd1/h6+bh8k9UowUAGw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: marmarek@xxxxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Daniel Kiper <daniel.kiper@xxxxxxxxxx>
  • Delivery-date: Wed, 29 Mar 2023 16:29:42 +0000
  • Ironport-data: A9a23:pe8VXa29EQh2asXtdvbD5Qpwkn2cJEfYwER7XKvMYLTBsI5bp2YDy msWXzrQaPjZY2rwe9okPdi09kgC7cDcydY1HAs5pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+HuDgNyo4GlD5gdkNKgR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfHXtt5 6FDJBs2cDPaoMW7+rChUMRCr5F2RCXrFNt3VnBI6xj8VKxjZK+ZBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxpvS6PkWSd05C0WDbRUsaNSshP2F6Ru 0rN/njjAwFcP9uaodaA2iv03bORw3qiBer+EpWf5O5Uq2bI2lYhMx4nFkG0rsCrqVWHDoc3x 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8U/4RuIw7DZ4C6YAHYFVT9LbNE6tM4wSicu3 1XPlNTsbRRwtJWFRHTb8a2bxRuiNC5QIWIcaCssSQoe/8KlsIw1lgjITNtoDOiylNKdMT35x TGHqG49hq0el+YMzayw+V2BiDWpzqUlVSYw7wTTG2e6tAVwYdf/Y5TysQSGq/FdMIyeU1+N+ mAenNST5/wPCpfLkzGRROIKH/ei4PPt3CDgvGOD1qIJr1yFk0NPt6gJiN2iDC+F6vo5RAI=
  • Ironport-hdrordr: A9a23:m5myaKjhasqsBV5CfNkmPwkRV3BQXiAji2hC6mlwRA09TyX5ra 2TdTogtSMc6QxhPE3I/OrrBEDuexzhHPJOj7X5Xo3SOTUO2lHYT72KhLGKq1Hd8kXFndK1vp 0QEZSWZueQMbB75/yKnTVREbwbsaW6GHbDv5ag859vJzsaFZ2J921Ce2Gm+tUdfng8OXI+fq DsgPZvln6bVlk8SN+0PXUBV/irnaywqHq3CSR2fiLO8WO1/EuV1II=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Dec 05, 2022 at 04:10:28PM +0100, Jan Beulich wrote:
> On 23.11.2022 16:45, Roger Pau Monne wrote:
> > @@ -265,6 +266,15 @@ __efi64_mb2_start:
> >          cmpl    $MULTIBOOT2_TAG_TYPE_END,MB2_tag_type(%rcx)
> >          je      .Lrun_bs
> >  
> > +        /*
> > +         * Get command line from Multiboot2 information.
> > +         * Must be last parsed tag.
> 
> Why? And how do you guarantee this?

I think the comment is misleading, must be the last checked for tag in
the loop that does this in assembly, because it's not using cmove.
I've adjusted to:

        /* Get command line from Multiboot2 information. */
        cmpl    $MULTIBOOT2_TAG_TYPE_CMDLINE,MB2_tag_type(%rcx)
        jne     .Lno_cmdline
        lea     MB2_tag_string(%rcx),%rdx
        jmp     .Lefi_mb2_next_tag
.Lno_cmdline:

Maybe there's some instruction I'm missing similar to a conditional
lea?

> > --- a/xen/arch/x86/efi/efi-boot.h
> > +++ b/xen/arch/x86/efi/efi-boot.h
> > @@ -786,7 +786,22 @@ 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 last occurrence of opt in cmd. */
> 
> Is this sufficient in the general case (it may be for "console=", but
> perhaps not for "vga=", which may also need finding as per below)?

I guess for vga= it's possible to have something like:

vga=current vga=keep

And in that case we do care about the non-last option.

> > +static const char __init *get_option(const char *cmd, const char *opt)
> 
> Nit: The first * wants to move earlier.
> 
> > +{
> > +    const char *s = cmd, *o = NULL;
> > +
> > +    while ( (s = strstr(s, opt)) != NULL )
> 
> I'm afraid this is too easy to break without considering separators as
> well. If I'm not mistaken you'd also match e.g. "sync_console=1" for
> the sole present caller.

Right, wasn't taking into account that sync_console can also be a
boolean (and thus assigned).

> > +        }
> 
> Nit: No need for the braces in cases like this one.

I've added the braces here because it will be expended in the next
patch.  Since you asked for both patches to be merged this will go
away.

Thanks, Roger.



 


Rackspace

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