Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/riscv: disable fpu
@ 2023-02-24 14:48 Oleksii Kurochko
  2023-02-24 15:08 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksii Kurochko @ 2023-02-24 14:48 UTC (permalink / raw
  To: xen-devel
  Cc: Andrew Cooper, Stefano Stabellini, Gianluca Guida,
	Oleksii Kurochko, Bob Eshleman, Alistair Francis, Connor Davis

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(+)

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();
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen/riscv: disable fpu
  2023-02-24 14:48 [PATCH] xen/riscv: disable fpu Oleksii Kurochko
@ 2023-02-24 15:08 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2023-02-24 15:08 UTC (permalink / raw
  To: Oleksii Kurochko
  Cc: Andrew Cooper, Stefano Stabellini, Gianluca Guida, Bob Eshleman,
	Alistair Francis, Connor Davis, xen-devel

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();



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-24 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24 14:48 [PATCH] xen/riscv: disable fpu Oleksii Kurochko
2023-02-24 15:08 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).