From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Gianluca Guida <gianluca@rivosinc.com>,
Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Bob Eshleman <bobbyeshleman@gmail.com>,
Alistair Francis <alistair.francis@wdc.com>,
Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v3 1/3] xen/riscv: disable fpu
Date: Fri, 3 Mar 2023 12:24:22 +0200 [thread overview]
Message-ID: <1fe0c827b9e5c2fef569e25ad7ca377111228d29.1677838213.git.oleksii.kurochko@gmail.com> (raw)
In-Reply-To: <cover.1677838213.git.oleksii.kurochko@gmail.com>
Disable FPU to detect illegal usage of floating point in kernel
space.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
xen/arch/riscv/riscv64/head.S | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index ffd95f9f89..52fa41c778 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -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
--
2.39.0
next prev parent reply other threads:[~2023-03-03 10:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 10:24 [PATCH v3 0/3] Do basic initialization things Oleksii Kurochko
2023-03-03 10:24 ` Oleksii Kurochko [this message]
2023-03-03 10:25 ` [PATCH v3 1/3] xen/riscv: disable fpu Andrew Cooper
2023-03-09 10:39 ` Bobby Eshleman
2023-03-09 10:42 ` Bobby Eshleman
2023-03-03 10:24 ` [PATCH v3 2/3] xen/riscv: read/save hart_id and dtb_base passed by bootloader Oleksii Kurochko
2023-03-03 10:27 ` Andrew Cooper
2023-03-03 10:39 ` Oleksii
2023-03-09 10:44 ` Bobby Eshleman
2023-03-03 10:24 ` [PATCH v3 3/3] xen/riscv: initialize .bss section Oleksii Kurochko
2023-03-03 10:33 ` Andrew Cooper
2023-03-03 10:42 ` Oleksii
2023-03-03 10:53 ` Andrew Cooper
2023-03-03 11:06 ` Oleksii
2023-03-09 10:48 ` Bobby Eshleman
2023-03-05 7:06 ` [PATCH v3 0/3] Do basic initialization things Bobby Eshleman
2023-03-16 0:37 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1fe0c827b9e5c2fef569e25ad7ca377111228d29.1677838213.git.oleksii.kurochko@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=gianluca@rivosinc.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.