Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153895807
D29921.id87967.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29921.id87967.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/asm/fpu/api.h b/sys/compat/linuxkpi/common/include/asm/fpu/api.h
--- a/sys/compat/linuxkpi/common/include/asm/fpu/api.h
+++ b/sys/compat/linuxkpi/common/include/asm/fpu/api.h
@@ -32,14 +32,16 @@
#include <machine/fpu.h>
-extern struct fpu_kern_ctx *__lkpi_fpu_ctx;
+/* Technically the Linux API isn't supposed to allow nesting sections either,
+ * but currently used versions of GPU drivers rely on nesting working,
+ * so we only enter the section on the outermost level. */
extern unsigned int __lkpi_fpu_ctx_level;
static inline void
kernel_fpu_begin()
{
if (__lkpi_fpu_ctx_level++ == 0) {
- fpu_kern_enter(curthread, __lkpi_fpu_ctx, FPU_KERN_NORMAL);
+ fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
}
}
@@ -47,7 +49,7 @@
kernel_fpu_end()
{
if (--__lkpi_fpu_ctx_level == 0) {
- fpu_kern_leave(curthread, __lkpi_fpu_ctx);
+ fpu_kern_leave(curthread, NULL);
}
}
diff --git a/sys/compat/linuxkpi/common/src/linux_fpu.c b/sys/compat/linuxkpi/common/src/linux_fpu.c
--- a/sys/compat/linuxkpi/common/src/linux_fpu.c
+++ b/sys/compat/linuxkpi/common/src/linux_fpu.c
@@ -25,26 +25,4 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-
-#include <machine/fpu.h>
-
-struct fpu_kern_ctx *__lkpi_fpu_ctx;
unsigned int __lkpi_fpu_ctx_level = 0;
-
-static void
-linux_fpu_init(void *arg __unused)
-{
- __lkpi_fpu_ctx = fpu_kern_alloc_ctx(0);
-}
-SYSINIT(linux_fpu, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_fpu_init, NULL);
-
-static void
-linux_fpu_uninit(void *arg __unused)
-{
- fpu_kern_free_ctx(__lkpi_fpu_ctx);
-}
-SYSUNINIT(linux_fpu, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_fpu_uninit, NULL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 25, 2:50 PM (3 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32130561
Default Alt Text
D29921.id87967.diff (1 KB)
Attached To
Mode
D29921: linuxkpi: make FPU sections thread-safe and NOCTX
Attached
Detach File
Event Timeline
Log In to Comment