From: Heiko Stübner Date: Fri, 31 Mar 2023 13:05:15 +0200 Subject: [PATCH -next v17 08/20] riscv: Introduce struct/helpers to save/restore per-task Vector state In-Reply-To: <20230327164941.20491-9-andy.chiu@sifive.com> References: <20230327164941.20491-1-andy.chiu@sifive.com> <20230327164941.20491-9-andy.chiu@sifive.com> Message-ID: <3488641.iIbC2pHGDl@diego> List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Am Montag, 27. M?rz 2023, 18:49:28 CEST schrieb Andy Chiu: > From: Greentime Hu > > Add vector state context struct to be added later in thread_struct. And > prepare low-level helper functions to save/restore vector contexts. > > This include Vector Regfile and CSRs holding dynamic configuration state > (vstart, vl, vtype, vcsr). The Vec Register width could be implementation > defined, but same for all processes, so that is saved separately. > > This is not yet wired into final thread_struct - will be done when > __switch_to actually starts doing this in later patches. > > Given the variable (and potentially large) size of regfile, they are > saved in dynamically allocated memory, pointed to by datap pointer in > __riscv_v_ext_state. > > Co-developed-by: Vincent Chen > Signed-off-by: Vincent Chen > Signed-off-by: Greentime Hu > Signed-off-by: Vineet Gupta > Signed-off-by: Andy Chiu > Acked-by: Conor Dooley > Reviewed-by: Guo Ren > Reviewed-by: Bj?rn T?pel Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner