Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150104024
D26166.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
D26166.diff
View Options
Index: head/sys/amd64/amd64/initcpu.c
===================================================================
--- head/sys/amd64/amd64/initcpu.c
+++ head/sys/amd64/amd64/initcpu.c
@@ -42,6 +42,7 @@
#include <machine/cputypes.h>
#include <machine/md_var.h>
+#include <machine/psl.h>
#include <machine/specialreg.h>
#include <vm/vm.h>
@@ -218,11 +219,14 @@
}
/*
- * The value for the TSC_AUX MSR and rdtscp/rdpid.
+ * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU.
+ *
+ * Caller should prevent CPU migration.
*/
u_int
cpu_auxmsr(void)
{
+ KASSERT((read_rflags() & PSL_I) == 0, ("context switch possible"));
return (PCPU_GET(cpuid));
}
Index: head/sys/i386/i386/initcpu.c
===================================================================
--- head/sys/i386/i386/initcpu.c
+++ head/sys/i386/i386/initcpu.c
@@ -41,6 +41,7 @@
#include <machine/cputypes.h>
#include <machine/md_var.h>
+#include <machine/psl.h>
#include <machine/specialreg.h>
#include <vm/vm.h>
@@ -628,11 +629,14 @@
#endif
/*
- * The value for the TSC_AUX MSR and rdtscp/rdpid.
+ * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU.
+ *
+ * Caller should prevent CPU migration.
*/
u_int
cpu_auxmsr(void)
{
+ KASSERT((read_eflags() & PSL_I) == 0, ("context switch possible"));
return (PCPU_GET(cpuid));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 9:51 AM (4 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30583482
Default Alt Text
D26166.diff (1 KB)
Attached To
Mode
D26166: cpu_auxmsr: assert caller is preventing CPU migration
Attached
Detach File
Event Timeline
Log In to Comment