Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6634C433F5 for ; Fri, 4 Feb 2022 17:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x5cNNtCZ9jJxsJ2etbXKeWbOlnk8bGudTKjd/Qk7SH8=; b=kTmpQwTrlcSVH+ Gip/Rx9L/NOacu0n5t56gQHlehuFmJD1QBmHxwHm6fsZ1QQkN8AbslziwqFuldxsNXtTQeoUmOnoE YuoU8TV6twP4uRYIA/ilqvT8CmFN9WNZ6GPQoVK0PfZxTqafEZUVOGtFEHMDz/9VPiTieWAhuryA9 vv7rTQLWTSXI9y9hRHWQNfz36TA6XpMHsSVPK1MUozsXz/G+a7hKZr3wX8SeK1tbHjAJAA9SwYOl1 BGDq3YpiTzvSd6ONT4UBD6kYSbmbT8GXKfM0L4GcuiS4koIglgnlaPiiAJQGdwB+TgK7gfAd7H6Pl RrPxvFP2+S6myQfcnT1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG2jq-0054Xu-Q6; Fri, 04 Feb 2022 17:51:14 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG2jm-0054XN-4h for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 17:51:11 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D6D77B8386D for ; Fri, 4 Feb 2022 17:51:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2C10C004E1; Fri, 4 Feb 2022 17:51:06 +0000 (UTC) Date: Fri, 4 Feb 2022 17:51:03 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, Marc Zyngier Subject: Re: [PATCH] arm64/fpsimd: Clarify the purpose of using last in fpsimd_save() Message-ID: References: <20220124161115.115200-1-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220124161115.115200-1-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220204_095110_638948_0B928C24 X-CRM114-Status: GOOD ( 18.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 24, 2022 at 04:11:15PM +0000, Mark Brown wrote: > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > index 5280e098cfb5..47af76e53221 100644 > --- a/arch/arm64/kernel/fpsimd.c > +++ b/arch/arm64/kernel/fpsimd.c > @@ -348,7 +348,13 @@ static void task_fpsimd_load(void) > > /* > * Ensure FPSIMD/SVE storage in memory for the loaded context is up to > - * date with respect to the CPU registers. > + * date with respect to the CPU registers. Note carefully that the > + * current context is the context last bound to the CPU stored in > + * last, if KVM is involved this may be the guest VM context rather > + * than the host thread for the VM pointed to by current. This means > + * that we must always reference the state storage via last rather > + * than via current, other than the TIF_ flags which KVM will > + * carefully maintain for us. > */ > static void fpsimd_save(void) > { It's good to have the text here, otherwise it's hidden somewhere in the commit logs. Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel