From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by sourceware.org (Postfix) with ESMTPS id 5A0713858D33 for ; Tue, 6 Feb 2024 11:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A0713858D33 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 5A0713858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707219404; cv=none; b=tY1y3tpIwTUYQBPZJ6KxEi6S/EgJcyNA2deYxUdRCoRNxJIX3iC1klSXKdzzk35IWXRpDP4pzj8qbvjYiBwfI6Iw9YN+uF+eCOB9w5yOMAri1W5CPgsAzABVNLaBnuqCC+Yok6TtRpUXbyMQ+fdtVE0e6QOsUEQImgCv9XZdOCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707219404; c=relaxed/simple; bh=S77gtqrhtfeeJpFKH3R49a10J+j6mEqKnzGJECZelTI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Q2FcuU7ATwakzZ2H4azlUnYhpiuDZdm/3jViX834id3/eHkxIcjidIZEdkFNBNwQ7V6El55YrlcWlwMxMma856GDKfBjmlcrtXE1WnldT28wcZ0804M9lJ+EgNNRqbj9QDz3IyrPKd6hmhE8yujL0gItu9IinQE34Deh1Iu1FJM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-60481f30c2dso2658797b3.2 for ; Tue, 06 Feb 2024 03:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707219402; x=1707824202; 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=FEhsf977kgssi+vm/E6InU1xs35baLY6vpVR7k8Pelo=; b=XQfCdwK5escp6vm5JKVTzIeNTMk4WDH2SaYsYq4nATAAKWRlwM594iLW7EBy7Khyfe DpTxiUHgS7sihZwZRgMv5Pq7xQzjixtCB8xKQ+/7KjfJrhRP5HMvoJ9uKAQUAv3vROjI EfIrdzovmXy5J1q9y2kiLbRqShm6jtqp+IC5BcC6T4BB2w2HBQHXANn3Vw6zpEBmOli7 mq/05fA7RkKRRjRtZfwTATjFYd2EAUKXyobAr4XjdrsT6zRHjb3xgGPw4z0nG/QhHs3h N5l9QsXceL/oPdXjDvxKNZPo5nIIAJDeFPtNmuIVBBjAdz0vzl4oeMDLyEd1zI58C7Q2 axzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707219402; x=1707824202; 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=FEhsf977kgssi+vm/E6InU1xs35baLY6vpVR7k8Pelo=; b=FlnHVSlcL6ZF07R1Hb8gJ1SJGd00fZOR20rRTVm89tQCizZKGNJzWPAgSjUAZ6L20s lUWOZrhfS6/Z+zEXTwdfBOu0I9vhyoPE0T8a5n2J3n/XcCNYzJIcnm5GbP5xitrfKcdZ 1Sbm9we+482cygtVQJ6mBBxywbF0YpWYbB4rKNHUdvho65C05q/FocOT3P7XRL17jsQk 4Kc9LwTKAaxnkXKZIY5+rxYJ4DIONUzMOvdpfVgLyeG0nKINaZQEdzErXOAuaZnzVfhb cceWyqZSHZ2R1dJ8J/Qt+KMO1GEwlQwY4FT03tNqNtDV58gl2EFiYchlpU8yrXA3s8r/ 1L6A== X-Gm-Message-State: AOJu0YyBk5I1vtB7RlaQqjMIVSnpDrCxdhdQdY3sxC2eA5yQCKbFZfNx u6tsXG3yYl+LvRTZF7CsLV0ObdoZeBrHt7oZIRp3/reVv2VGnz+Kaw1f2+PumxzbchTawDpoQHm bP4zISvjJiKH3EIN8kBOsuFvueHY= X-Google-Smtp-Source: AGHT+IFDzitK5JOw3c7GyfH6eANMqjIJc1Sf6IaSMvp297MnqPYKy1EdnbUHqWDIWNrpG04MxV4RuPWlewRiBa4A9ug= X-Received: by 2002:a25:bfc6:0:b0:dc6:d2b0:95cb with SMTP id q6-20020a25bfc6000000b00dc6d2b095cbmr1164167ybm.57.1707219402565; Tue, 06 Feb 2024 03:36:42 -0800 (PST) MIME-Version: 1.0 References: <20240205200028.219844-1-hjl.tools@gmail.com> <4b1c3da8-d218-460b-89e6-6844096ed393@suse.com> In-Reply-To: <4b1c3da8-d218-460b-89e6-6844096ed393@suse.com> From: "H.J. Lu" Date: Tue, 6 Feb 2024 03:36:06 -0800 Message-ID: Subject: Re: [PATCH] x86: Warn .insn instruction with length > 15 bytes To: Jan Beulich Cc: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3014.8 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 Tue, Feb 6, 2024 at 12:19=E2=80=AFAM Jan Beulich wro= te: > > On 05.02.2024 21:00, H.J. Lu wrote: > > Change .insn instruction with length > 15 bytes from error to warning. > > Thanks for doing this. FTAOD though - it addresses only half of my > concern. Besides .insn (where the concern was of general nature) I > also use > > bextr eax, fs:[eax*4], 0x11223344 > xacquire lock add qword ptr gs:[eax*8], 0x11223344 > > in testing of my own disassembler library. I expect to continue to > be able to avoid using .insn (and even more so .byte) when assembling > this code. IOW there will still need to be a way to also override > the defaulting to as_bad() when not using .insn. We issue a warning when something is wrong in input, but still manage to generate an instruction. This is an error case. > > --- a/gas/config/tc-i386.c > > +++ b/gas/config/tc-i386.c > > @@ -11780,8 +11780,14 @@ output_insn (const struct last_insn *last_insn= ) > > { > > j =3D encoding_length (insn_start_frag, insn_start_off, frag_mo= re (0)); > > if (j > 15) > > - as_bad (_("instruction length of %u bytes exceeds the limit o= f 15"), > > - j); > > + { > > + if (i.tm.mnem_off =3D=3D MN__insn) > > Please don't open-code dot_insn(). > Fixed in v2. --=20 H.J.