Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4122438rba; Tue, 2 Apr 2024 08:11:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVppyNoqq01WaP5yuSIAEIwKT2RBVppt8rYb3LqqboINcCJJ1Lvps/GVzCbs0wkQuXmVyurXx9tk91CA7NpJZtRwphdlVNnKOS7GdqCPw== X-Google-Smtp-Source: AGHT+IGGcDGpxaaA4bzsgpPoeFij0PHQhXTamkyjjWG4lvRfVZBgrmQyzt1882ZPwlo2RjxOlrGW X-Received: by 2002:a17:903:248a:b0:1dd:651d:cc47 with SMTP id p10-20020a170903248a00b001dd651dcc47mr11856538plw.28.1712070702475; Tue, 02 Apr 2024 08:11:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712070702; cv=pass; d=google.com; s=arc-20160816; b=zmbDCx42tvnFELCUnjoEghbUR0sOplMFd82B+R0FH5A2PjGRXZbbA1hLjdl905+8yO 4/1zPOekHKWMAl1qAO4isJjvYFL+V2uzNhuryfLpbcDglZ9rlq8NFHLqH4ABsTBlbx+b UbSyzfbhdeTiQOKzDUccGSWpWTHxIW63RDjQPlNdMr0XSFBQmZKKN0Kdb8IfBYKNy4Av DBbaOpaH7sbdmXntzIMZGljFJ6izjH7Fu+H33gEZuAbBWfbDLLpaKYVMDyo7966+W2Xv U6g4CKg4QIp8XgdVyTAgygxOydLmNKsXBZsDXPTZvbZztqOL4bXteTlIfWwCv0UDVPra SyoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=w+6dLdHbT25J03b6+SrWwxOJrUpMRR0ZA9IO6dhQAhY=; fh=tSp6ma9Jv3sLN3eTW97gLZpmtk82Mj/RjOKh/tYGhYM=; b=eK2M0ptuGiLlpyAFk6PIhSt5AFtpSc0rW+MNabth9t1t5iNarLQpvGYO7DHQXmvbNz JHBTRpM93IS2c9xMlKlTeO6ZlS2oorjbgM8N+awM+OFq9lC6DBX9CxXDHioP1gVHiLmY BmpYqQ6xH8lV0rCJPRwYj2IQfnaLRVhJ1I7kFfFYKE+lAQnooRKuc5ruz7JclIGJXiv9 5LBVWr2W6pnovwkhjQMY3Uco2uo4EjSk258WeF+3y7IzwnJbKp+7h8y1B7oUuMSwn9jM ht78+Njl3iGuDmWJ3yxnvYb/H/j30LsTzg0/ZlfOBWtTaA8nvPpWwGWvFDLwG0/VIx2R 1O6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PymLJU3p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-128150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lw14-20020a1709032ace00b001e2194744b0si11470758plb.244.2024.04.02.08.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 08:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PymLJU3p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-128150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4DD37B28176 for ; Tue, 2 Apr 2024 14:36:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A21BF1332B1; Tue, 2 Apr 2024 14:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PymLJU3p" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8469B133987; Tue, 2 Apr 2024 14:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068475; cv=none; b=O1gCl8lKAKuMqiP6c55pZqcid+wvZTztnlZtYcV26dz2QbO+TASv5loi2BuDuTfNY5el3I9RFMFEyQj3mT2gxSvdnROciTJQGow0hyNg1+sMtBoxB3bxAPpBGy0WkoRlSLHFyHUfJ17i+flt2Nw521TJO6HSmC9dMiO5Z+yMIIU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068475; c=relaxed/simple; bh=88vG8m/Z1Is5v5cdweaMvnmV27K8I1EF8uwunhQOlnw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CGMa5onk2V2PRodUL72keeC71oAC5kvf81bKVMrHfbVkUd4tFZ6/Kh/oIyWXRfO3ILNfiUKGawWVs/WUosxIZn5RCCB5dlHGvEPZPjbx8XLHru5WCODWiONV2Cl5h2pUhzwYprN7JdTY8bI10L4cwf9433kSCPMalI9qLuzwe6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PymLJU3p; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FA91C433F1; Tue, 2 Apr 2024 14:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712068475; bh=88vG8m/Z1Is5v5cdweaMvnmV27K8I1EF8uwunhQOlnw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PymLJU3pyvC52D8w0piQ/VqTuwyF8N82wEbV1H9vuAONQav7v7XVivRH/j/Rb1Ti/ HwsrzbTJ3Q0mIMRx/+VxxWKv48GSLb+EEtHhfmw8rDRZCmdUO8f0BaUrLK16d1f0/h 9iKucjI1k5w8GS4ouqCy3gCJDPa0/k5sOMQ7pJV/YUaBrJLeqHGpDEAJpxoAruQaxR 7q/r8L1FzLKYVTZgtW582Pio3oBX477bDcDw6+0tGlOcdMoIeetgmUzVc/uSnHUnX6 iiq8kR7trXX4fKXqNpu3MtgQPPzgacbTYCissL9p58IrHthWJUnnCKRKiApVvmK0wM Un8G0Koo3GqDg== Date: Tue, 2 Apr 2024 15:34:27 +0100 From: Mark Brown To: Marc Zyngier Cc: Catalin Marinas , Will Deacon , Oliver Upton , James Morse , Suzuki K Poulose , Jonathan Corbet , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Martin , kvmarm@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v6 1/5] KVM: arm64: Share all userspace hardened thread data with the hypervisor Message-ID: References: <20240329-arm64-2023-dpisa-v6-0-ba42db6c27f3@kernel.org> <20240329-arm64-2023-dpisa-v6-1-ba42db6c27f3@kernel.org> <87msqesoty.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3LQNOITM1KKeWjCg" Content-Disposition: inline In-Reply-To: <87msqesoty.wl-maz@kernel.org> X-Cookie: Knowledge is power. --3LQNOITM1KKeWjCg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 31, 2024 at 11:00:41AM +0100, Marc Zyngier wrote: > Mark Brown wrote: > > As part of the lazy FPSIMD state transitioning done by the hypervisor we > > currently share the userpsace FPSIMD state in thread->uw.fpsimd_state w= ith > > the host. Since this struct is non-extensible userspace ABI we have to = keep > Using the same representation is just pure convenience, and nothing > requires us to use the it in the kernel/hypervisor. Indeed, the additional data seemed contained enough that it was a reasonable tradeoff. > > the definition as is but the addition of FPMR in the 2023 dpISA means t= hat > > we will want to share more storage with the host. To facilitate this > > refactor the current code to share the entire thread->uw rather than ju= st > > the one field. > So this increase the required sharing with EL2 from 528 bytes to > 560. Not a huge deal, but definitely moving in the wrong direction. Is > there any plans to add more stuff to this structure that wouldn't be > *directly* relevant to the hypervisor? I'm not aware of any current plans to extend this. > > @@ -640,7 +641,7 @@ struct kvm_vcpu_arch { > > struct kvm_guest_debug_arch vcpu_debug_state; > > struct kvm_guest_debug_arch external_debug_state; > > =20 > > - struct user_fpsimd_state *host_fpsimd_state; /* hyp VA */ > > + struct thread_struct_uw *host_uw; /* hyp VA */ > > struct task_struct *parent_task; > Well, this is going away, and you know it. Sure, those patches are still in flight though. It does seem reasonable to target the current code. --3LQNOITM1KKeWjCg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmYMF3MACgkQJNaLcl1U h9B5AwgAhpV1i1kBzNj1g27Or01g8HGoRjn1rDwbQhp9el4SuuJTTDy0hC7NoUu4 2yIpwVaql/hK/jq2O4qzjN/WaZpXEg1uQdt0UfSnyTa4LoDGwfnA5Bt7KNTCnCCK 7jnKGBvP1OEPSU/w7pQz029FV1hHySP73XNcXwpnE5YXuu5XVHZ/5x2mAYiP1XKG SLRnMJ68l0yUMxbCbnJFAuWg04X3MxUmFZjOQtc1McnI5HJRmUN79OI9ifqrOEOU e9XGatS9m3/Mfdr+z1sDK45sE+XSIHxMBHOFJDo1VY2DAXMoKYO244XiI4asC+y9 9uJmDNEyA7pg/yRI/cujvTKLtha6Gw== =Gfx9 -----END PGP SIGNATURE----- --3LQNOITM1KKeWjCg--