From mboxrd@z Thu Jan 1 00:00:00 1970 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 E4045C4332F for ; Sun, 13 Nov 2022 22:28:15 +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=6HFG81r1dryHIxVnjimqoFiTyskersqqsmJPQxJ5NcM=; b=mPBg7ecBF3fTjN /93j9SR6zcspKQuwg1XtBo9pI00FTfhkvCkRtxVu8uzTCSUJFt22TiRrDQ78R3HSFTZA9bJzx3zXI sjPTWA2TaVpiOAt+GEMA7Gk9jtEDMidsS7D58cQ8kD/oTbQgLq6BtSqbfkxx0sqqEiSpuVJBSBRiR w9XgShSAaFL4GiHHzDEaMOxIBqxpUWtiS/qp0dhJI4jX8G0XEfEoolE5HZkmU+iiS3qxJB2BrOZA3 l98LrmieaeVrhCyHOi9PEH1ycZO4S+2Ye+fGtdvVwxNzQiYp/FpCw90azUU4nmEo2rol9EQpNy6z8 XLetqUrnHMOp0Fe6lYYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouLRY-00Edfa-TM; Sun, 13 Nov 2022 22:27:12 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouLRV-00EdfB-Ot for linux-arm-kernel@lists.infradead.org; Sun, 13 Nov 2022 22:27: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 dfw.source.kernel.org (Postfix) with ESMTPS id F3DD160BEF; Sun, 13 Nov 2022 22:27:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B454AC433C1; Sun, 13 Nov 2022 22:27:06 +0000 (UTC) Date: Sun, 13 Nov 2022 22:27:03 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Marc Zyngier , Zhang Lei , James Morse , Alexandru Elisei , Andre Przywara , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 3/8] arm64/fpsimd: Have KVM explicitly say which FP registers to save Message-ID: References: <20221021230321.1159287-1-broonie@kernel.org> <20221021230321.1159287-4-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221021230321.1159287-4-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_142709_867804_5354D13D X-CRM114-Status: GOOD ( 19.71 ) 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 Sat, Oct 22, 2022 at 12:03:16AM +0100, Mark Brown wrote: > In order to avoid needlessly saving and restoring the guest registers KVM > relies on the host FPSMID code to save the guest registers when we context > switch away from the guest. This is done by binding the KVM guest state to > the CPU on top of the task state that was originally there, then carefully > managing the TIF_SVE flag for the task to cause the host to save the full > SVE state when needed regardless of the needs of the host task. This works > well enough but isn't terribly direct about what is going on and makes it > much more complicated to try to optimise what we're doing with the SVE > register state. > > Let's instead have KVM pass in the register state it wants saving when it > binds to the CPU. We introduce a new FP_STATE_TASK for use during normal > task binding to indicate that we should base our decisions on the current > task. This should not ben used when actually saving. Ideally we might s/ben/be/ > diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h > index 3cce0a4c4e8d..1d48398cb6dc 100644 > --- a/arch/arm64/include/asm/processor.h > +++ b/arch/arm64/include/asm/processor.h > @@ -123,6 +123,7 @@ enum vec_type { > }; > > enum fp_type { > + FP_STATE_TASK, /* Save based on current task state. */ Nitpick: FP_STATE_CURRENT instead? Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel