Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/power turbostat: Dump CPUID.1.ECX[31] (Hypervisor)

Both Intel and AMD use CPUID.1.ECX[31] to distinguish
between hypervisor and real hardware.
Indicate "HV" or "No-HV" accordingly.

Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown 00b9e2a7 bd1b6608

+5 -2
+5 -2
tools/power/x86/turbostat/turbostat.c
··· 498 498 unsigned int dump_only; 499 499 unsigned int force_load; 500 500 unsigned int cpuid_has_aperf_mperf; 501 + unsigned int cpuid_has_hv; 501 502 unsigned int has_aperf_access; 502 503 unsigned int has_epb; 503 504 unsigned int has_turbo; ··· 8804 8803 model += ((fms >> 16) & 0xf) << 4; 8805 8804 ecx_flags = ecx; 8806 8805 edx_flags = edx; 8806 + cpuid_has_hv = ecx_flags & (1 << 31); 8807 8807 8808 8808 if (!no_msr) { 8809 8809 if (get_msr(sched_getcpu(), MSR_IA32_UCODE_REV, &ucode_patch)) ··· 8828 8826 fputc('\n', outf); 8829 8827 8830 8828 fprintf(outf, "CPUID(0x80000000): max_extended_levels: 0x%x\n", max_extended_level); 8831 - fprintf(outf, "CPUID(1): %sSSE3 %sMONITOR %sSMX %sEIST %sTM2 %sTSC %sMSR %sACPI-TM %sHT %sTM\n", 8829 + fprintf(outf, "CPUID(1): %sSSE3 %sMONITOR %sSMX %sEIST %sTM2 %sHV %sTSC %sMSR %sACPI-TM %sHT %sTM\n", 8832 8830 ecx_flags & (1 << 0) ? "" : "No-", 8833 8831 ecx_flags & (1 << 3) ? "" : "No-", 8834 8832 ecx_flags & (1 << 6) ? "" : "No-", 8835 8833 ecx_flags & (1 << 7) ? "" : "No-", 8836 8834 ecx_flags & (1 << 8) ? "" : "No-", 8835 + cpuid_has_hv ? "" : "No-", 8837 8836 edx_flags & (1 << 4) ? "" : "No-", 8838 8837 edx_flags & (1 << 5) ? "" : "No-", 8839 8838 edx_flags & (1 << 22) ? "" : "No-", edx_flags & (1 << 28) ? "" : "No-", edx_flags & (1 << 29) ? "" : "No-"); ··· 10148 10145 10149 10146 void print_version() 10150 10147 { 10151 - fprintf(outf, "turbostat version 2025.12.02 - Len Brown <lenb@kernel.org>\n"); 10148 + fprintf(outf, "turbostat version 2025.12.05 - Len Brown <lenb@kernel.org>\n"); 10152 10149 } 10153 10150 10154 10151 #define COMMAND_LINE_SIZE 2048