From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 631ACC761AF for ; Fri, 31 Mar 2023 15:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbjCaP7x convert rfc822-to-8bit (ORCPT ); Fri, 31 Mar 2023 11:59:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbjCaP7v (ORCPT ); Fri, 31 Mar 2023 11:59:51 -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 51EC711163 for ; Fri, 31 Mar 2023 08:59:49 -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-120-C4-P87iaN1WtnBYIDX4e1A-1; Fri, 31 Mar 2023 16:59:46 +0100 X-MC-Unique: C4-P87iaN1WtnBYIDX4e1A-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 16:59:44 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 31 Mar 2023 16:59:44 +0100 From: David Laight To: "'Kirill A. Shutemov'" , Tom Lendacky CC: 'Wu Zongyong' , "kirill.shutemov@linux.intel.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "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/VkAF56JI68Uk4WggABviA2AAAb3EA== Date: Fri, 31 Mar 2023 15:59:44 +0000 Message-ID: References: <1655f5dc49ab77f94e350ecbdc93e8d9b31acf61.1680058548.git.wuzongyong@linux.alibaba.com> <20230330123951.b5vujv67c7q3dhay@box.shutemov.name> <20230331022414.GB435@L-PF27918B-1352.localdomain> <94c3f7ba1caa45f7ba503cde6e0c79d2@AcuMS.aculab.com> <20230331100620.mkqg72vwhmlliunn@box.shutemov.name> <2220e2f1-2c91-e054-c107-a761fdfe7ffb@amd.com> <20230331140916.ofb7ecrjpg7shaav@box> <20230331152508.s7phgif3iozbbpqn@box> In-Reply-To: <20230331152508.s7phgif3iozbbpqn@box> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kirill A. Shutemov > Sent: 31 March 2023 16:25 ... > > No, SEV doesn't support userspace MMIO. > > But where do you filter out userspace MMIO? AFAICS, it goes straight from > from #VC to insn_decode_mmio(). Hm? Probably by making vm_iomap_memory() fail. Otherwise MOVSXD is the least of your problems. You'd need to worry about all the AVX opcodes as well. Although you might even find kernel code that is using kernel_fpu_begin/end() to wrap mmio copies that use the big AVX512 registers. When each PCIe read takes about 1us (measured into our fpga) increasing the TLP to 64 bytes (from 8) makes a massive difference to buffer reads. (Mostly we try to get the fpga to do writes instead.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)