LinuxKPI: Do not use explicit context in FPU sections on powerpc64

It is not supported yet.

Sponsored by:	Serenity Cyber Security, LLC
Fixes:	5a3bd28167 ("LinuxKPI: Add explicit software context to FPU sections")
MFC after:	1 week
This commit is contained in:
Vladimir Kondratyev
2023-12-24 15:48:06 +03:00
parent 9bf957fc9b
commit b4efc62776
3 changed files with 8 additions and 9 deletions
@@ -33,11 +33,6 @@
#include <sys/proc.h>
#include <sys/malloc.h>
#if defined(__aarch64__) || defined(__arm__) || defined(__amd64__) || \
defined(__i386__) || defined(__powerpc64__)
#define LKPI_HAVE_FPU_CTX
#endif
struct domainset;
struct thread;
struct task_struct;
@@ -43,7 +43,8 @@
#include <sys/sysctl.h>
#include <vm/uma.h>
#ifdef LKPI_HAVE_FPU_CTX
#if defined(__aarch64__) || defined(__arm__) || defined(__amd64__) || \
defined(__i386__)
#include <machine/fpu.h>
#endif
@@ -160,7 +161,8 @@ linux_alloc_current(struct thread *td, int flags)
int
linux_set_fpu_ctx(struct task_struct *task)
{
#ifdef LKPI_HAVE_FPU_CTX
#if defined(__aarch64__) || defined(__arm__) || defined(__amd64__) || \
defined(__i386__)
if (task->fpu_ctx == NULL && curthread->td_critnest == 0)
task->fpu_ctx = fpu_kern_alloc_ctx(FPU_KERN_NOWAIT);
#endif
@@ -190,7 +192,8 @@ void
linux_free_current(struct task_struct *ts)
{
mmput(ts->mm);
#ifdef LKPI_HAVE_FPU_CTX
#if defined(__aarch64__) || defined(__arm__) || defined(__amd64__) || \
defined(__i386__)
if (ts->fpu_ctx != NULL)
fpu_kern_free_ctx(ts->fpu_ctx);
#endif
+2 -1
View File
@@ -35,7 +35,8 @@
#include <asm/fpu/api.h>
#ifdef LKPI_HAVE_FPU_CTX
#if defined(__aarch64__) || defined(__arm__) || defined(__amd64__) || \
defined(__i386__) || defined(__powerpc64__)
#include <machine/fpu.h>