Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153368372
D56507.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
D56507.diff
View Options
diff --git a/sys/kern/kern_membarrier.c b/sys/kern/kern_membarrier.c
--- a/sys/kern/kern_membarrier.c
+++ b/sys/kern/kern_membarrier.c
@@ -120,7 +120,7 @@
struct thread *td1;
cpuset_t cs;
uint64_t *swt;
- int c, error;
+ int c, error, f;
bool first;
if (flags != 0 || (cmd & ~MEMBARRIER_SUPPORTED_CMDS) != 0)
@@ -133,6 +133,7 @@
p = td->td_proc;
error = 0;
+ f = atomic_load_int(&td->td_proc->p_flag2);
switch (cmd) {
case MEMBARRIER_CMD_GLOBAL:
@@ -155,7 +156,7 @@
break;
case MEMBARRIER_CMD_GLOBAL_EXPEDITED:
- if ((td->td_proc->p_flag2 & P2_MEMBAR_GLOBE) == 0) {
+ if ((f & P2_MEMBAR_GLOBE) == 0) {
error = EPERM;
} else {
CPU_ZERO(&cs);
@@ -171,7 +172,7 @@
break;
case MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED:
- if ((p->p_flag2 & P2_MEMBAR_GLOBE) == 0) {
+ if ((f & P2_MEMBAR_GLOBE) == 0) {
PROC_LOCK(p);
p->p_flag2 |= P2_MEMBAR_GLOBE;
PROC_UNLOCK(p);
@@ -179,7 +180,7 @@
break;
case MEMBARRIER_CMD_PRIVATE_EXPEDITED:
- if ((td->td_proc->p_flag2 & P2_MEMBAR_PRIVE) == 0) {
+ if ((f & P2_MEMBAR_PRIVE) == 0) {
error = EPERM;
} else {
pmap_active_cpus(vmspace_pmap(p->p_vmspace), &cs);
@@ -188,7 +189,7 @@
break;
case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED:
- if ((p->p_flag2 & P2_MEMBAR_PRIVE) == 0) {
+ if ((f & P2_MEMBAR_PRIVE) == 0) {
PROC_LOCK(p);
p->p_flag2 |= P2_MEMBAR_PRIVE;
PROC_UNLOCK(p);
@@ -196,7 +197,7 @@
break;
case MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE:
- if ((td->td_proc->p_flag2 & P2_MEMBAR_PRIVE_SYNCORE) == 0) {
+ if ((f & P2_MEMBAR_PRIVE_SYNCORE) == 0) {
error = EPERM;
} else {
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 6:24 PM (4 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31923768
Default Alt Text
D56507.diff (1 KB)
Attached To
Mode
D56507: membarrier(2): implement the MEMBARRIER_CMD_GET_REGISTRATIONS command
Attached
Detach File
Event Timeline
Log In to Comment