Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153497966
D22053.id71750.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D22053.id71750.diff
View Options
Index: sys/amd64/amd64/fpu.c
===================================================================
--- sys/amd64/amd64/fpu.c
+++ sys/amd64/amd64/fpu.c
@@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
+#include <sys/domainset.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -1028,17 +1029,30 @@
char hwstate1[];
};
+static inline size_t __pure2
+fpu_kern_alloc_sz(u_int max_est)
+{
+ return (sizeof(struct fpu_kern_ctx) + XSAVE_AREA_ALIGN + max_est);
+}
+
+static inline int __pure2
+fpu_kern_malloc_flags(u_int fpflags)
+{
+ return (((fpflags & FPU_KERN_NOWAIT) ? M_NOWAIT : M_WAITOK) | M_ZERO);
+}
+
+struct fpu_kern_ctx *
+fpu_kern_alloc_ctx_domainset(struct domainset *ds, u_int flags)
+{
+ return (malloc_domainset(fpu_kern_alloc_sz(cpu_max_ext_state_size),
+ M_FPUKERN_CTX, ds, fpu_kern_malloc_flags(flags)));
+}
+
struct fpu_kern_ctx *
fpu_kern_alloc_ctx(u_int flags)
{
- struct fpu_kern_ctx *res;
- size_t sz;
-
- sz = sizeof(struct fpu_kern_ctx) + XSAVE_AREA_ALIGN +
- cpu_max_ext_state_size;
- res = malloc(sz, M_FPUKERN_CTX, ((flags & FPU_KERN_NOWAIT) ?
- M_NOWAIT : M_WAITOK) | M_ZERO);
- return (res);
+ return (malloc(fpu_kern_alloc_sz(cpu_max_ext_state_size),
+ M_FPUKERN_CTX, fpu_kern_malloc_flags(flags)));
}
void
Index: sys/amd64/include/fpu.h
===================================================================
--- sys/amd64/include/fpu.h
+++ sys/amd64/include/fpu.h
@@ -47,6 +47,7 @@
#ifdef _KERNEL
+struct domainset;
struct fpu_kern_ctx;
#define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNFPU) == 0)
@@ -71,6 +72,8 @@
int fputrap_x87(void);
void fpuuserinited(struct thread *td);
struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags);
+struct fpu_kern_ctx *fpu_kern_alloc_ctx_domainset(struct domainset *,
+ u_int flags);
void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx);
void fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx,
u_int flags);
Index: sys/crypto/aesni/aesni.c
===================================================================
--- sys/crypto/aesni/aesni.c
+++ sys/crypto/aesni/aesni.c
@@ -36,6 +36,7 @@
#include <sys/param.h>
#include <sys/bus.h>
+#include <sys/domainset.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/libkern.h>
@@ -179,7 +180,8 @@
M_WAITOK|M_ZERO);
CPU_FOREACH(i) {
- ctx_fpu[i] = fpu_kern_alloc_ctx(0);
+ ctx_fpu[i] = fpu_kern_alloc_ctx_domainset(
+ DOMAINSET_PREF(pcpu_find(i)->pc_domain), FPU_KERN_NORMAL);
mtx_init(&ctx_mtx[i], "anifpumtx", NULL, MTX_DEF|MTX_NEW);
}
Index: sys/crypto/blake2/blake2_cryptodev.c
===================================================================
--- sys/crypto/blake2/blake2_cryptodev.c
+++ sys/crypto/blake2/blake2_cryptodev.c
@@ -29,6 +29,7 @@
#include <sys/param.h>
#include <sys/bus.h>
+#include <sys/domainset.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/lock.h>
@@ -141,7 +142,8 @@
M_WAITOK | M_ZERO);
CPU_FOREACH(i) {
- ctx_fpu[i] = fpu_kern_alloc_ctx(0);
+ ctx_fpu[i] = fpu_kern_alloc_ctx_domainset(
+ DOMAINSET_PREF(pcpu_find(i)->pc_domain), FPU_KERN_NORMAL);
mtx_init(&ctx_mtx[i], "bl2fpumtx", NULL, MTX_DEF | MTX_NEW);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 11:41 AM (12 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31975859
Default Alt Text
D22053.id71750.diff (3 KB)
Attached To
Mode
D22053: Add domainset policy allocation for fpu_kern_ctx
Attached
Detach File
Event Timeline
Log In to Comment