Skip to content

Commit 501b719

Browse files
committed
More cleanup (HWTLS config, FP save on IRQ/EXCP config)
1 parent 72bd80e commit 501b719

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,14 @@ menu "Optimizations"
904904
Compiles the kernel to save FPU state on every context switch.
905905
This is not strictly necessary if processors are not virtualized
906906
(by the HRT).
907+
908+
config FPU_SAVE_IRQ_EXCP
909+
bool "Save FPU state on all interrupts and exceptions"
910+
default y
911+
help
912+
Compiles the kernel to save FPU state on every exception and interrupt.
913+
This is necessary if it is possible for the compiler to use
914+
FP/SSE/AVX/etc state during an exception or interrupt handler
907915

908916
config KICK_SCHEDULE
909917
bool "Kick cores with IPIs on scheduling events"

configs/testing/default.config

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Automatically generated make config: don't edit
33
#Nautilus:
4-
# Mon Dec 28 17:45:09 2020
4+
# Mon Dec 28 18:12:42 2020
55
#
66

77
#
@@ -70,7 +70,7 @@ NAUT_CONFIG_APERIODIC_ROUND_ROBIN=y
7070
#
7171
# NAUT_CONFIG_WATCHDOG is not set
7272
# NAUT_CONFIG_ISOCORE is not set
73-
# NAUT_CONFIG_HARDWARE_TLS is not set
73+
NAUT_CONFIG_HARDWARE_TLS=y
7474
# NAUT_CONFIG_CACHEPART is not set
7575

7676
#
@@ -90,12 +90,17 @@ NAUT_CONFIG_BASE_LIBC_COMPAT=y
9090
# NAUT_CONFIG_DEBUG_BASE_LIBC_COMPAT is not set
9191
NAUT_CONFIG_BASE_LIBM_COMPAT=y
9292
# NAUT_CONFIG_DEBUG_BASE_LIBM_COMPAT is not set
93-
# NAUT_CONFIG_BASE_LINUX_COMPAT is not set
93+
NAUT_CONFIG_BASE_LINUX_COMPAT=y
94+
# NAUT_CONFIG_DEBUG_BASE_LINUX_COMPAT is not set
95+
NAUT_CONFIG_BASE_PTHREAD_COMPAT=y
96+
# NAUT_CONFIG_BASE_PTHREAD_COMPAT_TESTS is not set
97+
# NAUT_CONFIG_DEBUG_BASE_PTHREAD_COMPAT is not set
9498

9599
#
96100
# Optimizations
97101
#
98102
NAUT_CONFIG_FPU_SAVE=y
103+
NAUT_CONFIG_FPU_SAVE_IRQ_EXCP=y
99104
NAUT_CONFIG_KICK_SCHEDULE=y
100105
NAUT_CONFIG_HALT_WHILE_IDLE=y
101106
# NAUT_CONFIG_THREAD_OPTIMIZE is not set

src/asm/excp_early.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GLOBAL(early_irq_common)
7575

7676
SAVE_GPRS()
7777

78-
#ifdef NAUT_CONFIG_FPU_SAVE
78+
#ifdef NAUT_CONFIG_FPU_SAVE_IRQ_EXCP
7979
/* Save the FPRs */
8080
movq %gs:0x0, %rax
8181
movzwq 16(%rax), %rbx
@@ -208,7 +208,7 @@ skip_cat_exit:
208208

209209
#endif
210210

211-
#ifdef NAUT_CONFIG_FPU_SAVE
211+
#ifdef NAUT_CONFIG_FPU_SAVE_IRQ_EXCP
212212
/* Restore the FPRs */
213213
movq %gs:0x0, %rax
214214
movzwq 16(%rax), %rbx
@@ -241,7 +241,7 @@ GLOBAL(early_excp_common)
241241

242242
SAVE_GPRS()
243243

244-
#ifdef NAUT_CONFIG_FPU_SAVE
244+
#ifdef NAUT_CONFIG_FPU_SAVE_IRQ_EXCP
245245
/* Save the FPRs */
246246
movq %gs:0x0, %rax
247247
movzwq 16(%rax), %rbx
@@ -298,7 +298,7 @@ skip_per_cpu_update1:
298298

299299
skip_per_cpu_update2:
300300

301-
#ifdef NAUT_CONFIG_FPU_SAVE
301+
#ifdef NAUT_CONFIG_FPU_SAVE_IRQ_EXCP
302302
/* Restore the FPRs */
303303
movq %gs:0x0, %rax
304304
movzwq 16(%rax), %rbx

0 commit comments

Comments
 (0)