]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/riscv: disable fpu
authorOleksii Kurochko <oleksii.kurochko@gmail.com>
Mon, 20 Mar 2023 16:10:34 +0000 (17:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 20 Mar 2023 16:10:34 +0000 (17:10 +0100)
Disable FPU to detect illegal usage of floating point in kernel
space.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@gmail.com>
xen/arch/riscv/riscv64/head.S

index ffd95f9f89224ea29616beb691949eeaf56528f9..52fa41c778a1ef079d6b2d53e1a9bf33f9b7d26b 100644 (file)
@@ -6,6 +6,13 @@ ENTRY(start)
         /* Mask all interrupts */
         csrw    CSR_SIE, zero
 
+        /*
+         * Disable FPU to detect illegal usage of
+         * floating point in kernel space
+         */
+        li      t0, SSTATUS_FS
+        csrc    CSR_SSTATUS, t0
+
         la      sp, cpu0_boot_stack
         li      t0, STACK_SIZE
         add     sp, sp, t0