MCPcopy Create free account
hub / github.com/F-Stack/f-stack / identify_cpu2

Function identify_cpu2

freebsd/x86/x86/identcpu.c:1580–1613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1578}
1579
1580void
1581identify_cpu2(void)
1582{
1583 u_int regs[4], cpu_stdext_disable;
1584
1585 if (cpu_high >= 6) {
1586 cpuid_count(6, 0, regs);
1587 cpu_power_eax = regs[0];
1588 cpu_power_ebx = regs[1];
1589 cpu_power_ecx = regs[2];
1590 cpu_power_edx = regs[3];
1591 }
1592
1593 if (cpu_high >= 7) {
1594 cpuid_count(7, 0, regs);
1595 cpu_stdext_feature = regs[1];
1596
1597 /*
1598 * Some hypervisors failed to filter out unsupported
1599 * extended features. Allow to disable the
1600 * extensions, activation of which requires setting a
1601 * bit in CR4, and which VM monitors do not support.
1602 */
1603 cpu_stdext_disable = 0;
1604 TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable);
1605 cpu_stdext_feature &= ~cpu_stdext_disable;
1606
1607 cpu_stdext_feature2 = regs[2];
1608 cpu_stdext_feature3 = regs[3];
1609
1610 if ((cpu_stdext_feature3 & CPUID_STDEXT3_ARCH_CAP) != 0)
1611 cpu_ia32_arch_caps = rdmsr(MSR_IA32_ARCH_CAP);
1612 }
1613}
1614
1615void
1616identify_cpu_fixup_bsp(void)

Callers 2

hammer_timeFunction · 0.85
finishidentcpuFunction · 0.85

Calls 2

cpuid_countFunction · 0.50
rdmsrFunction · 0.50

Tested by

no test coverage detected