2023-01-10 11:52:11

by Ingo Molnar

[permalink] [raw]
Subject: Re: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm


* Peter Zijlstra <[email protected]> wrote:

>
> With 'GNU assembler (GNU Binutils for Debian) 2.39.90.20221231' the
> build now reports:
>
> arch/x86/realmode/rm/../../boot/bioscall.S: Assembler messages:
> arch/x86/realmode/rm/../../boot/bioscall.S:35: Warning: found `movsd'; assuming `movsl' was meant
> arch/x86/realmode/rm/../../boot/bioscall.S:70: Warning: found `movsd'; assuming `movsl' was meant
>
> arch/x86/boot/bioscall.S: Assembler messages:
> arch/x86/boot/bioscall.S:35: Warning: found `movsd'; assuming `movsl' was meant
> arch/x86/boot/bioscall.S:70: Warning: found `movsd'; assuming `movsl' was meant
>
> Which is due to:
>
> PR gas/29525
>
> Note that with the dropped CMPSD and MOVSD Intel Syntax string insn
> templates taking operands, mixed IsString/non-IsString template groups
> (with memory operands) cannot occur anymore. With that
> maybe_adjust_templates() becomes unnecessary (and is hence being
> removed).
>
> More details: https://sourceware.org/bugzilla/show_bug.cgi?id=29525
>
> Fixes: 7a734e7dd93b ("x86, setup: "glove box" BIOS calls -- infrastructure")
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> ---
> arch/x86/boot/bioscall.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/arch/x86/boot/bioscall.S
> +++ b/arch/x86/boot/bioscall.S
> @@ -32,7 +32,7 @@
> movw %dx, %si
> movw %sp, %di
> movw $11, %cx
> - rep; movsd
> + rep; movsl
>
> /* Pop full state from the stack */
> popal
> @@ -67,7 +67,7 @@
> jz 4f
> movw %sp, %si
> movw $11, %cx
> - rep; movsd
> + rep; movsl
> 4: addw $44, %sp

So I think the GAS change to introduce this warning was probably
unnecessary - these instructions weren't really causing any trouble and the
syntax was basically a legacy thing that shouldn't be touched - but I guess
that argument is water down the bridge now:

Reviewed-by: Ingo Molnar <[email protected]>

Thanks,

Ingo


2023-01-11 23:20:53

by H. Peter Anvin

[permalink] [raw]
Subject: Re: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm

On January 10, 2023 3:35:50 AM PST, Ingo Molnar <[email protected]> wrote:
>
>* Peter Zijlstra <[email protected]> wrote:
>
>>
>> With 'GNU assembler (GNU Binutils for Debian) 2.39.90.20221231' the
>> build now reports:
>>
>> arch/x86/realmode/rm/../../boot/bioscall.S: Assembler messages:
>> arch/x86/realmode/rm/../../boot/bioscall.S:35: Warning: found `movsd'; assuming `movsl' was meant
>> arch/x86/realmode/rm/../../boot/bioscall.S:70: Warning: found `movsd'; assuming `movsl' was meant
>>
>> arch/x86/boot/bioscall.S: Assembler messages:
>> arch/x86/boot/bioscall.S:35: Warning: found `movsd'; assuming `movsl' was meant
>> arch/x86/boot/bioscall.S:70: Warning: found `movsd'; assuming `movsl' was meant
>>
>> Which is due to:
>>
>> PR gas/29525
>>
>> Note that with the dropped CMPSD and MOVSD Intel Syntax string insn
>> templates taking operands, mixed IsString/non-IsString template groups
>> (with memory operands) cannot occur anymore. With that
>> maybe_adjust_templates() becomes unnecessary (and is hence being
>> removed).
>>
>> More details: https://sourceware.org/bugzilla/show_bug.cgi?id=29525
>>
>> Fixes: 7a734e7dd93b ("x86, setup: "glove box" BIOS calls -- infrastructure")
>> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
>> ---
>> arch/x86/boot/bioscall.S | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- a/arch/x86/boot/bioscall.S
>> +++ b/arch/x86/boot/bioscall.S
>> @@ -32,7 +32,7 @@
>> movw %dx, %si
>> movw %sp, %di
>> movw $11, %cx
>> - rep; movsd
>> + rep; movsl
>>
>> /* Pop full state from the stack */
>> popal
>> @@ -67,7 +67,7 @@
>> jz 4f
>> movw %sp, %si
>> movw $11, %cx
>> - rep; movsd
>> + rep; movsl
>> 4: addw $44, %sp
>
>So I think the GAS change to introduce this warning was probably
>unnecessary - these instructions weren't really causing any trouble and the
>syntax was basically a legacy thing that shouldn't be touched - but I guess
>that argument is water down the bridge now:
>
> Reviewed-by: Ingo Molnar <[email protected]>
>
>Thanks,
>
> Ingo

Yeah; looks like a gas bug/regression, but there isn't really any reason not to fix it.

The semicolon after rep isn't needed anymore either ;)

Acked-by: H. Peter Anvin (Intel) <[email protected]>