Received: by 10.213.65.68 with SMTP id h4csp1596005imn; Mon, 19 Mar 2018 08:19:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELuoevv9hMgpEIhJD5kjSbbIrGECaDaBC18bvK5oK1iO4HTpFDCGM24N5AS9Ty7SgfKnF3Ti X-Received: by 10.99.163.67 with SMTP id v3mr9175282pgn.298.1521472790069; Mon, 19 Mar 2018 08:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521472790; cv=none; d=google.com; s=arc-20160816; b=VYUxqkM9ID9BE99+9CXPtFQq0riwKk8A5PsPYxceytWFuMYn2xtNSy1Xoja9jeSNZP 4M3yPfSsmwDYDbYB+OB1B2IEWJC2lSUHSOsuUe8F2bNFJet6qJULPXe3PkHGA0agYkdp BwsdsuzglsGV+jGfkXgN5GGnKQKEM597s860anJCEPn2Ui4VdbHtn3VBtrVFUjLXiKuN c+YGHVVR2YzKEoHnR2rbxNI+L+sM5rnlzDnYENDW/jGU92CXZK4Rb9a1t/vWB6qsIyYZ +ADad5ltarl1hZe7VAcOhHSKUtXIQDbPu1WEyBlIg0lidnYZydzwLcy3vZJlG0a3gvx0 q8JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=Z0OxP5oyHE3ZRZVDhKFXCxRmiQzHk7twUjriqVWJ0fs=; b=lTeQz6TH+LxEvyLjh2X3PeIAwmTPlQrTK+g42Mj94pdZPY6K3GgRz652Q/+eE1hjG2 of3DlB7DQ7ayUCj0lQ7XMNP7rBSf2Zs6sMXRj6UeIBqHC4CulATRuJQEiuWKddt4lJak OUSrb53Y9+mLWWXijHXhpLUvxWFOsGN67BrWnrgO8wjz7r5HFuL9QBmpWL2bY/0lrIRO Mucuu6srSu+zvzWO/Vj9FhRfcobCM3GJ2ZsvyNsigA3SZSemOylJ3YrAPHiMJ5KOC3zF S8EE+kt2qqNZPhiGvHwb105+0NGmNE6FyP/vsZiFtpuV1963GHwxlDFAuS9W8ZewEbEh UJ1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si143183pld.591.2018.03.19.08.19.35; Mon, 19 Mar 2018 08:19:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755668AbeCSPSY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Mar 2018 11:18:24 -0400 Received: from smtp-out4.electric.net ([192.162.216.185]:55469 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755417AbeCSPSU (ORCPT ); Mon, 19 Mar 2018 11:18:20 -0400 Received: from 1exwXz-00085a-TS by out4a.electric.net with emc1-ok (Exim 4.90_1) (envelope-from ) id 1exwY6-0000Dr-UD; Mon, 19 Mar 2018 08:18:10 -0700 Received: by emcmailer; Mon, 19 Mar 2018 08:18:10 -0700 Received: from [156.67.243.126] (helo=AcuMS.aculab.com) by out4a.electric.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1exwXz-00085a-TS; Mon, 19 Mar 2018 08:18:03 -0700 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 19 Mar 2018 15:19:01 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 19 Mar 2018 15:19:01 +0000 From: David Laight To: 'Thomas Gleixner' CC: 'Rahul Lakkireddy' , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "mingo@redhat.com" , "hpa@zytor.com" , "davem@davemloft.net" , "akpm@linux-foundation.org" , "torvalds@linux-foundation.org" , "ganeshgr@chelsio.com" , "nirranjan@chelsio.com" , "indranil@chelsio.com" Subject: RE: [RFC PATCH 0/3] kernel: add support for 256-bit IO access Thread-Topic: [RFC PATCH 0/3] kernel: add support for 256-bit IO access Thread-Index: AQHTv43TjMVMzNQoikSg1VH837bpVaPXnqXggAAJp4CAAAH+gA== Date: Mon, 19 Mar 2018 15:19:01 +0000 Message-ID: <7f8d811e79284a78a763f4852984eb3f@AcuMS.aculab.com> References: <7f0ddb3678814c7bab180714437795e0@AcuMS.aculab.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner > Sent: 19 March 2018 15:05 > > On Mon, 19 Mar 2018, David Laight wrote: > > From: Rahul Lakkireddy > > In principle it ought to be possible to get access to one or two > > (eg) AVX registers by saving them to stack and telling the fpu > > save code where you've put them. > > No. We have functions for this and we are not adding new ad hoc magic. I was thinking that a real API might do this... Useful also for code that needs AVX-like registers to do things like CRCs. > > OTOH, for x86, if the code always runs in process context (eg from a > > system call) then, since the ABI defines them all as caller-saved > > the AVX(2) registers, it is only necessary to ensure that the current > > FPU registers belong to the current process once. > > The registers can be set to zero by an 'invalidate' instruction on > > system call entry (hope this is done) and after use. > > Why would a system call touch the FPU registers? The kernel normally does > not use FPU instructions and the code which explicitely does has to take > care of save/restore. It would be performance madness to fiddle with the > FPU stuff unconditionally if nothing uses it. If system call entry reset the AVX registers then any FP save/restore would be faster because the AVX registers wouldn't need to be saved (and the cpu won't save them). I believe the instruction to reset the AVX registers is fast. The AVX registers only ever need saving if the process enters the kernel through an interrupt. David