Index: sys/compat/linprocfs/linprocfs.c =================================================================== --- sys/compat/linprocfs/linprocfs.c +++ sys/compat/linprocfs/linprocfs.c @@ -140,6 +140,15 @@ */ static char linux_state[] = "RRSTZDD"; +/* + * Save a local copy of the ext cpu feature3 as it is zeroed by the kernel + * in the acpi code. + */ +#if defined(__i386__) || defined(__amd64__) +static u_int lin_cpu_stdext_feature3 = 0; +static u_int lin_cpu_stdext_l1_feature = 0; +#endif + /* * Filler function for proc/meminfo */ @@ -2001,6 +2010,23 @@ return (0); } +static void +linprocfs_cache_cpuid() +{ +#if defined(__i386__) || defined(__amd64__) + u_int regs[4]; + + if (cpu_high >= 7) { + cpuid_count(7, 0, regs); + lin_cpu_stdext_feature3 = regs[3]; + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { + cpuid_count(0xd, 0x1, regs); + lin_cpu_stdext_l1_feature = regs[0]; + } + } +#endif +} + /* * Constructor */ @@ -2011,6 +2037,8 @@ struct pfs_node *dir; struct pfs_node *sys; + linprocfs_cache_cpuid(); + root = pi->pi_root; /* /proc/... */