diff mbox series

xen/riscv: disable fpu

Message ID 63c797ba52f6d7edc64f9d2e41b460c7d64330ae.1677249707.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series xen/riscv: disable fpu | expand

Commit Message

Oleksii Kurochko Feb. 24, 2023, 2:48 p.m. UTC
Disable FPU to detect illegal usage of floating point in kernel
space.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/setup.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jan Beulich Feb. 24, 2023, 3:08 p.m. UTC | #1
On 24.02.2023 15:48, Oleksii Kurochko wrote:
> Disable FPU to detect illegal usage of floating point in kernel
> space.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/arch/riscv/setup.c | 7 +++++++
>  1 file changed, 7 insertions(+)

This looks to contextually depend on earlier individually sent patches.
When there are dependencies, preferably group the patches in a series,
or if not at the very least call out the dependency in the post-commit-
message area, for committers to be aware.

Jan

> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -36,6 +36,11 @@ static void __init init_bss(void)
>      }
>  }
>  
> +static void __init disable_fpu(void)
> +{
> +    csr_write(CSR_SSTATUS, SSTATUS_FS);
> +}
> +
>  void __init noreturn start_xen(void)
>  {
>      /*
> @@ -52,6 +57,8 @@ void __init noreturn start_xen(void)
>  
>      init_bss();
>  
> +    disable_fpu();
> +
>      early_printk("Hello from C env\n");
>  
>      trap_init();
diff mbox series

Patch

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 593bb471a4..b7cd438a1d 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -36,6 +36,11 @@  static void __init init_bss(void)
     }
 }
 
+static void __init disable_fpu(void)
+{
+    csr_write(CSR_SSTATUS, SSTATUS_FS);
+}
+
 void __init noreturn start_xen(void)
 {
     /*
@@ -52,6 +57,8 @@  void __init noreturn start_xen(void)
 
     init_bss();
 
+    disable_fpu();
+
     early_printk("Hello from C env\n");
 
     trap_init();