The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
@ 2023-01-10 11:15 Peter Zijlstra
  2023-01-10 11:35 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Zijlstra @ 2023-01-10 11:15 UTC (permalink / raw)
  To: x86, linux-kernel


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) <peterz@infradead.org>
---
 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
 
 	/* Restore state and return */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
  2023-01-10 11:15 x86/boot: Avoid using Intel mnemonics in AT&T syntax asm Peter Zijlstra
@ 2023-01-10 11:35 ` Ingo Molnar
  2023-01-11 22:59   ` H. Peter Anvin
  2023-01-10 11:36 ` Borislav Petkov
  2023-01-10 12:26 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2023-01-10 11:35 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel, H. Peter Anvin, Borislav Petkov


* Peter Zijlstra <peterz@infradead.org> 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) <peterz@infradead.org>
> ---
>  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 <mingo@kernel.org>

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
  2023-01-10 11:15 x86/boot: Avoid using Intel mnemonics in AT&T syntax asm Peter Zijlstra
  2023-01-10 11:35 ` Ingo Molnar
@ 2023-01-10 11:36 ` Borislav Petkov
  2023-01-10 14:01   ` David Laight
  2023-01-10 12:26 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2023-01-10 11:36 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel

On Tue, Jan 10, 2023 at 12:15:40PM +0100, Peter Zijlstra 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

Right, I'm being told the particular problem here is is that the 'd' suffix is
"conflicting" in the sense that you can have SSE mnemonics like movsD %xmm...
and the same thing also for string ops (which is the case here) so apparently
the agreement in binutils land is to use the always accepted suffixes 'l' or 'q'
and phase out 'd' slowly...

Which is basically what the PR text says above but more understanable. :-)

Might wanna add that to the commit message.

> Fixes: 7a734e7dd93b ("x86, setup: "glove box" BIOS calls -- infrastructure")
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  arch/x86/boot/bioscall.S |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

In any case

Acked-by: Borislav Petkov (AMD) <bp@alien8.de>

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip: x86/urgent] x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
  2023-01-10 11:15 x86/boot: Avoid using Intel mnemonics in AT&T syntax asm Peter Zijlstra
  2023-01-10 11:35 ` Ingo Molnar
  2023-01-10 11:36 ` Borislav Petkov
@ 2023-01-10 12:26 ` tip-bot2 for Peter Zijlstra
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2023-01-10 12:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Peter Zijlstra (Intel), Ingo Molnar, Borislav Petkov (AMD), x86,
	linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     7c6dd961d0c8e7e8f9fdc65071fb09ece702e18d
Gitweb:        https://git.kernel.org/tip/7c6dd961d0c8e7e8f9fdc65071fb09ece702e18d
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Tue, 10 Jan 2023 12:15:40 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 10 Jan 2023 13:03:23 +01:00

x86/boot: Avoid using Intel mnemonics in AT&T syntax asm

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

Borislav Petkov further explains:

  " the particular problem here is is that the 'd' suffix is
    "conflicting" in the sense that you can have SSE mnemonics like movsD %xmm...
    and the same thing also for string ops (which is the case here) so apparently
    the agreement in binutils land is to use the always accepted suffixes 'l' or 'q'
    and phase out 'd' slowly... "

Fixes: 7a734e7dd93b ("x86, setup: "glove box" BIOS calls -- infrastructure")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/Y71I3Ex2pvIxMpsP@hirez.programming.kicks-ass.net
---
 arch/x86/boot/bioscall.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/bioscall.S b/arch/x86/boot/bioscall.S
index 5521ea1..aa9b964 100644
--- a/arch/x86/boot/bioscall.S
+++ b/arch/x86/boot/bioscall.S
@@ -32,7 +32,7 @@ intcall:
 	movw	%dx, %si
 	movw	%sp, %di
 	movw	$11, %cx
-	rep; movsd
+	rep; movsl
 
 	/* Pop full state from the stack */
 	popal
@@ -67,7 +67,7 @@ intcall:
 	jz	4f
 	movw	%sp, %si
 	movw	$11, %cx
-	rep; movsd
+	rep; movsl
 4:	addw	$44, %sp
 
 	/* Restore state and return */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
  2023-01-10 11:36 ` Borislav Petkov
@ 2023-01-10 14:01   ` David Laight
  0 siblings, 0 replies; 6+ messages in thread
From: David Laight @ 2023-01-10 14:01 UTC (permalink / raw)
  To: 'Borislav Petkov', Peter Zijlstra
  Cc: x86@kernel.org, linux-kernel@vger.kernel.org

From: Borislav Petkov
> Sent: 10 January 2023 11:37
> 
> On Tue, Jan 10, 2023 at 12:15:40PM +0100, Peter Zijlstra 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
> 
> Right, I'm being told the particular problem here is is that the 'd' suffix is
> "conflicting" in the sense that you can have SSE mnemonics like movsD %xmm...
> and the same thing also for string ops (which is the case here) so apparently
> the agreement in binutils land is to use the always accepted suffixes 'l' or 'q'
> and phase out 'd' slowly...
> 
> Which is basically what the PR text says above but more understanable. :-)
> 
> Might wanna add that to the commit message.

Can they be changed to movsq ?
movsl has an implied 32bitness about it.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
  2023-01-10 11:35 ` Ingo Molnar
@ 2023-01-11 22:59   ` H. Peter Anvin
  0 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2023-01-11 22:59 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: x86, linux-kernel, Borislav Petkov

On January 10, 2023 3:35:50 AM PST, Ingo Molnar <mingo@kernel.org> wrote:
>
>* Peter Zijlstra <peterz@infradead.org> 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) <peterz@infradead.org>
>> ---
>>  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 <mingo@kernel.org>
>
>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) <hpa@zytor.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-11 22:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 11:15 x86/boot: Avoid using Intel mnemonics in AT&T syntax asm Peter Zijlstra
2023-01-10 11:35 ` Ingo Molnar
2023-01-11 22:59   ` H. Peter Anvin
2023-01-10 11:36 ` Borislav Petkov
2023-01-10 14:01   ` David Laight
2023-01-10 12:26 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox