From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id A151A3858C5F for ; Thu, 8 Feb 2024 08:15:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A151A3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A151A3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707380128; cv=none; b=HhQ4pQJj/qaJD+2bUKXJ+I90B9vPWa7kqeI6DyE80fSmkd/B7mAXxs/8pHLeCjw0hJQiXPZgaA7wfutHM4rJ8SEcDeTSthBEejnTDeO/xZk2+smUHyQzph3rqPnrgDG+DotIqsM1/0eR8BxEkrvHwggiV9cJ44rMexFEVQt2RIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707380128; c=relaxed/simple; bh=9rqcuet+tqHP5xfvXvNSY2d9oUo5MYYnwzhEUlqGGNc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=UupbmwOhFigJk3Phnx7tZNIk1AdmyYWhBAnUdfsTah/ph8hCng8rUZCWLjAVW5Vwaes+/C3I3DEvieTW/CMxc2f9sxLr0yCnD4suxXqslImn8Gy69S3V3XnOGxnyHEoCcUWwb/jzd1BmEZGEVtq7mZs7/HDr/dKWZgI9VBNyWS0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-410489e1a63so97995e9.3 for ; Thu, 08 Feb 2024 00:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1707380121; x=1707984921; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jvroLTuQTHnB2oSPLT9wMcmdQHsPrd4IB1SR0sUR5Sw=; b=XKrBEd5spW27TrCpy3CC5vaz5BeIIqJeJ5BvyhpnhVPd5Zq5VbUJbx2LrmN9DmGf4f ZpgvKNldPydBHrWBehpoOxbF5JTLJhAL4aHc4TD8HQIixATw0OlVqHNimlZEhkUjQkP6 ltLi4v4jxGA9RHMwC1r1ErttAAHbzSyrGkWX99yV3A6uBx8reCmYqDaGVUuaBTGb2QlW rz2L5rWKIeW5OZJYdBmrNdkyrj2erazWD96Us6D878HetcxpUzxe2FTljeN+rh+J6JhX Wkb1w8knlP+TMqO3Fm49PPEtYfWIsLOgOKEQG+bpcRmbckomP6a5Vpk7sOpWmRNjjrO6 a5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707380121; x=1707984921; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jvroLTuQTHnB2oSPLT9wMcmdQHsPrd4IB1SR0sUR5Sw=; b=sYXJEse2Y4M8i9G96SH5jtAlTr2JoxnBdVhn47CbVWNd2iOq2WFwy1jQR62C/pRnrz GDEYO5CTor1P47xNfRk+s/23zjC79NkJRbQu6J8avs6Ye0MRGgsH3O5bPxHoYxRkhpVB K9ueIpFDuyRWQbDiIfwCT9OcaE+Ae1Q2qemQsXuH9vBTE0wZqTS3NDFD/2xNEhxrIX4B EB/IdKwaEomsvAPJtexkiXxmkhFsOEpYwgYMpJoi0wYIDkjOoqIeEE3SIC8mulEXSr43 d1T6MQcszi3e+Utu8dkY84/sdKxM1zlvr5gm/f7/FAzbIjzSwlNzA+TmF86k1xw6NxQ+ vlsQ== X-Forwarded-Encrypted: i=1; AJvYcCUAfdovIJOlmcToJpV6fTYv6VvCDUqP1W2DW9ks4YK+/+4ETRsnGjErsmfurHx6JuV3utWzI0ijDaQY0F8KID/CxSMiNgfPIQ== X-Gm-Message-State: AOJu0YwMqNapX22pUaRIbyyTTVBPxbIo8Ui6kvtNrzjzs89vADTXBaq6 21eRnfSL8zxTyB3gBmXaZsm6QZIfijjXtKgGYbKfvdjIIG/MekXrpUmeEaCa9hyhvyiQnLTCXz8 = X-Google-Smtp-Source: AGHT+IH8POOhCXX8mChxa16zj1/nm8YEEVTmy7m4WV91KTNM+JlcJJWA+uvHH13efkH5wn/T8d9CJw== X-Received: by 2002:a05:600c:444a:b0:40f:afa9:7f1 with SMTP id v10-20020a05600c444a00b0040fafa907f1mr6331147wmn.22.1707380121434; Thu, 08 Feb 2024 00:15:21 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUws37mxmywrrd3WSZtOZd7TB0DeWF/ftUAz8RqZc5+u2eiPW4k4aE4n8aXgQpYzXQXLzSp2p+8i9cgv6fNecKtIAecIXSaGllp6d7ZDqrXYy60ZYPdj6DkVFTwud6pPsZkxomCIffLsSAPMz4RMQ== Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id l19-20020a05600c47d300b0040fc2f07ed5sm855390wmo.27.2024.02.08.00.15.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Feb 2024 00:15:21 -0800 (PST) Message-ID: Date: Thu, 8 Feb 2024 09:15:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86: Warn .insn instruction with length > 15 bytes Content-Language: en-US To: Hongyu Wang , "Jiang, Haochen" Cc: "H.J. Lu" , "binutils@sourceware.org" , Michael Matz References: <20240205200028.219844-1-hjl.tools@gmail.com> <8059bdee-392a-b9cd-41d5-8dea538c957c@suse.de> <2721d4bc-e29f-4ed1-8fac-064fe0711029@suse.com> <93ef6fde-42aa-485a-8b22-f2c1f1d52efa@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3025.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 08.02.2024 05:47, Hongyu Wang wrote: >> as_bad() is used to mark errors that result in what we >> presume to be a useless object file. Say, we ignored >> something that might have been vital. >> ... >> >> as_warn() is used when we have an error from which we >> have a plausible error recovery. eg, masking the top >> bits of a constant that is longer than will fit in the >> destination. In this case we will continue to assemble >> the source, although we may have made a bad assumption, >> and we will produce an object file and return normal exit >> status (ie, no error). >> ... >> >> It's obvious to me that just continuing to assemble the over-long >> instruction is a "plausible error recovery". It's even more plausible >> than "masking the top bits of a constant". Certainly an object file >> containing a byte sequence correspending to the overlong instruction is >> not "useless". > > We have encountered such issue when running APX workloads with SDE. > The over-long instruction became either illegal or wrong instruction > when executing the program, then it crashes after long time running. > This definitely increases much effort for runtime diagnostics. Well, that's what you get for not paying attention to diagnostics. They aren't emitted just for fun. Jan > As the over-long instruction would actually break the program, say the > object crashes or returns with abnormal exit status, the default > should be an error for assembler and we can add an option to lower the > error to warning.