From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by sourceware.org (Postfix) with ESMTPS id 5C8EB3959E48 for ; Tue, 6 Dec 2022 07:51:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C8EB3959E48 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-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WOViJBsqPpl6hCw/XYPOZZMAT6x8AO3yX5gfFp7f+9kmkxUxR4IT5pm+Ym8GWHfaBgYWHDT9Mm4PKu0YydrXcd2jTiBB0Pbfou4v9p68KpXfo3K8uM3laBTiTNnfVbp/vLIdSBmo9UBKZEri9F2g9eeIUje9vpojf/6Hlih2nhPw6C2siOdzbshcWFF37AgpEdv26GTATUjSLpYMtC+ajoFDDXJhi7CexN2G4MhVFRvp023x551723qAUeQ+4niCktaGZpz4jmbKW3W4K24EPBO8E1pJZkQIUkATRb0/FFHunKOuecyVooukDOn2kEREk4mCIsMjT7ydRoJa4J1W3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V9gEwQcnJiVl/mXzJMe763GJJV144+kzTK6mzvQRhdM=; b=hjaE2+TFIldUPTBh2Bwunhx5vU8CwFFDDsdIsPli7LSgOtClkTKYqUgNaVqbw6+DGGi15NZZ+GBphV+h5agtrxbLn4b1c824Lr+7vM+CwsY7cNM6P4Ya4s9+2KDt8ce56/gxo5b+bnSLj8JQjRad6+ilissXc9GOz/gpuvs7e27qGLCa6Aj7Tpl12uCVmezwE5yf8Zi48BrYOZ4S74ODUVPW8Nr32EK43+XgXhkNocmOQ7AMFg4jDhgkvar4tD0IzThXQDACIGtFHYKSbqvuCMvh7/dPuF7z1wNxIagAnl2+FBtFypCagJqhuqMbyY9nJPZoTV70xzk+/yTks4vc/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V9gEwQcnJiVl/mXzJMe763GJJV144+kzTK6mzvQRhdM=; b=nWaKMm9LIsG+JhoJTAUGjKX/wLGEArlgkOVENy2U2cMI0V1q42yteHMBmdSdC2X/jPTy/ghILN7zIz8LVLjkXO9UoTd0karVk0y4NDoa4dl/ueu2vANbUfZtePiJNdvbU/gvX1Ea5vmOyQWEl1ggXsTmovKwZy/C+O2hWTiNZ0ul/FyAc8b15EMoRmZvr1fRXVMJGTwG1VRc5ht/d+VSh1cN9xZB0XhnqHYQ1iM6F6JekhI0mUUhYUxLXbvPT0B8KNKr4W1DT46k6Znof8mAQ+xmWsdapl/vBi0Y8cu/g7EBfgs6duf6G2GRXq0eVgECyV+jiNIW8k+HEI1DZawNWg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PAXPR04MB9253.eurprd04.prod.outlook.com (2603:10a6:102:2bd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 07:51:49 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5880.014; Tue, 6 Dec 2022 07:51:49 +0000 Message-ID: <3977276e-762c-661e-6b0d-f757debb5ae0@suse.com> Date: Tue, 6 Dec 2022 08:51:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] x86: Allow 16-bit register source for LAR and LSL Content-Language: en-US To: "H.J. Lu" Cc: binutils@sourceware.org References: <20221203041307.34407-1-hjl.tools@gmail.com> <88604f9d-1cc7-0c05-c92e-2561512dc96e@suse.com> From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0083.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::7) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|PAXPR04MB9253:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c7341d2-0b99-461b-4b7e-08dad75ebaf8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KV0041a+InOuVpaaWSrkYcOdTw+Ykqho7ZDrmrak4wGKhKUJN7XCqvmnna0p4BbrbLrfEsNyZFjXOXnB6rTKH/nF66dnJBUAaXNZN7NOAvtj1Lb+QRpbZqEcpznn5B82OM+09bphwdIp+TGteqCpXvcsT0NgnCyf0Lzv5BQSKmgnvhb+FBWD8HNuAwL2aT9rHpwZ4jCd9jOM7QxGW8GTE8nlUJWQLT6jmoD+gRa1mcWqpVVdNFGwJhnIxmMK9myCFDAbZ8WFEZJnrr8GGZh3h6bcIY2xKKi88g3QaCIibsALDvrunCyapmK8roIjLIjwP6s8bchL+QU+yPjHv5sxnBDaL8A0PO10FCnCErgjdXP4yoUQfddzfAMQG9OJ7AhK0rxdmsqoLTMeuGCBPWJQyjNd8uTmJZag9Ny5iCn2XnCbH83Db2Tp7Mn+tOD7+pJ+iBQXidTNtfbIDU07rcYIars0tQ2U8RU80XT4E2XmJ1IID5roOj8W7U+FxUmfWRzUU8IT6uaVFG1ZjuWtQAHr9XPVrbDqKTpnAiVTX355AW32OXenRM1hnys+B6J+4Jse4dwpGHpTRE9kO8hZr83ihQfEzfjHuuOY1g7fLUNH903K1lyYUNKpDKtz56WO/u8nnI3G9p7zOpgMF+e2Dvck4G6H/KYdEX5vaN7jfwzKbsKa8o2k/fFc8lD9Y0z8nE8ygo59VtyZENutbeKs4lL+GdmGhZE9m3nbjKQYEyejEMI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(39860400002)(346002)(136003)(376002)(451199015)(31686004)(83380400001)(186003)(2616005)(38100700002)(6512007)(53546011)(6506007)(26005)(6486002)(41300700001)(8676002)(66946007)(66556008)(66476007)(4326008)(5660300002)(478600001)(2906002)(8936002)(86362001)(36756003)(31696002)(6916009)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d0EwSm5vWUxRQk5OUWowR2UzYlp4NnBSSXJMeU9kd05wM2tKWnRlOVNWYlNq?= =?utf-8?B?QmI1cG9uUDNMbzZNNlVqVzl5R0pEaGxER0lTeHdoMnYwTEJVVWdzamFKV0Y1?= =?utf-8?B?NGMyd3kyOFQzMnJhdTVaTlZZeUNGOEF1SlRiMzQ5MmltZHVQYjdFbXVlR1Vv?= =?utf-8?B?amwwc3dCUkY2c29SaGZOOHZ4dHRiMlBJT3AxbzZlSlJPN2VxWExNdCtnMytI?= =?utf-8?B?V1lhU0dRKy9HZl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St3NUlDbzhqM3pC?= =?utf-8?B?dkY4bWNTb2txTWFxREdoYXdCbFVna01oajZMTWFaSFJqL0tua1BkbnNIaFdF?= =?utf-8?Q?ZjvvbCjqfXNPGzjOQWOHlXA0/?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c7341d2-0b99-461b-4b7e-08dad75ebaf8 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 07:51:49.1328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HrXiXP5O1cQsY64psFJlKw6/xJLhovv546KTukt3Li4Cdy4g8w+RbIUNFeGFaYLjuWJHuCmRtTFbP7+i6HFOWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9253 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 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). 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