Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F172103752
D54996.id170939.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
D54996.id170939.diff
View Options
diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h
--- a/sys/x86/include/x86_var.h
+++ b/sys/x86/include/x86_var.h
@@ -171,6 +171,10 @@
/*
* Where and which execution mode
+ *
+ * All modes cause execution on the target CPU(s) with interrupts disabled,
+ * except MSR_OP_LOCAL if the operation is naturally atomic (i.e., not
+ * MSR_OP_ANDNOT nor MSR_OP_OR).
*/
#define MSR_OP_LOCAL 0x10000000
#define MSR_OP_SCHED_ALL 0x20000000
diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c
--- a/sys/x86/x86/cpu_machdep.c
+++ b/sys/x86/x86/cpu_machdep.c
@@ -160,6 +160,7 @@
struct thread *td;
struct msr_op_arg a;
cpuset_t set;
+ register_t flags;
u_int exmode;
int bound_cpu, cpu, i, is_bound;
@@ -171,7 +172,11 @@
switch (exmode) {
case MSR_OP_LOCAL:
+ if (a.op == MSR_OP_ANDNOT || a.op == MSR_OP_OR)
+ flags = intr_disable();
x86_msr_op_one(&a);
+ if (a.op == MSR_OP_ANDNOT || a.op == MSR_OP_OR)
+ intr_restore(flags);
break;
case MSR_OP_SCHED_ALL:
td = curthread;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 17, 4:27 AM (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39049910
Default Alt Text
D54996.id170939.diff (1 KB)
Attached To
Mode
D54996: x86: x86_msr_op(): Add comments, guarantee atomicity
Attached
Detach File
Event Timeline
Log In to Comment