On Thu, Mar 30, 2023 at 08:24:20AM +0200, Jan Beulich wrote:
> On 29.03.2023 18:29, Roger Pau Monné wrote:
> > 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?
> 
> There isn't. If you want to get away without conditional branch, then
> you'll need to LEA to a scratch register (unconditional) and then
> CMOVcc from that scratch register.

Likely not worth it, unless you dislike the extra conditional branch.

Thanks, Roger.

Reply via email to