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 65F2ECD4F54 for ; Thu, 28 May 2026 16:25:44 +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=N1zLt52KaXa8LDTOo23h0G0wFhop7E1a4kOv5Yi+tlY=; b=rXKjQkABJlm26MhRMy6EXqJ/+S HV98p5tAK0MfM5jH0xhYfIIcJtTjoS8FQeWwuwNFnb6cCHt8fzw/iL/wVmlhza2bysIio+NTWFUl+ u//YZdO3Pe2Pwmx62//l4n4/2ZhY/srbaGtxyOzYKijq/yJf78Y92QcFRhAnt2EL6zbsnQbRYWO7a YhOypgX7D06smMbzwF/0tvb3Vf3j/W7CcGxdbCoSHeBhJDdAnqeKK5QTTqsFzhj/L5bz4MOAWaG0R lwOfa0Co+UwuwvTzXXuhwTttPcl/bMFJRCjha4rqHO0hZr0YGwI1LlFBePdHDpvrIue5aDxVgJ03J gvFWhgKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wSdY8-0000000603c-2DwD; Thu, 28 May 2026 16:25:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wSdY6-0000000603F-19Vm for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2026 16:25:35 +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 2C1421EA6; Thu, 28 May 2026 09:25:28 -0700 (PDT) Received: from J2N7QTR9R3.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8B8B33F905; Thu, 28 May 2026 09:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1779985533; bh=4qVVxVlLrFwja/fGOheikl2q8R1303Pa8aphqsMP7dE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W5F3ALW+y0jmAvpkAxf42xmDyUgQ9WsBf9lxdFJtM2gNmp2/5bs/7lZO09KVj3gSa u+8WGP8dtkgGZzkCt+i2p8gu1Fl2bqnrD/yFPIN84xa3hfrDMtnTr2YjQdPW9NeAqD vbLaDZuCSZLXxpK+2O15RFZRcodvBrX5qFZU9XsE= Date: Thu, 28 May 2026 17:25:29 +0100 From: Mark Rutland To: Vladimir Murzin Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, maz@kernel.org, oupton@kernel.org, tabba@google.com, will@kernel.org Subject: Re: [PATCH 13/18] arm64: fpsimd: Use opaque type for SVE state Message-ID: References: <20260521132556.584676-1-mark.rutland@arm.com> <20260521132556.584676-14-mark.rutland@arm.com> <362fe07b-70d5-4933-96d3-6445242f9077@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <362fe07b-70d5-4933-96d3-6445242f9077@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260528_092534_409270_B46E0EC8 X-CRM114-Status: GOOD ( 16.78 ) 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 Thu, May 28, 2026 at 10:45:25AM +0100, Vladimir Murzin wrote: > On 5/21/26 14:25, Mark Rutland wrote: > > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > > index 9806fea8fea7c..66d880d081671 100644 > > --- a/arch/arm64/kernel/fpsimd.c > > +++ b/arch/arm64/kernel/fpsimd.c > > @@ -425,8 +425,7 @@ static void task_fpsimd_load(void) > > > > if (restore_sve_regs) { > > WARN_ON_ONCE(current->thread.fp_type != FP_STATE_SVE); > > - sve_load_state(sve_pffr(¤t->thread), > > - restore_ffr); > > + sve_load_state(current->thread.sve_state, restore_ffr); > > I do not know much about this code, I assume that live VL matches to current > but having some logic to check that assumption would be handy... At this point in task_fpsimd_load(), the NSVL and/or SVL have been configured by earlier writes to ZCR_EL1 and SMCR_EL1 respectively. I agree it might be good to add a check here, but it's less of a concern than in fpsimd_save_user_state(), where the check is there to detect cases where ZCR_EL1 and/or SMCR_EL1 were clobbered since the state was bound (e.g. since historically there was the potential for KVM to clobber the host state). For now I'm not going to add that, but I'll see if it makes sense to do that as part of any further rework. Mark.