Commit 00c933e9 authored by Dmitry Chagin's avatar Dmitry Chagin
Browse files

linux(4): Use saved cpu feature bits

MFC after:		3 days

(cherry picked from commit 03473e8e)
parent 625bc476
......@@ -61,21 +61,10 @@ linux_vdso_tsc_selector_idx()
int
linux_vdso_cpu_selector_idx()
{
u_int amd_feature, cpu_exthigh, p[4];
if ((cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0)
return (LINUX_VDSO_CPU_RDPID);
amd_feature = 0;
if (cpu_feature != 0) {
do_cpuid(0x80000000, p);
cpu_exthigh = p[0];
if (cpu_exthigh >= 0x80000001) {
do_cpuid(0x80000001, p);
amd_feature = p[3];
}
}
return ((amd_feature & AMDID_RDTSCP) == 0 ?
LINUX_VDSO_CPU_DEFAULT : LINUX_VDSO_CPU_RDTSCP);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment