Page MenuHomeFreeBSD

D26166.id76129.diff
No OneTemporary

D26166.id76129.diff

Index: sys/amd64/amd64/initcpu.c
===================================================================
--- sys/amd64/amd64/initcpu.c
+++ 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: sys/i386/i386/initcpu.c
===================================================================
--- sys/i386/i386/initcpu.c
+++ 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

Mime Type
text/plain
Expires
Wed, Jan 15, 3:26 PM (11 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15812195
Default Alt Text
D26166.id76129.diff (1 KB)

Event Timeline