summaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/process.c
diff options
context:
space:
mode:
authorGreentime Hu <greentime.hu@sifive.com>2024-01-15 05:59:20 +0000
committerPalmer Dabbelt <palmer@rivosinc.com>2024-01-16 07:13:53 -0800
commitecd2ada8a5e0b464dab54f71d4ba7bbf5708711f (patch)
tree23dd7e28a56871c4286f8dd07bb1bf5dbda14e18 /arch/riscv/kernel/process.c
parentb85ea95d086471afb4ad062012a4d73cd328fa86 (diff)
downloadlinux-ecd2ada8a5e0b464dab54f71d4ba7bbf5708711f.tar.gz
linux-ecd2ada8a5e0b464dab54f71d4ba7bbf5708711f.tar.bz2
linux-ecd2ada8a5e0b464dab54f71d4ba7bbf5708711f.zip
riscv: Add support for kernel mode vector
Add kernel_vector_begin() and kernel_vector_end() function declarations and corresponding definitions in kernel_mode_vector.c These are needed to wrap uses of vector in kernel mode. Co-developed-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Greentime Hu <greentime.hu@sifive.com> Signed-off-by: Andy Chiu <andy.chiu@sifive.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Tested-by: Björn Töpel <bjorn@rivosinc.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20240115055929.4736-2-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/process.c')
-rw-r--r--arch/riscv/kernel/process.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 4f21d970a129..4a1275db1146 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -221,6 +221,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
childregs->a0 = 0; /* Return value of fork() */
p->thread.s[0] = 0;
}
+ p->thread.riscv_v_flags = 0;
p->thread.ra = (unsigned long)ret_from_fork;
p->thread.sp = (unsigned long)childregs; /* kernel sp */
return 0;