Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp929153yba; Fri, 26 Apr 2019 11:05:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqximFE22IRWRhHHMh02+7JnFafAULOs9CZ/UBTXQPUkgij1rtL8ogxlLCXYpFSTCsarxsGK X-Received: by 2002:a63:ed10:: with SMTP id d16mr28083568pgi.75.1556301938789; Fri, 26 Apr 2019 11:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556301938; cv=none; d=google.com; s=arc-20160816; b=e93nwRIYRlNLkgu1cnd0TU+qNqowXFR9NJGLJ8sLVq+ajpQVF8zvJxpB5ge5wKHdMi Goh5D0v+wmKSZGhHvvNXl+/aptWkJWfccWf1kF83i9Sj6i7k7VsJ8MJoXyv1HTCHAVVS yGJDsZQINa7NSwgPi6+JVtsuPvh3E7SFKaf9EeXcb/t93bh2MUN5TXV+pPudM2dCTCq3 nCMGn6paN8uXGmtts6D5iRyqu4Y7XE9NOw/Sxp/nV0sLuEgHnJXi5zfynDIdUXoUH9wz Mo4vqU3HTX0hpnc2jSC4XwyK8gYhxX5Iz9w6w14T1VBjyR4aYfViEw34EaBo6Xk73UX4 8Z1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=Gj3PJnLoEV1RfBwVDSq5HeS4lDGKZtmOemdBnhp+1Gc=; b=Jsc1SwTN2q+hSY8T2avSiliFV29HlYwvPX+mjf2eY+Zw/kRQ6MOXWY8tCH3V8epImR wlKChIwUqZPh0Vwh2dm7Jb+SRkn78RXpdWZFpglyUA7z+lLFVLHFjllSZw/bf5xEgZHY T0JsdnZIKyf5gYatFSfNZIoCyqZpEl7/Gy7pcVAdWTgsoPrqoew803X6wVNkWJ20tukE nDDM7RcsB5uYmiTPPhqDzHCJxYA9a08H8oslQaMkywUBm8WCmqFG8oowIuPbBFWrZqO9 AKttvtE2w3CWUth5CHgr2oEMQ/lHMGGfNJ3bTimQ8TuWukUI64wd6wINyBN4cYBYMH4S kDRw== 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 p2si25638989plr.69.2019.04.26.11.05.23; Fri, 26 Apr 2019 11:05:38 -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 S1726266AbfDZSE1 (ORCPT + 99 others); Fri, 26 Apr 2019 14:04:27 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55505 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726005AbfDZSE1 (ORCPT ); Fri, 26 Apr 2019 14:04:27 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-109.corp.google.com [104.133.0.109] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x3QI2ZMY003336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Apr 2019 14:02:36 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 28CB2420003; Fri, 26 Apr 2019 14:02:35 -0400 (EDT) Date: Fri, 26 Apr 2019 14:02:35 -0400 From: "Theodore Ts'o" To: Eric Biggers Cc: "Reshetova, Elena" , "herbert@gondor.apana.org.au" , David Laight , Ingo Molnar , "'Peter Zijlstra'" , "keescook@chromium.org" , Daniel Borkmann , "luto@kernel.org" , "luto@amacapital.net" , "linux-kernel@vger.kernel.org" , "jpoimboe@redhat.com" , "jannh@google.com" , "Perla, Enrico" , "mingo@redhat.com" , "bp@alien8.de" , "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "Edgecombe, Rick P" Subject: Re: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall Message-ID: <20190426180235.GC9835@mit.edu> Mail-Followup-To: Theodore Ts'o , Eric Biggers , "Reshetova, Elena" , "herbert@gondor.apana.org.au" , David Laight , Ingo Molnar , 'Peter Zijlstra' , "keescook@chromium.org" , Daniel Borkmann , "luto@kernel.org" , "luto@amacapital.net" , "linux-kernel@vger.kernel.org" , "jpoimboe@redhat.com" , "jannh@google.com" , "Perla, Enrico" , "mingo@redhat.com" , "bp@alien8.de" , "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "Edgecombe, Rick P" References: <01914abbfc1a4053897d8d87a63e3411@AcuMS.aculab.com> <20190416154348.GB3004@mit.edu> <2236FBA76BA1254E88B949DDB74E612BA4C52338@IRSMSX102.ger.corp.intel.com> <9cf586757eb44f2c8f167abf078da921@AcuMS.aculab.com> <20190417151555.GG4686@mit.edu> <99e045427125403ba2b90c2707d74e02@AcuMS.aculab.com> <2236FBA76BA1254E88B949DDB74E612BA4C5E473@IRSMSX102.ger.corp.intel.com> <2236FBA76BA1254E88B949DDB74E612BA4C63E24@IRSMSX102.ger.corp.intel.com> <20190426140102.GA4922@mit.edu> <20190426174419.GB691@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426174419.GB691@sol.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 10:44:20AM -0700, Eric Biggers wrote: > Would it be possibly to call ChaCha20 through the actual crypto API so that SIMD > instructions (e.g. AVX-2) could be used? That would make it *much* faster. > Also consider AES-CTR with AES-NI instructions. It's not obvious SIMD instructions will be faster in practice, since it requires saving and restoring the vector/FPU registers. If you're going to be doing a *lot* of vector processing (for example when doing block-level RAID-5 / RAID-6 computations), it might be worth it. But if you're only going to be turning the crank for 12 or 20 rounds, the overhead of calling kernel_fpu_begin() and kernel_fpu_end() is probably going to make this worth it. As far as using aesni (if available) is concerned, since we don't need to worry about interoperability between two systems ala IPSEC, it's definitely something that's worth investigating. - Ted