Re: [RFC PATCH 09/12] riscv: Add support for kernel-mode FPU

2023-12-11 Thread Samuel Holland
On 2023-12-11 10:11 AM, Christoph Hellwig wrote: >> +#ifdef __riscv_f >> + >> +#define kernel_fpu_begin() \ >> +static_assert(false, "floating-point code must use a separate >> translation unit") >> +#define kernel_fpu_end() kernel_fpu_begin() >> + >> +#else >> + >> +void kernel_fpu_begin(void

Re: [RFC PATCH 09/12] riscv: Add support for kernel-mode FPU

2023-12-11 Thread Christoph Hellwig
> +#ifdef __riscv_f > + > +#define kernel_fpu_begin() \ > + static_assert(false, "floating-point code must use a separate > translation unit") > +#define kernel_fpu_end() kernel_fpu_begin() > + > +#else > + > +void kernel_fpu_begin(void); > +void kernel_fpu_end(void); > + > +#endif I'll assum

[RFC PATCH 09/12] riscv: Add support for kernel-mode FPU

2023-12-08 Thread Samuel Holland
This is motivated by the amdgpu DRM driver, which needs floating-point code to support recent hardware. That code is not performance-critical, so only provide a minimal non-preemptible implementation for now. Use a similar trick as ARM to force placing floating-point code in a separate translation