提交 61677965 编写于 作者: A Andi Kleen 提交者: Andi Kleen

[PATCH] x86-64: Synchronize RDTSC on single core AMD

There is no guarantee that two RDTSCs in a row are monotonic,
so don't assume it on single core AMD systems.
This will make gettimeofday slower again
Signed-off-by: NAndi Kleen <ak@suse.de>
上级 a1a70c25
...@@ -732,11 +732,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) ...@@ -732,11 +732,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
/* Fix cpuid4 emulation for more */ /* Fix cpuid4 emulation for more */
num_cache_leaves = 3; num_cache_leaves = 3;
/* When there is only one core no need to synchronize RDTSC */ /* RDTSC can be speculated around */
if (num_possible_cpus() == 1) clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
set_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
else
clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
} }
static void __cpuinit detect_ht(struct cpuinfo_x86 *c) static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册