From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by sourceware.org (Postfix) with ESMTPS id 3B0CA38582A1 for ; Wed, 7 Feb 2024 16:54:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B0CA38582A1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3B0CA38582A1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707324871; cv=none; b=MLcEKyw9xJ+VBFUurfP2v3hzfG/be9nqRA9VvP93NvQ08GNhNnlreROxBjF+LX+4t5TKWBLlPiy1VKWw060ulFr0t9yxkfktkC7GH5Ar1XnSt4FXq2yrwgBp0PKt4bqUpNo3lSxH34XH+NCvrizbhyIXDIOH7lJsXbjsBHo/IV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707324871; c=relaxed/simple; bh=s+C8fNgicKrjjvnGAfB4kMq1zG79T/B1++uIOpMXPcI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=NXOzGuNwh8ZFqYG1JygYytMQhR1AkuuAh3Ud0MppPv3VB5rXw2tNc3PDeJrQ1kfOPGnmmaYbM2VVJyGgRmCunSedcFU2eJp1oRqhO2hOejXuGvhpWYXiXMJMsP7/MSAZqgYM6IeI246olmsBUasIvyFyACvmirF/OGOeLkQ2S60= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dbed179f0faso3762276.1 for ; Wed, 07 Feb 2024 08:54:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707324868; x=1707929668; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hvzfLgy+SW7SYP6CE5n8iQHlQ/xOq/SXePRQF9clOFA=; b=EE97PjxCHZL6KZnqBdMjiGDOPKQwl1UyFtsWCxlfWJJacatbaxtHCOqmWcp81ZVIfB bI8aHBd7nCGuAwLveOnzHLYMh97DH8Io8AfBzWpliQVwVwdygzpUww6bV5adNb94IYP4 i4i5ln5wN8LfoN+oiIkDIT+U6NJaccJR8euXpq1SmP1j0+pnIg9XmMPya+dLrC8UsFF8 Yp2xcJAt4sRxVARm6p86jnnw8tCKVGcpl8ZM0owDFHHeoqoyfeE1uG9odEAv6+BZlmcz gtz9sbnvXmS/Uxs303nTVicrqNd0tX9caN/D06uh7cuMnRPhVpMTHnAKUkajHBxGtyXk ekdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707324868; x=1707929668; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hvzfLgy+SW7SYP6CE5n8iQHlQ/xOq/SXePRQF9clOFA=; b=JIeoi2M43qnHU7n/PgMjW/r2IZ+WKAjW15ivjcOp8HSvlrTfa/atImZn+nZBV25lSt rSl/VHXntX+40rxVHnvVdYSoK6XcjnwAxx1NtLeXZRtRYX9ip5J0EmVB92l0AAfKhIDN KKaC6QOYsOANixaz32+7ILT/zMQQillLlc7GnY3AW6wmNuPQeJWs6cMS5NLGTI7vw51h tEZUCFvVfFWo0ZLhaKQkbpakzIummNb48n+j76+fN5pvu6GbGvLXtA0ydVN5Vl9y0XSa X+qbwA3IPrph/+MHj9g/QKTGeF90YCs+1w2k7/Za+x5tqtU5+DqdZ209dCJkshhvJsaZ ePTA== X-Gm-Message-State: AOJu0Yyk92A02uCAxsu6z7rQNv0s6u1DbJ/xfIu2uD36TmcCOvjXcqro 9EZRbSGwqcTsxEitEdFy3TOSdRO0hdM+BCcF7b8XuSVbsl1IRCyqqVYOBBVE/ZWD5BrYSdD0l7o VbFysGx6hRcu8FK4bDEFrAFFNl6M= X-Google-Smtp-Source: AGHT+IHHnmp/j8BG9vEgnXGlQS0GR9u9rGsIfgLGMDX0GaRzNW5FgtpnplDFRBpbDTaoUVN3LboA9Bstad0UHc4xJrc= X-Received: by 2002:a25:30c3:0:b0:dbe:d2ec:e31 with SMTP id w186-20020a2530c3000000b00dbed2ec0e31mr30789ybw.27.1707324868535; Wed, 07 Feb 2024 08:54:28 -0800 (PST) MIME-Version: 1.0 References: <20240205200028.219844-1-hjl.tools@gmail.com> <4b1c3da8-d218-460b-89e6-6844096ed393@suse.com> <533a896f-8eec-b73b-cb18-26240ad822fc@suse.de> <8059bdee-392a-b9cd-41d5-8dea538c957c@suse.de> <2721d4bc-e29f-4ed1-8fac-064fe0711029@suse.com> <93ef6fde-42aa-485a-8b22-f2c1f1d52efa@suse.com> In-Reply-To: <93ef6fde-42aa-485a-8b22-f2c1f1d52efa@suse.com> From: "H.J. Lu" Date: Wed, 7 Feb 2024 08:53:52 -0800 Message-ID: Subject: Re: [PATCH] x86: Warn .insn instruction with length > 15 bytes To: Jan Beulich Cc: binutils@sourceware.org, Michael Matz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3014.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Feb 7, 2024 at 7:32=E2=80=AFAM Jan Beulich wrot= e: > > On 07.02.2024 16:24, H.J. Lu wrote: > > On Tue, Feb 6, 2024 at 11:51=E2=80=AFPM Jan Beulich = wrote: > >> > >> On 06.02.2024 19:06, H.J. Lu wrote: > >>> On Tue, Feb 6, 2024 at 9:05=E2=80=AFAM Jan Beulich wrote: > >>>> > >>>> On 06.02.2024 17:28, H.J. Lu wrote: > >>>>> With as_bad, assembler will continue to assemble, just not generate > >>>>> an object file. We ran into this with APX. Not everyone checks > >>>>> assembler warnings closely. It led to mysterious crashes. I am > >>>>> not against it if someone else implements an assembler option to > >>>>> turn this error into a warning. > >>>> > >>>> But it should be the other way around: The compiler could pass an > >>>> option to promote the (default) warning to an error. And if you > >>>> don#t pay attention to warning for assembly files, you could pass > >>>> the same option as well. Without harming anyone else with anything > >>> > >>> People who use/need instructions > 15 bytes belong to a very small > >>> minority. If they want to do it, they can use .insn or use binutlls = 2.41 > >>> or older. The default assembler isn't for them. > >> > >> No, staying on an old assembler isn't viable. And minority or not, you > >> have to face it: In the present discussion it is you who represents a > >> minority. As such I'm even inclined to suggest that your earlier patch > >> wants reverting, on the basis that it was put in despite there being > >> disagreement. Unless you soon come forward with an incremental change > >> undoing at least the worst of its effects ... > > > > Please tell me exactly which projects are negatively impacted by > > disallowing > 15 byte instructions. > > I already told you: I'm using such in testing of my personal disassembler > library. So, it is only you. You can either use .insn or add a switch to turn this error to warning. > >>>> that has worked before. > >>> > >>> The reason that we didn't run into the size limit before is that norm= al > >>> instruction usages never exceed the 15 byte limit before APX. > >> > >> Didn't I earlier give examples of "normal instructions" that have this > >> issue? I don't see anything "not normal" in insns using e.g. segment o= r > >> address size overrides. > >> > >> The impression I'm getting is that the problem originally was of no > >> interest to you because initially it affected AMD-specific insns only. > >> And the subsequent appearance of the same issue in HLE insns then was > >> mentally put off by you for being "too exotic" (and I partly agree > >> that _there_ one may indeed consider the example contrived). You only > >> started caring when it was an Intel extension which was noticeably > >> affected. Yet that's not the position you ought to take as a binutils > >> maintainer, imo. > > > > Assembler should generate decodable binaries for normal instructions > > even with a warning. > > See Michael's earlier response as to the wide variety of meanings of > "decodable". I'm actually of the opinion that objdump testing could also > do with a testcase as outlined above, and objdump could further do with > properly decoding such an encoding, while at the same time clearly > signaling that this doesn't look like an instruction that would > successfully execute. This is one of the many shortcomings of objdump > which keep me preferring my own disassembler for day-to-day work. And > while I'm striving to improve objdump, some of the issues would > apparently require an almost complete re-write, which I'm afraid is out > of scope for me. > > Jan --=20 H.J.