Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4353162ybi; Mon, 3 Jun 2019 09:29:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBM2dAkSqfhYtMNQeuGyWP2yywyGJNBt5CC5bU2n817DJWLS3S0zi3KboUbLKhudMviRNY X-Received: by 2002:a63:e408:: with SMTP id a8mr30008929pgi.146.1559579361089; Mon, 03 Jun 2019 09:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559579361; cv=none; d=google.com; s=arc-20160816; b=qI4kWObh4nMlDpyUrPRFHCAdSAY+gCOfOaomQTV5U4mXlfGwAoZnDq3rldguDr2ELi WHWFBdOTxI1HuDS2c9DkvJMNm/vgNKEHaWHMan+Znvr0tqUIyER13HnuOM21KTruh8E5 QB7D4DjzpDUiMZhN/KgUHwnxBux35XMbwHcEjIHkb9W/QQj9p11h7p2wDK4XyvpGXynY JSLqBbUuVYi2pClQXCmiXPyla/cyl53PVoRDy9M1emhJ+sW/dRX2eJJE3vQd6EaOkgNn HlPsu90shKKdHRaUdQOj5Gc67F+zgpg4Q9h1VWcDTCkuOcdZGg56b6uVqxkgfiFOtnh5 OW4g== 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:message-id:subject:cc :to:from:date; bh=bjiGjdh+odViC/Hsdq7VjK7MxkHxHtCOodyNiYOYG0A=; b=GSF8RilZpDmjlkt2Nb5q5hXFAWCKIs85qR6amy4OYyxzFLocs3w+WQP0H7kGvevD6i ayUS1Oihf70KegSBvZWhZf56qKz4dwnk4rhgJcXeuNOMp1H5UYD/xTuHAWi8WFgiXEZe /CsMWsjRY+1Iz8K4x75pmLwC07/SbzyStHqE6saT20hgUmaSgvES5ZWD/JU0mAgbTPWK Y/yoWWdK3iYv/AGuNa+8oWFnAdwDrbyIOvwGMmAfCSL/ai4SsjbLDvOA+geC8epJc7lz MZNggXljtk9B1gP+Y/UztFny6BAP2RgsEotgLyR6GOr1lFvp+cthHUK3HlBM31D79IpB YrDA== 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 l68si14930354pje.13.2019.06.03.09.29.03; Mon, 03 Jun 2019 09:29:21 -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 S1728774AbfFCQZj (ORCPT + 99 others); Mon, 3 Jun 2019 12:25:39 -0400 Received: from foss.arm.com ([217.140.101.70]:55106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfFCQZj (ORCPT ); Mon, 3 Jun 2019 12:25:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54CBA80D; Mon, 3 Jun 2019 09:25:39 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D64E3F5AF; Mon, 3 Jun 2019 09:25:37 -0700 (PDT) Date: Mon, 3 Jun 2019 17:25:34 +0100 From: Catalin Marinas To: Julien Grall Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, will.deacon@arm.com, christoffer.dall@arm.com, marc.zyngier@arm.com, james.morse@arm.com, julien.thierry@arm.com, suzuki.poulose@arm.com, Dave.Martin@arm.com, ard.biesheuvel@linaro.org Subject: Re: [PATCH v5 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Message-ID: <20190603162534.GF63283@arrakis.emea.arm.com> References: <20190521172139.21277-1-julien.grall@arm.com> <20190521172139.21277-4-julien.grall@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521172139.21277-4-julien.grall@arm.com> 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 Tue, May 21, 2019 at 06:21:39PM +0100, Julien Grall wrote: > Since a softirq is supposed to check may_use_simd() anyway before > attempting to use FPSIMD/SVE, there is limited reason to keep softirq > disabled when touching the FPSIMD/SVE context. Instead, we can simply > disable preemption and mark the FPSIMD/SVE context as in use by setting > CPU's fpsimd_context_busy flag. [...] > +static void get_cpu_fpsimd_context(void) > +{ > + preempt_disable(); > + __get_cpu_fpsimd_context(); > +} Is there anything that prevents a softirq being invoked between preempt_disable() and __get_cpu_fpsimd_context()? -- Catalin