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 38293F53D7E for ; Mon, 16 Mar 2026 17:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yfTWdzjnrvewRwOQeVe42zw4HC7ZbmZ+E1smTCPhggc=; b=H9/hyskuQy9wyzEhbBrq++daKR n/CFLBdLHfGOtFYXkKs0yuzDLmpTG5PhK3Ufb9BdoxtJUT+84FoMuFPYcAzVZaXZm2Qu6CNW9hdHp IZPPWuFrXooSzgFqhTWc2tkXe4zOJl//YcjPEejiUJsRAJpM64Q0D4cKq6qku4PzN3TkLAq8JbSoP v07V6UMGvhYOYRfvkIqaF5Wj0fwBkvL1FnKQVtdUq3n4QPnavYWzRVD0d+iGjLUQ9xxjMwYauV2BY gA3pHli6lZQIxZ5+IWSrMssUCV7L40tPMRPNarkGY1zR+Z5GwHQR/n2UnsLghDHPnR5vf96Nnq69u uXkaCnBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2BxP-00000004bMA-0f1U; Mon, 16 Mar 2026 17:42:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2BxN-00000004bLh-2Avd for linux-arm-kernel@lists.infradead.org; Mon, 16 Mar 2026 17:42:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D40CE1476; Mon, 16 Mar 2026 10:42:12 -0700 (PDT) Received: from arm.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F04F63F73B; Mon, 16 Mar 2026 10:42:15 -0700 (PDT) Date: Mon, 16 Mar 2026 17:42:13 +0000 From: Catalin Marinas To: Mark Brown Cc: Marc Zyngier , Joey Gouly , Suzuki K Poulose , Will Deacon , Paolo Bonzini , Jonathan Corbet , Shuah Khan , Oliver Upton , Dave Martin , Fuad Tabba , Mark Rutland , Ben Horgan , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Peter Maydell , Eric Auger Subject: Re: [PATCH v10 03/30] arm64/fpsimd: Decide to save ZT0 and streaming mode FFR at bind time Message-ID: References: <20260306-kvm-arm64-sme-v10-0-43f7683a0fb7@kernel.org> <20260306-kvm-arm64-sme-v10-3-43f7683a0fb7@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260306-kvm-arm64-sme-v10-3-43f7683a0fb7@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260316_104221_599818_A7EBB9BD X-CRM114-Status: GOOD ( 15.66 ) 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 On Fri, Mar 06, 2026 at 05:00:55PM +0000, Mark Brown wrote: > Some parts of the SME state are optional, enabled by additional features > on top of the base FEAT_SME and controlled with enable bits in SMCR_ELx. We > unconditionally enable these for the host but for KVM we will allow the > feature set exposed to guests to be restricted by the VMM. These are the > FFR register (FEAT_SME_FA64) and ZT0 (FEAT_SME2). > > We defer saving of guest floating point state for non-protected guests to > the host kernel. We also want to avoid having to reconfigure the guest > floating point state if nothing used the floating point state while running > the host. If the guest was running with the optional features disabled then > traps will be enabled for them so the host kernel will need to skip > accessing that state when saving state for the guest. > > Support this by moving the decision about saving this state to the point > where we bind floating point state to the CPU, adding a new variable to > the cpu_fp_state which uses the enable bits in SMCR_ELx to flag which > features are enabled. > > Reviewed-by: Fuad Tabba > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas