From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A9176FDF for ; Sun, 13 Nov 2022 22:00:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F97CC433D6; Sun, 13 Nov 2022 22:00:32 +0000 (UTC) Date: Sun, 13 Nov 2022 22:00:28 +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 1/8] KVM: arm64: Discard any SVE state when entering KVM guests Message-ID: References: <20221021230321.1159287-1-broonie@kernel.org> <20221021230321.1159287-2-broonie@kernel.org> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221021230321.1159287-2-broonie@kernel.org> On Sat, Oct 22, 2022 at 12:03:14AM +0100, Mark Brown wrote: > Since 8383741ab2e773a99 (KVM: arm64: Get rid of host SVE tracking/saving) > KVM has not tracked the host SVE state, relying on the fact that we > currently disable SVE whenever we perform a syscall. This may not be true > in future since performance optimisation may result in us keeping SVE > enabled in order to avoid needing to take access traps to reenable it. > Handle this by clearing TIF_SVE and converting the stored task state to > FPSIMD format when preparing to run the guest. This is done with a new > call fpsimd_kvm_prepare() to keep the direct state manipulation > functions internal to fpsimd.c. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas 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 824E8C4332F for ; Sun, 13 Nov 2022 22:01:51 +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=ZdlyuIsSDacqpGBDCl3eEBQZ6tSTdAz0uOzA9HyyKoM=; b=Twx2fvNVM7w+zH FGw7tt2+TSVN61gI/eAYYJkoVgwnzm23I/dRqdSBGyj+KwwHFkqHWJkpj4zLNQ9QykcC9HIN3fHOU 2grTYefeA6HaD8HmjEA2i1ReeNSrM21VqJ6vdb+ray3U/aDfKdqtz7LAketm5lmGuDaJDd9QQGcSZ aJZeyTh2cAtwArGtU+yLUrVXrDzT6InmguqURvqdrsYEs3wMKAmR3JN1zrEE1lsBPsgxqLYidotbv ofNtMTIXV3BelVfAoYrX+EW5Lw6ZS743A0TaruB6opflVHyfG4Dx7n7YOmhjqzIIagT5MOtz83AWt 8RGBMeMNu2aECozOT40g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouL1s-00ERaW-RQ; Sun, 13 Nov 2022 22:00:40 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouL1p-00ERVV-Lu for linux-arm-kernel@lists.infradead.org; Sun, 13 Nov 2022 22:00:39 +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 53F79B80CAE; Sun, 13 Nov 2022 22:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F97CC433D6; Sun, 13 Nov 2022 22:00:32 +0000 (UTC) Date: Sun, 13 Nov 2022 22:00:28 +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 1/8] KVM: arm64: Discard any SVE state when entering KVM guests Message-ID: References: <20221021230321.1159287-1-broonie@kernel.org> <20221021230321.1159287-2-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221021230321.1159287-2-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_140037_904064_12302309 X-CRM114-Status: GOOD ( 12.30 ) 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:14AM +0100, Mark Brown wrote: > Since 8383741ab2e773a99 (KVM: arm64: Get rid of host SVE tracking/saving) > KVM has not tracked the host SVE state, relying on the fact that we > currently disable SVE whenever we perform a syscall. This may not be true > in future since performance optimisation may result in us keeping SVE > enabled in order to avoid needing to take access traps to reenable it. > Handle this by clearing TIF_SVE and converting the stored task state to > FPSIMD format when preparing to run the guest. This is done with a new > call fpsimd_kvm_prepare() to keep the direct state manipulation > functions internal to fpsimd.c. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel