diff options
author | John Baldwin <jhb@FreeBSD.org> | 2018-11-05 22:54:03 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2018-11-05 22:54:03 +0000 |
commit | 7f7f6f85a1314f9fe9ad238863dbf1e77d3ecf06 (patch) | |
tree | 1ed7e7db92b7abca4a27eb55d5ad1766f8de7f51 /sys/amd64/include/cpu.h | |
parent | c35530f46401198a25e194a3d618752b098cc866 (diff) | |
download | src-7f7f6f85a1314f9fe9ad238863dbf1e77d3ecf06.tar.gz src-7f7f6f85a1314f9fe9ad238863dbf1e77d3ecf06.zip |
Add a custom implementation of cpu_lock_delay() for x86.
Avoid using DELAY() since it can try to use spin locks on CPUs without
a P-state invariant TSC. For cpu_lock_delay(), always use the TSC if
it exists (even if it is not P-state invariant) to delay for a
microsecond. If the TSC does not exist, read from I/O port 0x84 to
delay instead.
PR: 228768
Reported by: Roger Hammerstein <cheeky.m@live.com>
Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17851
Notes
Notes:
svn path=/head/; revision=340170
Diffstat (limited to 'sys/amd64/include/cpu.h')
-rw-r--r-- | sys/amd64/include/cpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index fa5c1c9002d0..1b8a552d3e7c 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -50,7 +50,6 @@ #define cpu_getstack(td) ((td)->td_frame->tf_rsp) #define cpu_setstack(td, ap) ((td)->td_frame->tf_rsp = (ap)) #define cpu_spinwait() ia32_pause() -#define cpu_lock_delay() DELAY(1) #define TRAPF_USERMODE(framep) \ (ISPL((framep)->tf_cs) == SEL_UPL) @@ -78,6 +77,7 @@ extern char etext[]; extern void (*vmm_resume_p)(void); void cpu_halt(void); +void cpu_lock_delay(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); |