diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -104,8 +104,8 @@ #if defined(__i386__) || defined(__amd64__) #include -#include #endif /* __i386__ || __amd64__ */ +#include #include #include @@ -434,14 +434,79 @@ static int linprocfs_docpuinfo(PFS_FILL_ARGS) { - int i; + int i, j; + + static char *hwcap_features[] = { + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "jscvt", + "fcma", + "lrcpc", + "dcpop", + "sha3", + "sm3", + "sm4", + "asimddp", + "sha512", + "sve", + "asimdfhm", + "dit", + "uscat", + "ilrcpc", + "flagm", + "ssbs", + "sb", + "paca", + "pacg", + }; + static char *hwcap2_features[] = { + "dcpodp", + "sve2", + "sveaes", + "svepmull", + "svebitperm", + "svesha3", + "svesm4", + "flagm2", + "fpint", + "svei8mm", + "svef32mm", + "svef64mm", + "svebf16", + "i8mm", + "bf16", + "dgh", + "rng", + "bti", + }; for (i = 0; i < mp_ncpus; ++i) { sbuf_printf(sb, "processor\t: %d\n" "BogoMIPS\t: %d.%02d\n", i, 0, 0); - sbuf_cat(sb, "Features\t: "); + sbuf_cat(sb, "Features\t:"); + for (j = 0; j < nitems(hwcap_features); j++) { + if ((linux_elf_hwcap & (1ul << j)) != 0) { + sbuf_printf(sb, " %s", hwcap_features[j]); + } + } + for (j = 0; j < nitems(hwcap2_features); j++) { + if ((linux_elf_hwcap2 & (1ul << j)) != 0) { + sbuf_printf(sb, " %s", hwcap2_features[j]); + } + } sbuf_cat(sb, "\n"); sbuf_printf(sb, "CPU implementer\t: \n"