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 3D55AC5475B for ; Wed, 6 Mar 2024 09:44:01 +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=pODqip5xmO2bvkmBUygnZEeFoccTeCPSwVVetDgFLx0=; b=jR+LO4IrQfi0nW vtHuL+Hdlo0bxFM3xLyGBnryw8wInmV1wDqbale5ZjHcujQZg6W7ynXMREvBiECRdtQT9Vmv3zwpD W3ROBSNIuWVhlpuBR2Ba70Pq/jqyk2vGLtjm7olVJMg4DL6rtnIiI1tbc4oXcGS9zuSDnnr8d4HlS E46vMjWIY/VzC/R8cURW8F8ltoLY7TyB87ut5HfCAwHAuCDbANV261+hNyaL2ECCueJocBRtkAV65 Ss+9ytu0Q64xVimy6knGlPeha/mdngjiOTqAl90IsQ0+LvslEoSJTogRL5r30flGG0/Cbn1wwr3W5 2aQdXL+5AtqGkRHcydOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhnoQ-0000000HDSq-3rMS; Wed, 06 Mar 2024 09:43:47 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhnoN-0000000HDPh-1fVe for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2024 09:43:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 783E6CE1E85; Wed, 6 Mar 2024 09:43:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD56FC433C7; Wed, 6 Mar 2024 09:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709718220; bh=VlacLIJetZbSc37w9oCgwWXUQ4SkJoVFKp/+32psVko=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PNyDIZhdO1Map2G6d312fQ+R4uj7Oko/SG1vXb/T+mcs7mNxUFEfjumYvZB2nbFSc OgDu5OKOhDlr3Yx4uEzDy1/3uL3ntEGBau1Gs9j6O5dZ3mUDhqq5oJy61RwaxOUlPB q/rlFlsav4ajiR52rEpi3CVXmDOFfMpmNg6ZrBVF1O2GIhfTe/mY/EVK/CGfFTFI/8 C5PhcaHrax6zprup1/lXjqwgrtXle+FgxSKWUTQCjKh+XsQnoYdgsCFvhYNAFo6tKw ArMgHNAqTcoTKfusv6a/ak7ffy9Y7kzrwFUtKn1AXk1JfvrtOjzda4yRVLF8QGXTvf hj7YRdmDj2BwA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rhnoH-009sbl-1f; Wed, 06 Mar 2024 09:43:38 +0000 Date: Wed, 06 Mar 2024 09:43:13 +0000 Message-ID: <87edcnr8zy.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , James Clark , Anshuman Khandual Subject: Re: [PATCH 5/5] KVM: arm64: Exclude FP ownership from kvm_vcpu_arch In-Reply-To: <6acffbef-6872-4a15-b24a-7a0ec6bbb373@sirena.org.uk> References: <20240302111935.129994-1-maz@kernel.org> <20240302111935.129994-6-maz@kernel.org> <6acffbef-6872-4a15-b24a-7a0ec6bbb373@sirena.org.uk> 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/28.2 (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.104.136.29 X-SA-Exim-Rcpt-To: broonie@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, james.clark@arm.com, anshuman.khandual@arm.com 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-20240306_014343_808561_835E3228 X-CRM114-Status: GOOD ( 28.83 ) 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, 04 Mar 2024 19:10:08 +0000, Mark Brown wrote: > > [1 ] > On Sat, Mar 02, 2024 at 11:19:35AM +0000, Marc Zyngier wrote: > > In retrospect, it is fairly obvious that the FP state ownership > > is only meaningful for a given CPU, and that locating this > > information in the vcpu was just a mistake. > > > > Move the ownership tracking into the host data structure, and > > rename it from fp_state to fp_owner, which is a better description > > (name suggested by Mark Brown). > > The SME patch series proposes adding an additional state to this > enumeration which would say if the registers are stored in a format > suitable for exchange with userspace, that would make this state part of > the vCPU state. With the addition of SME we can have two vector lengths > in play so the series proposes picking the larger to be the format for > userspace registers. What does this addition have anything to do with the ownership of the physical register file? Not a lot, it seems. Specially as there better be no state resident on the CPU when userspace messes up with it. > > We could store this separately to fp_state/owner but it'd still be a > value stored in the vCPU. I totally disagree. > Storing in a format suitable for userspace > usage all the time when we've got SME would most likely result in > performance overhead What performance overhead? Why should we care? > if nothing else and feels more complicated than > rewriting the data in the relatively unusual case where userspace looks > at it. Trying to convert userspace writes into the current layout would > have issues if the current layout uses the smaller vector length and > create fragility with ordering issues when loading the guest state. What ordering issues? If userspace manipulates the guest state, the guest isn't running. If it is, all bets are off. > > The proposal is not the most lovely idea ever but given the architecture > I think some degree of clunkiness would be unavoidable. It is only unavoidable if we decide to make a bad job of it. 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