-/* $OpenBSD: identcpu.c,v 1.134 2023/07/21 04:04:51 guenther Exp $ */
+/* $OpenBSD: identcpu.c,v 1.135 2023/07/27 01:51:35 guenther Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
}, cpu_cpuid_apmi_edx[] = {
{ CPUIDEDX_ITSC, "ITSC" },
}, cpu_amdspec_ebxfeatures[] = {
- { CPUIDEBX_IBPB, "IBPB" },
- { CPUIDEBX_IBRS, "IBRS" },
- { CPUIDEBX_STIBP, "STIBP" },
- { CPUIDEBX_SSBD, "SSBD" },
- { CPUIDEBX_VIRT_SSBD, "VIRTSSBD" },
- { CPUIDEBX_SSBD_NOTREQ, "SSBDNR" },
+ { CPUIDEBX_INVLPGB, "INVLPGB" },
+ { CPUIDEBX_IBPB, "IBPB" },
+ { CPUIDEBX_IBRS, "IBRS" },
+ { CPUIDEBX_STIBP, "STIBP" },
+ { CPUIDEBX_IBRS_ALWAYSON, "IBRS_ALL" },
+ { CPUIDEBX_STIBP_ALWAYSON, "STIBP_ALL" },
+ { CPUIDEBX_IBRS_PREF, "IBRS_PREF" },
+ { CPUIDEBX_IBRS_SAME_MODE, "IBRS_SM" },
+ { CPUIDEBX_SSBD, "SSBD" },
+ { CPUIDEBX_VIRT_SSBD, "VIRTSSBD" },
+ { CPUIDEBX_SSBD_NOTREQ, "SSBDNR" },
}, cpu_xsave_extfeatures[] = {
{ XSAVE_XSAVEOPT, "XSAVEOPT" },
{ XSAVE_XSAVEC, "XSAVEC" },
{ XSAVE_XGETBV1, "XGETBV1" },
{ XSAVE_XSAVES, "XSAVES" },
{ XSAVE_XFD, "XFD" },
+}, cpu_arch_cap_features[] = {
+ /* ARCH_CAP_RDCL_NO (not printed) == !MELTDOWN */
+ { ARCH_CAP_IBRS_ALL, "IBRS_ALL" },
+ { ARCH_CAP_RSBA, "RSBA" },
+ { ARCH_CAP_SKIP_L1DFL_VMENTRY, "SKIP_L1DFL" },
+ { ARCH_CAP_SSB_NO, "SSB_NO" },
+ { ARCH_CAP_MDS_NO, "MDS_NO" },
+ { ARCH_CAP_IF_PSCHANGE_MC_NO, "IF_PSCHANGE" },
+ { ARCH_CAP_TSX_CTRL, "TSX_CTRL" },
+ { ARCH_CAP_TAA_NO, "TAA_NO" },
+ { ARCH_CAP_MCU_CONTROL, "MCU_CONTROL" },
+ { ARCH_CAP_MISC_PACKAGE_CTLS, "MISC_PKG_CT" },
+ { ARCH_CAP_ENERGY_FILTERING_CTL, "ENERGY_FILT" },
+ { ARCH_CAP_DOITM, "DOITM" },
+ { ARCH_CAP_SBDR_SSDP_NO, "SBDR_SSDP_N" },
+ { ARCH_CAP_FBSDP_NO, "FBSDP_NO" },
+ { ARCH_CAP_PSDP_NO, "PSDP_NO" },
+ { ARCH_CAP_FB_CLEAR, "FB_CLEAR" },
+ { ARCH_CAP_FB_CLEAR_CTRL, "FB_CLEAR_CT" },
+ { ARCH_CAP_RRSBA, "RRSBA" },
+ { ARCH_CAP_BHI_NO, "BHI_NO" },
+ { ARCH_CAP_XAPIC_DISABLE_STATUS, "XAPIC_DIS" },
+ { ARCH_CAP_OVERCLOCKING_STATUS, "OVERCLOCK" },
+ { ARCH_CAP_PBRSB_NO, "PBRSB_NO" },
};
int
ci->ci_feature_tpmflags |= TPM_ARAT;
}
- /* AMD speculation control features */
+ /* speculation control features */
if (!strcmp(cpu_vendor, "AuthenticAMD")) {
if (ci->ci_pnfeatset >= 0x80000008) {
CPUID(0x80000008, dummy, ci->ci_feature_amdspec_ebx,
printf(",%s",
cpu_amdspec_ebxfeatures[i].str);
}
+ } else if (!strcmp(cpu_vendor, "GenuineIntel") &&
+ (ci->ci_feature_sefflags_edx & SEFF0EDX_ARCH_CAP)) {
+ uint64_t msr = rdmsr(MSR_ARCH_CAPABILITIES);
+
+ for (i = 0; i < nitems(cpu_arch_cap_features); i++)
+ if (msr & cpu_arch_cap_features[i].bit)
+ printf(",%s", cpu_arch_cap_features[i].str);
}
/* xsave subfeatures */