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 E7464C43334 for ; Mon, 6 Jun 2022 11:29:46 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KjhAS+SyV9k6T4ou5Q92eNigryCRsRURYYptSb+HudM=; b=RG0i6jH4kodGXV TeMocmrvPXpxi5Suo4s50ZkfV0YNini66njhED3aw/gx5mdncJFXRy8udKqpiMKTlv4TWOaEA5DbW SB/5zi4kPm47dK7AxZ2mcuqxVlNvBDFZsPVKPEnglVY5FTY8FspMOfLylI/Ydadb5SU3Pu0CHfVYf MzMw1i3J/y37O8oKwvjFs7kzOtcUbRcDGhKSvLNnBUktSWe9XyN/rOo89/XTmIA0jyCdwQSijEm4E Vzkrx+CYl0+/uyMvPxxCgSb+eN2aCaatMro7L/jo7AN1rqNmkfruxngLuUzANPhvDc0jdNDHomBDp W95ErR5EoNQZe6CtOK6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyAuZ-000xja-1g; Mon, 06 Jun 2022 11:28:43 +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 1nyAuT-000xgV-Ra for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2022 11:28:40 +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 46C03B81808; Mon, 6 Jun 2022 11:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D41CC3411C; Mon, 6 Jun 2022 11:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654514915; bh=HSh91ZCaHITLmr5CLlS3fmJvhr48sqOQOlQ7C/p/ovo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Dvw7wTF9FyzkRSe9OpuincqtO0+GGsyTHD5SbKOeaWsNUQyeZ15YjhoTxtE4AatCq L2+C6gDa633fgc7vNN+YB0tIepMpmuhGOYRRyCMahqmUpg8lfuuUjsMeTHFrA6JICu OWNLqx1dN2+0fmV5uw4cDRFpQmD1csMI1WXJ+kUTo+2piteHQT1sCfMcAMI+8B7tPU oYYazMeoJlXQKF2G5jjj+fA7FSgn37rwXzqEfC72bKimq5zAYmJsua2WwZtFlq22KN CYI0iebzkXuRpZ/Wy8RTk368AS72nhWmVIzQL+hiukbdfK8w2WCDQyLtDJaa1hPSep G4mWSMNmm99dg== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nyAuO-00Fsyh-Ha; Mon, 06 Jun 2022 12:28:32 +0100 Date: Mon, 06 Jun 2022 12:28:32 +0100 Message-ID: <87y1ya3uan.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Oliver Upton , Will Deacon , Fuad Tabba , Quentin Perret , kernel-team@android.com, stable@vger.kernel.org Subject: Re: [PATCH 01/18] KVM: arm64: Always start with clearing SVE flag on load In-Reply-To: References: <20220528113829.1043361-1-maz@kernel.org> <20220528113829.1043361-2-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, oupton@google.com, will@kernel.org, tabba@google.com, qperret@google.com, kernel-team@android.com, stable@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220606_042838_216668_F77628D1 X-CRM114-Status: GOOD ( 26.17 ) 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, 30 May 2022 15:41:54 +0100, Mark Brown wrote: > > [1 ] > On Sat, May 28, 2022 at 12:38:11PM +0100, Marc Zyngier wrote: > > On each vcpu load, we set the KVM_ARM64_HOST_SVE_ENABLED > > flag if SVE is enabled for EL0 on the host. This is used to restore > > the correct state on vpcu put. > > > > However, it appears that nothing ever clears this flag. Once > > set, it will stick until the vcpu is destroyed, which has the > > potential to spuriously enable SVE for userspace. > > Oh dear. > > Reviewed-by: Mark Brown > > > We probably never saw the issue because no VMM uses SVE, but > > that's still pretty bad. Unconditionally clearing the flag > > on vcpu load addresses the issue. > > Unless I'm missing something since we currently always disable > SVE on syscall even if the VMM were using SVE for some reason > (SVE memcpy()?) we should already have disabled SVE for EL0 in > sve_user_discard() during kernel entry so EL0 access to SVE > should be disabled in the system register by the time we get > here. Indeed. And this begs the question: what is this code actually doing? Is there any way we can end-up running a guest with any valid host SVE state? I remember being >this< close to removing that code some time ago, and only stopped because I vaguely remembered Dave Martin convincing me at some point that it was necessary. I'm unable to piece the argument together again though. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel