Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp766944rwl; Fri, 31 Mar 2023 02:00:16 -0700 (PDT) X-Google-Smtp-Source: AKy350asMHqYwC8ZLyuXn3pmn5xEj1FMR51gTcoKIAlFAzMZzaZYdtKFZvq8EQ1c4LIL9MT4HmWd X-Received: by 2002:a05:6a00:2987:b0:624:bf7e:9d8c with SMTP id cj7-20020a056a00298700b00624bf7e9d8cmr5502294pfb.1.1680253216015; Fri, 31 Mar 2023 02:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680253215; cv=none; d=google.com; s=arc-20160816; b=wO/iBBUrbAZCch9mhgGFfByAOsg79+LPXZ/yux2EC89Dr3FqABYN8plO6KSQ3VbLRY WQw3dzbLMvIt6qDkQ94OX1WxXBZtMTiXBXVI20bA1lJaGbtkgdrK5iwLVvBWlb5nwGtv ZOGD85OdhNslzFOssdkuMM3/qZHs9F6t0WhK3in/9KHnMe2uk04Nozfe5ziAyJs9qw4T Yv4j6qkX915UbBAjlaJWALkuhYRPafFKfJxKGxqzIJTJMbZffE8UD3jqrUuhwVkIr/qx KAu4Uvs6rDfBTdKazrxu2GHPhHx4WkNaDAV41cFMq//9AODphj4OLtxCgJqdo9uUTJyz eS7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=bGqIOh11D51uA7qZJOLxizaXOOdKnRk0I0SlC7vB9dU=; b=jvJuctuxzh49iJZWfeAK8T2cmVrEKGib5fxyjK2hlhiFTN0/frZISQC+2EbpA6jKxP rPz8n0TOxGcJRCz+eunxs2Rd4U+fl/u+r1L4FW+vUIGtyQxbgdP+3VaLsbyIUeBC85cZ C+hNbd5Lt47mTHvApgWKQTFR3+n80whYecLr1LMl2Z/WqkLfZwL/0lCDedKLGeblmO9N hC94Lu1PVvFNQTNY+48VL3lV70IhBR2D6R7idn5r1KfZGDIoKEeV+4Mbmyp03bCcDyj5 /GaLz4C0dsOO4ZtHNFRqK54O+0F/RFRRX2dipBnduBml8nBMWC8ajaRNJ7G2e3FbXN14 H1BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020aa79ae4000000b005e070e694bcsi2024636pfp.14.2023.03.31.02.00.04; Fri, 31 Mar 2023 02:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229441AbjCaIuL convert rfc822-to-8bit (ORCPT + 99 others); Fri, 31 Mar 2023 04:50:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbjCaIuI (ORCPT ); Fri, 31 Mar 2023 04:50:08 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50743E053 for ; Fri, 31 Mar 2023 01:49:55 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-80-JFvASr4sPtGH8Goypuzf7g-1; Fri, 31 Mar 2023 09:49:51 +0100 X-MC-Unique: JFvASr4sPtGH8Goypuzf7g-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 31 Mar 2023 09:49:48 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 31 Mar 2023 09:49:48 +0100 From: David Laight To: 'Wu Zongyong' , "kirill.shutemov@linux.intel.com" CC: "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "thomas.lendacky@amd.com" , "tony.luck@intel.com" , "wutu.xq2@linux.alibaba.com" Subject: RE: [RFC PATCH] x86/insn: support decode MOVSXD instruction for MMIO Thread-Topic: [RFC PATCH] x86/insn: support decode MOVSXD instruction for MMIO Thread-Index: AQHZY3fogCXZ9lyaeEGX/VkAF56JI68Uk4Wg Date: Fri, 31 Mar 2023 08:49:48 +0000 Message-ID: <94c3f7ba1caa45f7ba503cde6e0c79d2@AcuMS.aculab.com> References: <1655f5dc49ab77f94e350ecbdc93e8d9b31acf61.1680058548.git.wuzongyong@linux.alibaba.com> <20230330123951.b5vujv67c7q3dhay@box.shutemov.name> <20230331022414.GB435@L-PF27918B-1352.localdomain> In-Reply-To: <20230331022414.GB435@L-PF27918B-1352.localdomain> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.0 required=5.0 tests=PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wu Zongyong > Sent: 31 March 2023 03:24 > > On Thu, Mar 30, 2023 at 03:39:51PM +0300, kirill.shutemov@linux.intel.com wrote: > > On Wed, Mar 29, 2023 at 10:59:37AM +0800, Wu Zongyong wrote: > > > It seems MOVSXD which opcode is 0x63 is not handled, support > > > to decode it in insn_decode_mmio(). > > > > Do you have a particular user in mind? > To be honest, I don't find a specific user which uses the MOVSXD. > > But both Intel and AMD's instructions reference contains MOVSXD and lots > of MOVSXD instructions occur when I "objdump -S vmlinux", so I think it > may be useful to support it in insn_decode_mmio(). > > Are there some special consideration about this instruction? It is a sign-extending memory read (32bit to 64bit). You pretty much never want to do that to a device register. Also kernel code should be using readl() (etc) which do unsigned reads. So they should never happen for mmio. Of course, if you mmap() PCIe space directly into a program's address space anything might happen ... David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)