From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 69349384C93C for ; Tue, 6 Dec 2022 16:11:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69349384C93C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x232.google.com with SMTP id q186so17431675oia.9 for ; Tue, 06 Dec 2022 08:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qsyj69F94UwC9Sgun4Rr619HZ3fz2f8CNIxvmqCk4C4=; b=G0T6ynAi/aOpUCEX2vRPj1c37/XRCRXL0C/GkoEkpDRClxxQs/7PHmushbV3S+CoGp l+tGc9dqXQgPFkDejVvQ3clkyPcKIxZPSyBNBfTo/eA24DWcB5zJYetHC94L9p3VMKCm iWv2dHpRiEc0bG5TSRwS3llvVEaUX7dv8zB7PKJ4fKz4YbmrPfedpaM4EBJlsWBdAqV0 0MfoRaBwO+dqBWpJ8vlmxGa5HqQA1o8MqaVVnqEuqgWC8Z9yyS4+ZxpCkyQWPFoChRPb CgYSmMa2Wu+TDMvvPz93UC/X8cUqg3rtEL/c/YdbsBew3bWTnge7rmgIeKH48bZDA5DI 0Zog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=Qsyj69F94UwC9Sgun4Rr619HZ3fz2f8CNIxvmqCk4C4=; b=pSdW7WCiO4ipCzhQylP/rI01gPr5viUy1JUs11IIjlrZf7PP0ZpqvXFvRx6oY4iUxX MwMjE1AsMjSC8WGKcEZFEb9UYJ0Mc0IKHMiXn44JAD44zcBeirSHVk63E246tkZz6/bL F+y9777SgGSXo9zZCltXktxD58ne0b9ChEkDXxO0nE/NmNBgHFw0fyzTQKAFj4Z8lbN5 uQE82GVr51rXvxRSyKqZACOCCTS3R/k+gXj782N5nnoiD5sQC+OXN/zlR4c3wRtkpBJJ kq1ACCpDyYBO+WKTofqEcVo4b1SU6BA528SpKiisXGbC9vu16n2VfSkf2VcopV7buNRU klDg== X-Gm-Message-State: ANoB5pl/s3dzeH31zBsFpEbCYmC7yZJQrSr+aoQfxiPore7EFo9an+Sk nc6QT2KneXmEZL1orBxsxjM3l7bnqw53mCypvpLBo0GU X-Google-Smtp-Source: AA0mqf5P771zL5QitXa+lJoBAFTU2WjLEidIk7ESBgNV5PWw0gSA9Hg5Jpe4/sjLwfMdbB9EZPmR9kfaWOyqf3tTgBg= X-Received: by 2002:a05:6808:22a0:b0:35b:c6c4:7a33 with SMTP id bo32-20020a05680822a000b0035bc6c47a33mr16308587oib.266.1670343107663; Tue, 06 Dec 2022 08:11:47 -0800 (PST) MIME-Version: 1.0 References: <20221203041307.34407-1-hjl.tools@gmail.com> <88604f9d-1cc7-0c05-c92e-2561512dc96e@suse.com> <3977276e-762c-661e-6b0d-f757debb5ae0@suse.com> In-Reply-To: <3977276e-762c-661e-6b0d-f757debb5ae0@suse.com> From: "H.J. Lu" Date: Tue, 6 Dec 2022 08:11:11 -0800 Message-ID: Subject: Re: [PATCH] x86: Allow 16-bit register source for LAR and LSL To: Jan Beulich Cc: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3017.1 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 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 Mon, Dec 5, 2022 at 11:51 PM Jan Beulich wrote: > > On 06.12.2022 00:20, H.J. Lu wrote: > > On Mon, Dec 5, 2022 at 3:11 AM Jan Beulich wrote: > >> > >> On 03.12.2022 05:13, H.J. Lu wrote: > >>> Since LAR and LSL only access 16 bits of the source operand, regardless > >>> of operand size, allow 16-bit register source for LAR and LSL, and always > >>> disassemble LAR and LSL with 16-bit source operand. > >>> > >>> gas/ > >>> > >>> PR gas/29844 > >>> * testsuite/gas/i386/i386.s: Add tests for LAR and LSL. > >>> * testsuite/gas/i386/x86_64.s: Likewise. > >>> * testsuite/gas/i386/intelbad.s: Remove "lar/lsl eax, ax". > >>> * testsuite/gas/i386/i386-intel.d: Updated. > >>> * testsuite/gas/i386/i386.d: Likewise. > >>> * testsuite/gas/i386/intel-intel.d: Likewise. > >>> * testsuite/gas/i386/intel.d: Likewise. > >>> * testsuite/gas/i386/intelbad.l: Likewise. > >>> * testsuite/gas/i386/x86_64-intel.d: Likewise. > >>> * testsuite/gas/i386/x86_64.d: Likewise. > >>> > >>> opcodes/ > >>> > >>> PR gas/29844 > >>> * i386-dis.c (MOD_0F02): Removed. > >>> (MOD_0F03): Likewise. > >>> (dis386_twobyte): Restore larS and lslS. > >>> (mod_table): Remove MOD_0F02 and MOD_0F03. > >>> * i386-opc.tbl: Allow 16-bit register source for LAR and LSL. > >>> * i386-tbl.h: Regenerated. > >> > >> Please can you refrain from immediately committing patches which have > >> a risk of being controversial. > >> > >> In the case here, given there are uses of the 16-bit register operand > >> form in the Linux kernel, I can accept the assembler part of the change. > >> The lines in i386-opc.tbl, however, need a comment then, as allowing for > >> 16-bit registers despite a wider destination is explicitly not in line > >> with the SDM. (Interestingly AMD's PM is different in this regard.) > >> > >> For the disassembler part you're completely undoing what I did, which is > >> wrong - again with reference to the SDM. If you want to accommodate for > >> AMD's PM, then you need to vary disassembly according to command line > >> options specified, with the default being in line with the SDM (I can > >> dig out a pretty old version of the doc, but I believe it has always > >> been that way, i.e. even before AMD introduced their clones). > >> > >> I will revert this change unless you come forward with an adjustment > >> within the next couple of days. > >> > > > > Given that the only lower 16 bits are used, the 16-bit register source > > is more appropriate. I will raise the issue with the Intel SDM author. > > I see no point in changing the documentation when what's there has been > valid for well over 30 years. There are other cases in newer insns where > only the low 16 (or 8) bits are used, yet still the 32-bit register name > is specified ({,v}pinsr{b,w} come to mind immediately). Also what you've > done brought things out of sync with mov-to-sreg (and no, please don't > "restore" consistency by also changing disassembly there). The 16-bit register has been used in both assembler and disassembler for well over 30 years. I consider this a flaw in the spec. > My request stand: Please undo / adjust the disassembler change you've > done, or I'll have to revert the entire commit as being wrong and having > been committed prematurely. > > Jan -- H.J.