Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3465384yba; Tue, 23 Apr 2019 04:25:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPVbVkw4TdOEAm7IMO+qE/RreQdKN4pfJc6I3aC8DSthIdfc6A6a7j7HtL/mC3GKFWGdBU X-Received: by 2002:a65:5106:: with SMTP id f6mr24374121pgq.253.1556018753285; Tue, 23 Apr 2019 04:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556018753; cv=none; d=google.com; s=arc-20160816; b=e+cw3O901CvE+Y74OzkU2HP6uY4tKxeSITdPXhGM723gb+Wq/Mkl0qs51mdDO14bYj BCvH/ix6H4PTtP36osnpKy3KuJo+cWUNAVUAiR/swp5+o4jZ0QFWjJrUU2CGYDsbLibv FmcwNJ24Sn905Ff55vQnkSAKpWMTkwWVXKASR1LbHk+r+MXSA4D6lShuYzg6U0xgVaQM MQyeTGP4sZZtwTAqe0+8qtB09AgHRFnofGN+EPUxedMq7Fi06dMfhqcYcr7TsuGd1YT5 JvQTyWG6oHtvzQU3U9yDUT8kzuw+9/eZaaXb9D4ycItv0I2pv76VgpDbUkSokS5R42AT koDg== 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=7VkmtrnragcsKT7L/JuJsQl4UH9EFGnb+L5MhyId8Kk=; b=ewL5kWigV70iLoxPjAnatv/6ZJrzak49C+Y3XYA/j/GFfMapT8L6cVyntgl9kRmP11 NTE33suSx8fv85yGHFCDIgQa10SlKLUTZ6Y7ozJICuH+vklEAM/B5WGFMtz66ZEcz+Cm SqJyqmHgZ0sBwU+cMrfqcExFp+HSuRiWIocPgZMYaDwAUHMUBdtPY8ZniIuLL5T4n/kf Zepy+SSaTDPeRFsUEW9uhPfVNclNRnYG7mGJVyvIXC3Zwe/L2kK0U6SNwQ6HIuUMcFr1 SgkqyOG58yc6xwIAkoY283cpnrXdURfLyy7MX9TH04a1CO0am7JxUeav9lUoUzSmWbhL BIAA== 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 72si15634874plb.165.2019.04.23.04.25.37; Tue, 23 Apr 2019 04:25:53 -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 S1727418AbfDWLXZ (ORCPT + 99 others); Tue, 23 Apr 2019 07:23:25 -0400 Received: from foss.arm.com ([217.140.101.70]:54800 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbfDWLXZ (ORCPT ); Tue, 23 Apr 2019 07:23:25 -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 491F3374; Tue, 23 Apr 2019 04:23:24 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 57C283F557; Tue, 23 Apr 2019 04:23:22 -0700 (PDT) Date: Tue, 23 Apr 2019 12:23:19 +0100 From: Dave Martin To: Julien Grall Cc: ard.biesheuvel@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, julien.thierry@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Subject: Re: [PATCH v2 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Message-ID: <20190423112317.GK3567@e103592.cambridge.arm.com> References: <20190412171420.29065-1-julien.grall@arm.com> <20190412171420.29065-4-julien.grall@arm.com> <20190416123033.GM3567@e103592.cambridge.arm.com> <901b1c73-4f96-b493-cdc7-bc2f6bd2d7ca@arm.com> <20190417140058.GZ3567@e103592.cambridge.arm.com> <80c6b8cd-5ea9-7fa3-7a3b-8b3af686f737@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80c6b8cd-5ea9-7fa3-7a3b-8b3af686f737@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 11:59:44AM +0100, Julien Grall wrote: > Hi Dave, > > On 4/17/19 3:01 PM, Dave Martin wrote: > >On Wed, Apr 17, 2019 at 12:37:57PM +0100, Julien Grall wrote: > >>Hi Dave, > >> > >>On 16/04/2019 13:30, Dave Martin wrote: > >>>On Fri, Apr 12, 2019 at 06:14:20PM +0100, Julien Grall wrote: [...] > >>>>@@ -1125,19 +1194,18 @@ static void fpsimd_flush_cpu_state(void) > >>>> /* > >>>> * Save the FPSIMD state to memory and invalidate cpu view. > >>>>- * This function must be called with softirqs (and preemption) disabled. > >>>>+ * This function must be called with preemption disabled. > >>>> */ > >>>> void fpsimd_save_and_flush_cpu_state(void) > >>>> { > >>>>+ __get_cpu_fpsimd_context(); > >>>> fpsimd_save(); > >>>> fpsimd_flush_cpu_state(); > >>>>+ __put_cpu_fpsimd_context(); > >>> > >>>It may be cleaner to avoid the assumption about preemption already being > >>>disabled here. fpsimd_thread_switch() is rather a special case, but for > >>>this one is this really used on a hot path that justifies the assumption? > >> > >>It is currently only called with preemption disabled. So I thought it would > >>be better to avoid disabling preemption again. But I am happy to use the > >>non-__ version if you think it is better. > > > >Hmmm, this works either way. Since this is not fast-path and has an > >external caller, it might be worth adding a WARN_ON(preemptible()) here > >if you want to stick with the __ functions. > > As it is not a fastpath, I will use the non-underscore version. OK, either is good for me. Cheers ---Dave