Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5583301pxb; Tue, 16 Feb 2021 02:12:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzZt/oohw8xrDzBKDAbabWSIIcP8x4FvJG5klaalxhjUjF4VbSlXcUyEXw4LFiu2+NwbAz X-Received: by 2002:a50:eb8b:: with SMTP id y11mr16720234edr.216.1613470332679; Tue, 16 Feb 2021 02:12:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613470332; cv=none; d=google.com; s=arc-20160816; b=hCxgkT5gqO34xnIbPAdgZ1ZBGMFTMOi3/iyIQzg0A6A+3Dct8jrh40bUaTyTl+3Rdx kN8cN9kp1MOPkZO7dmb8bS8u0WrnCv3CUG7lfUcr6//drm+jYP7JNIq9SJzw7TUwgy6O B8JQLQo/XcojflggdU46ioEmaloklQ7QjIXK2oiDKs+qkebVmePsrCaTvUTi8SsVJa1R S62uYFpDwNWf7ynqrfdK4fYSX02pvHxqlOHDL0LINiYqTbBirpeVYFz2IVZkbIofKyyb MfjzH72yR1JVWCU6hF7TBCOUhixz4qjg9xzO6Ts6PfxqqdzegXK/cGTuC6YTLOAp5t9p tVKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M3sGSrTBwz4qNYhjumdWtmzUj5dwr3S+HhZN9jBgyco=; b=e/L24TgsyOcH9j15JUGjkvf1hBfbJnGxLjqmb83rPY4f9GDSS+GC9f+iIIRfmo1hiX V1o3dd7OZPGsXB+NSEJvoUh8vjiqf6m8mVbHQnVw1SY9YZfvx+7/oHf5AZ05F380yuWi 70MXP+d90D5maP43JsW6SHNrEXrtFSZS3CVIhck3Utek4+QXOLz6Ai0lHWLb6xmDJFWr RxDj2okBQbi4UO8PtkKQ2QnuELNQx8LMYqU57HVfW8mSSmGFr6cEdZGon42gRVkyav4e W39uQ40c9exJNaBccAi1rsaS7DoWxtkwvKV/49QVNIJktJNKtt86f32LcMdobT2w2hMg Mn8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d2WIA82k; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn4si17039794ejc.353.2021.02.16.02.11.41; Tue, 16 Feb 2021 02:12:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d2WIA82k; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbhBPKLj (ORCPT + 99 others); Tue, 16 Feb 2021 05:11:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhBPKLj (ORCPT ); Tue, 16 Feb 2021 05:11:39 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BEE8C061574; Tue, 16 Feb 2021 02:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=M3sGSrTBwz4qNYhjumdWtmzUj5dwr3S+HhZN9jBgyco=; b=d2WIA82ke4d6idbElbNfc4JiTt 2CelTzoLni619XeJSNwMEn6uf8A5GxrMeYXv54drG9i38ULUj2AKPEPNty6Yskh6Ss5RPmhM0q0tF M/x8hbX7kygeHNqSb1IDfON8Y8i8Nldb81lTChkCH/Zvcf8WHOZShqpWpRk8uEJpoWOOXjrppfPnJ X8t7q/x5jqG2NrxnIquyNGWHb8q/VTI6A9L8wAFG9cf5Ecq1cl/ZtIyG07cHQllkaAYHCOgoHRV3d bDq5qwzkzpygGX2Dj+fwYWa4vlSBYkzDS4bdfzuQ5iZL8lOm34Gxk29cH3mb+8U0zuvLXslIE2XfL SNJvnonQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lBxI3-00GjSg-DG; Tue, 16 Feb 2021 10:09:25 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B468A3011E6; Tue, 16 Feb 2021 11:09:05 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 91A502B7E1C46; Tue, 16 Feb 2021 11:09:05 +0100 (CET) Date: Tue, 16 Feb 2021 11:09:05 +0100 From: Peter Zijlstra To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Martin , Mark Brown , Herbert Xu , Eric Biggers , Will Deacon , Catalin Marinas , Thomas Gleixner , Sebastian Andrzej Siewior , Ingo Molnar Subject: Re: [RFC PATCH 0/5] running kernel mode SIMD with softirqs disabled Message-ID: References: <20201218170106.23280-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201218170106.23280-1-ardb@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Dec 18, 2020 at 06:01:01PM +0100, Ard Biesheuvel wrote: > [ TL;DR for the non-ARM folks on CC: disabling softirq processing when using > SIMD in kernel mode could reduce complexity and improve performance, but we > need to decide whether we can do this, and how much softirq processing > latency we can tolerate. If we can find a satisfactory solution for this, > we might do the same for x86 and 32-bit ARM as well. ] > - could we do the same on x86, now that kernel_fpu_begin/end is no longer > expensive? Can't we simply save/restore the relevant register set? So something like (note amluto was wanting to add a regset argument): kernel_fpu_begin(MMX) kernel_fpu_begin(SSE) kernel_fpu_end(); ... kernel_fpu_end() Would have to save the MMX regs on first SIRQ invocation of kernel_fpu_begin(), and then have softirq context termination above, restore it. I mean, we already do much the same for the first kernel_fpu_begin(), that has to save the user registers, which will be restore when we go back to userspace. So why not do exactly the same for softirq context?