From patchwork Mon Feb 26 20:44:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13572955 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 7A1DAC48BF6 for ; Mon, 26 Feb 2024 21:44:03 +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:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sj1ieda5u2ZFBs3yXHWbLrRGycIMBbrmWaEV0v+1iXg=; b=2Dug63jM4PbIbi ffNnsXEBO4YsEcukhbSA7g8v5b7RgCf4fuYCuE+Gu02WWavdfSt/jXmNVoJlnXApucdOKjAIIx38s +teW7R9kHKRCZivR6csoofoNUhw0Hxw+1ed6gkVCCzbU+NEOgbpF4G/iL10hlOfroTBK7jT2/h8HG IbBjLl0cOp0pHDlrCOBMZoDlJJBxi8+3ShuUewNwrvpk+xuyXQ6TwNNCMNfLa3/stqJtLOwjZA4Q/ SohrwrTbbcD/vB0DrGCO5a+50/66NWQ1LgUGJP9dopH89Ba6jrlycmX/EFzRSDSVWAx8EHQ1nv0Rj NpHCMJDroZS0G/a8RJDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reilO-00000002kSh-26U1; Mon, 26 Feb 2024 21:43:54 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reilI-00000002kRM-1owi for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2024 21:43:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1ED7060C8F; Mon, 26 Feb 2024 21:43:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D540AC433C7; Mon, 26 Feb 2024 21:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708983825; bh=q4y2X/QHhahydjCVDTw5gR86bYLURECOrXgKn3n9zHw=; h=From:Subject:Date:To:Cc:From; b=DN9gGZSklIZq/UL0g1gMnm/1G7uMV4Pq7xaKNIzQiRzY4rogOw+Z97ncNaZDCWhNo bNaUdnkPC1tWPVkJPoWnOc4qyK3sflxjRRxAniL/j0jqnaQ6xJ4STAxIGRYaPlqGsg To4P/lN/7o4bGYVEfYWgxhQJT+OnSA4MDXMcggOQBai1b+BGIBp89P/ppKOXtMyFr1 Mq/V4P8NDXN63BVKhvFXs4SriHidViIPbBwK4IoHgq+NkRcFY6Fh1nhuZAi/tA0kMX fCRLr/J2KPDxz0BdHLi8W3XA3f427qMUDXsqxZLNE3blThJhX8+ZSEriQWUhqyUMva jbNWs34o7i6Ww== From: Mark Brown Subject: [PATCH 0/2] KVM: arm64: Store a cpu_fp_state directly in the vCPU data Date: Mon, 26 Feb 2024 20:44:09 +0000 Message-Id: <20240226-kvm-arm64-group-fp-data-v1-0-07d13759517e@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIABr43GUC/x3MwQqDMAyA4VeRnBfoYunBVxk7BE1dkGpJNxFK3 92y43f4/wpFTKXANFQwObXosXc8HwPMH95XQV26gRx5RxRwOxOypeBxteOXMWZc+MvoWMYwzkI +CvQ6m0S9/ufXu7UbGFEayGkAAAA= To: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=1307; i=broonie@kernel.org; h=from:subject:message-id; bh=q4y2X/QHhahydjCVDTw5gR86bYLURECOrXgKn3n9zHw=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBl3QYNyJcuw5R7ZvMsPlX9Jct2g8pwbHrFBfsUoUkG dREKPm+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZd0GDQAKCRAk1otyXVSH0KsTB/ 9Km1/eQVR4Bymv26xJINCBgG9Os0SOmZYsDaaFD9cM9YQpJZtWE9rwtzx63a6KbZ2oTJzU6xSEIXd4 8pNZ0Us8fXAX25i1xJ0/WRoZnL0upzJJu1rbPFmGE4qS81CwqbuLbMWvm6o4/1UhCBnzgcmJ4l9TQG mUhxFINAa4p82LL4o1XCbG8cdDPJrzaOGzR48ZfqKX+1xvfbTT5nk4iZIg3IKZ1ucOvQmyYFPoeCZB pjWPXLfzAU6qKt6YGzIUFWkzBG7D+ZWit17CvZG1WFnF7uMprMkHR8MNsaIb/ofRy4KZC/raBn0P54 3R2SZ8Wfg4hptSjMEU/hz710chRvJS X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_134348_578023_0141C37B X-CRM114-Status: UNSURE ( 8.02 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the binding of the guest state to the CPU when returning to the host by storing a copy of the structure used to pass the state in the vCPU data and initialising it during guest setup rather than creating a new copy each time we exit the guest. Signed-off-by: Mark Brown --- Mark Brown (2): KVM: arm64: Rename variable for tracking ownership of FP state KVM: arm64: Reuse struct cpu_fp_state to track the guest FP state arch/arm64/include/asm/kvm_emulate.h | 4 ++-- arch/arm64/include/asm/kvm_host.h | 25 ++++++++++++------------- arch/arm64/kvm/arm.c | 14 +++++++++++++- arch/arm64/kvm/fpsimd.c | 29 ++++++----------------------- arch/arm64/kvm/guest.c | 21 ++++++++++++++------- arch/arm64/kvm/hyp/include/hyp/switch.h | 6 +++--- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 9 +++++---- arch/arm64/kvm/hyp/nvhe/switch.c | 2 +- arch/arm64/kvm/hyp/vhe/switch.c | 2 +- arch/arm64/kvm/reset.c | 14 ++++++++------ 10 files changed, 65 insertions(+), 61 deletions(-) --- base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 change-id: 20240226-kvm-arm64-group-fp-data-0ae363ce24fe Best regards,