Message ID | Y71I3Ex2pvIxMpsP@hirez.programming.kicks-ass.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2697683wrt; Tue, 10 Jan 2023 03:48:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXuPtIK6VFIP+u2WFuVBmDDmg1CqOugNuzd7Km67NFQ10HB2/+qDvFp1NIuVCzF5B2/6vbKO X-Received: by 2002:a17:902:c10d:b0:186:8568:be7e with SMTP id 13-20020a170902c10d00b001868568be7emr74980545pli.15.1673351287904; Tue, 10 Jan 2023 03:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673351287; cv=none; d=google.com; s=arc-20160816; b=s/9hwEUqogKoyUgCdrHjDPdSpD/ZpSzutwPEi4RbW15zmJGK8UEa9snGVfbe3iyXBt SPlOeLu0UcBvapfK9cabfQ78Y9M3A+ETCQz+6CnHIbTuk7tOOWpzoWZ9iOKZR9KoWRxP WXKp9twcHbNIBxwEDCYf3YhpoORxHr+P+VBs4vw89ur7pRgdWAVCNTP+xsAB2h1K+ZM1 07+Qi1V5nq21lNunUpK1+IkNJAneCA7vIBZFYi8uYHCnPHinjr9yNIQadK2zPrZG4OZx MAm1p2IBMP74Ov6kn7uxmrvuqj6Kc+Sjtcttp8UypWm3P51XqJDyrMLh0sRZIizxW369 dJiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=LE4aoLbLilXnZV5T992f4wACX7I/Nfap/jSdsHEVTyA=; b=dA9wYiO6lKqd0Ypsoh/tbNWcUs9PtfFMQd4l/JnriGtEoZ0aH9tOPRMuZZfgKXEj42 Aqa6/7YXZzglj+6SvdLqvu6uskdWn72fFaeg8mmxwEAKtxT626RMhUX0gCzyn+jCHW/D 0KW4axBcP8kDA+qc0/pfT7rtTK+O4g9M2dlUi1PAorFXzbRvnUw4qWWY+q7RM19i10A8 ng8fNIne4RXBuw9tEaa++1ycKYbo1/nuv1NorZN4M28XO8gXEu5cZi6O8hphpeKuONZZ yFm3mUR39tuIrVCc84+5MqrNxbrn5Tx88zl2DkAMEVcJ24nDGBU9ILSDQhk1Okl5uCPu nNRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EHa5TH8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a170902ec8500b001930d8a834esi11888307plg.303.2023.01.10.03.47.55; Tue, 10 Jan 2023 03:48:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EHa5TH8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232535AbjAJLQk (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Tue, 10 Jan 2023 06:16:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232978AbjAJLPx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 10 Jan 2023 06:15:53 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2DC1401D for <linux-kernel@vger.kernel.org>; Tue, 10 Jan 2023 03:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=LE4aoLbLilXnZV5T992f4wACX7I/Nfap/jSdsHEVTyA=; b=EHa5TH8PV0WlrdxsvCA1d0mUch L1TyiuJlthwlNT79BsPtO/+5wiI5GvlTHBOFfo8h8/tgYGxJO+RipKRZbpGhkkpExvuNjFTr3GQat Z3am1FMzHfTBh6Vfl2uePihVv2cDJmKzSpnIr/G3un6GEz7lax7URU0O4YVVF1FULZ3H8DNu1oGt0 YbCkzY1Qas1Kwi65MLv+1+wAr+5QROUAJJ9ZZUMP8/9P1+BCatJ7mZa8xDlXq8ZUImvkjmLlO/LqW hCByYNY8h3ieuZtvABIl4j++RZNRmYek3bUitZg0q+tYkLyFnCpSvA17jrgE+yjT5Tux4AHjdDg7u x6mwh9xg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pFCbN-0036xL-2l; Tue, 10 Jan 2023 11:15:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 761E0300033; Tue, 10 Jan 2023 12:15:40 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 519EB2C539AFD; Tue, 10 Jan 2023 12:15:40 +0100 (CET) Date: Tue, 10 Jan 2023 12:15:40 +0100 From: Peter Zijlstra <peterz@infradead.org> To: x86@kernel.org, linux-kernel@vger.kernel.org Subject: x86/boot: Avoid using Intel mnemonics in AT&T syntax asm Message-ID: <Y71I3Ex2pvIxMpsP@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754636000015953714?= X-GMAIL-MSGID: =?utf-8?q?1754636000015953714?= |
Series |
x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
|
|
Commit Message
Peter Zijlstra
Jan. 10, 2023, 11:15 a.m. UTC
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(-)
Comments
* 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
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.
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)
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>
--- 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 */