Re: [RFC PATCH v8 13/21] riscv: Add support for kernel mode vector
From: Christoph Hellwig
Date: Thu Sep 09 2021 - 02:18:23 EST
On Thu, Sep 09, 2021 at 01:45:25AM +0800, Greentime Hu wrote:
> +obj-$(CONFIG_VECTOR) += kernel_mode_vector.o
> +riscv-march-cflags-$(CONFIG_ARCH_RV32I) := rv32ima
> +riscv-march-cflags-$(CONFIG_ARCH_RV64I) := rv64ima
> +riscv-march-cflags-$(CONFIG_RISCV_ISA_C) := $(riscv-march-cflags-y)c
> +riscv-march-cflags-$(CONFIG_VECTOR) := $(riscv-march-cflags-y)v
> +CFLAGS_kernel_mode_vector.o += -march=$(riscv-march-cflags-y)
Do we need a helper in arch/riscv/Makefile to define the vector flags
instead of open coding them where used? Also I think the variable
name should include vector in it.
> +EXPORT_SYMBOL(kernel_rvv_begin);
> +EXPORT_SYMBOL(kernel_rvv_end);
This needs to be EXPORT_SYMBOL_GPL just like x86 kernel_fpu_begin/end