• Palmer Dabbelt's avatar
    Merge patch series "riscv: support kernel-mode Vector" · a894e8ed
    Palmer Dabbelt authored
    Andy Chiu <andy.chiu@sifive.com> says:
    
    This series provides support running Vector in kernel mode.
    Additionally, kernel-mode Vector can be configured to run without
    turnning off preemption on a CONFIG_PREEMPT kernel. Along with the
    suport, we add Vector optimized copy_{to,from}_user. And provide a
    simple threshold to decide when to run the vectorized functions.
    
    We decided to drop vectorized memcpy/memset/memmove for the moment due
    to the concern of memory side-effect in kernel_vector_begin(). The
    detailed description can be found at v9[0]
    
    This series is composed by 4 parts:
     patch 1-4: adds basic support for kernel-mode Vector
     patch 5: includes vectorized copy_{to,from}_user into the kernel
     patch 6: refactor context switch code in fpu [1]
     patch 7-10: provides some code refactors and support for preemptible
                 kernel-mode Vector.
    
    This series can be merged if we feel any part of {1~4, 5, 6, 7~10} is
    mature enough.
    
    This patch is tested on a QEMU with V and verified that booting, normal
    userspace operations all work as usual with thresholds set to 0. Also,
    we test by launching multiple kernel threads which continuously executes
    and verifies Vector operations in the background. The module that tests
    these operation is expected to be upstream later.
    
    * b4-shazam-merge:
      riscv: vector: allow kernel-mode Vector with preemption
      riscv: vector: use kmem_cache to manage vector context
      riscv: vector: use a mask to write vstate_ctrl
      riscv: vector: do not pass task_struct into riscv_v_vstate_{save,restore}()
      riscv: fpu: drop SR_SD bit checking
      riscv: lib: vectorize copy_to_user/copy_from_user
      riscv: sched: defer restoring Vector context for user
      riscv: Add vector extension XOR implementation
      riscv: vector: make Vector always available for softirq context
      riscv: Add support for kernel mode vector
    
    Link: https://lore.kernel.org/r/20240115055929.4736-1-andy.chiu@sifive.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
    a894e8ed
thread_info.h 3.66 KB