From nobody Wed Jun 29 07:39:06 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A9AEE87D332; Wed, 29 Jun 2022 07:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LXtd71BtMz4WqV; Wed, 29 Jun 2022 07:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656488347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0aVcJ/nWG6zgpSyjWF1vABhkjCJ9LJhqc+jxiKFK8Bk=; b=YmumF271BzBUCgPuntsLIxEqUD2dPR11RMC5olTPWMZKUpFQ5joeuQgrCeJ6O0/vue0dE8 Nprz17jH+yl0MBCCnLBvGMoFdiQVMaoFdyThIRv6ApHTfYv6OlIqOvGox+0JSVWSumUNg0 iLZjX6F9L/qqPs1Nxip0899zUAn4dyRx64H6NihWp4qNY476m2j1ZbctlMSSbVtWPkzZF2 zDXgtJAp4c76wIfpY8neDYtO1Awu3jutmFEz4nGgcFrFM/1fybFPLSb7TtPZ5lcKDy2iUT m6LUzcEVa8pehmnaZ4O8exFfGfEOsCcEJfGDWQaNqO/tiGySB/WZOjg21fvFSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3E635810; Wed, 29 Jun 2022 07:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25T7d6Ru049810; Wed, 29 Jun 2022 07:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25T7d6vX049809; Wed, 29 Jun 2022 07:39:06 GMT (envelope-from git) Date: Wed, 29 Jun 2022 07:39:06 GMT Message-Id: <202206290739.25T7d6vX049809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 7ab03740ae87 - main - linprocfs: Decode more CPU flags in cpuinfo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ab03740ae87f23250f2a0f0d5991e9989ddddfe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656488347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0aVcJ/nWG6zgpSyjWF1vABhkjCJ9LJhqc+jxiKFK8Bk=; b=bah6HeYhbek7LE9g55+xQ21nHjhAysmg8m+YExat3+URa1IL31Th3L60NykHm1q7tXvlGD VTc3QJtpweZvld6D0KmHXfTli+8FLDzo7lGkgBslHGmS82MtrC13a65d92YpNxcw8XYdMJ ww1SafsxGPVSQKCHIfGp9idz+a3iuCXUAWnWuRTJsweM4lrAs2KEIdm3ncbAVxwVM/wqP4 8WISHMixeXZtpkffB+KGVYU/O3cwrDr8rMNju1ceQLTsTs8lKynKrsuXoPc1RR9TKb4eaw wsQtYKJXBn0ntur4gQ7/KF0fUYoLNWRI1cFNQ8T6mblAMDMMtqkURSuuY3yHyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656488347; a=rsa-sha256; cv=none; b=pdpeoJuMqXsoZcKILG9+d9Ni64E7ZwtBceWCUueJTdTgEy06eSRmjccvt/jfmufLpI0n4d gt8T8Jzlb3iMdAm9Xh0SsUmna+NxuxdY/cAJepKT7nxA31MdPbV1YJWPdSfYi/v3A4Re2D P6OBvViyuvUADqOJhWo0++IgIPG+tmCmo3kQf6c4UlbMIKFAJCWwlx5o3r/4UkGCTs6ZaJ zRy1hRoRFUA+8Qt1OhmRmp9abj6HVd2+8gKMe2EyX4pqKAkHrmtU7ByWin9lqAfiaNUEXV XuETv0QcaEtzSiSj0jpKnoPKFJ4tYohRhneRb5peZZWZdWK+51XxvmgwWqDYEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7ab03740ae87f23250f2a0f0d5991e9989ddddfe commit 7ab03740ae87f23250f2a0f0d5991e9989ddddfe Author: Dmitry Chagin AuthorDate: 2022-06-29 07:37:30 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-29 07:37:30 +0000 linprocfs: Decode more CPU flags in cpuinfo Differential revision: https://reviews.freebsd.org/D35556 MFC after: 2 weeks --- sys/compat/linprocfs/linprocfs.c | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index e1796a359ce0..c0c987696c8f 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -202,6 +202,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) uint64_t freq; size_t size; u_int cache_size[4]; + u_int regs[4] = { 0 }; int fqmhz, fqkhz; int i, j; @@ -264,6 +265,33 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) /* 28 */ "avx512cd", "sha_ni", "avx512bw", "avx512vl" }; + static char *cpu_stdext_feature2_names[] = { + /* 0 */ "prefetchwt1", "avx512vbmi", "umip", "pku", + /* 4 */ "ospke", "waitpkg", "avx512_vbmi2", "", + /* 8 */ "gfni", "vaes", "vpclmulqdq", "avx512_vnni", + /* 12 */ "avx512_bitalg", "", "avx512_vpopcntdq", "", + /* 16 */ "", "", "", "", + /* 20 */ "", "", "rdpid", "", + /* 24 */ "", "cldemote", "", "movdiri", + /* 28 */ "movdir64b", "enqcmd", "sgx_lc", "" + }; + + static char *cpu_stdext_feature3_names[] = { + /* 0 */ "", "", "avx512_4vnniw", "avx512_4fmaps", + /* 4 */ "fsrm", "", "", "", + /* 8 */ "avx512_vp2intersect", "", "md_clear", "", + /* 12 */ "", "", "", "", + /* 16 */ "", "", "pconfig", "", + /* 20 */ "", "", "", "", + /* 24 */ "", "", "ibrs", "stibp", + /* 28 */ "flush_l1d", "arch_capabilities", "core_capabilities", "ssbd" + }; + + static char *cpu_stdext_feature_l1_names[] = { + /* 0 */ "xsaveopt", "xsavec", "xgetbv1", "xsaves", + /* 4 */ "xfd" + }; + static char *power_flags[] = { "ts", "fid", "vid", "ttp", "tm", "stc", @@ -351,6 +379,24 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) cpu_stdext_feature_names[j]); if (tsc_is_invariant) sbuf_cat(sb, " constant_tsc"); + for (j = 0; j < nitems(cpu_stdext_feature2_names); j++) + if (cpu_stdext_feature2 & (1 << j) && + cpu_stdext_feature2_names[j][0] != '\0') + sbuf_printf(sb, " %s", + cpu_stdext_feature2_names[j]); + for (j = 0; j < nitems(cpu_stdext_feature3_names); j++) + if (cpu_stdext_feature3 & (1 << j) && + cpu_stdext_feature3_names[j][0] != '\0') + sbuf_printf(sb, " %s", + cpu_stdext_feature3_names[j]); + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { + cpuid_count(0xd, 0x1, regs); + for (j = 0; j < nitems(cpu_stdext_feature_l1_names); j++) + if (regs[0] & (1 << j) && + cpu_stdext_feature_l1_names[j][0] != '\0') + sbuf_printf(sb, " %s", + cpu_stdext_feature_l1_names[j]); + } sbuf_cat(sb, "\n"); sbuf_printf(sb, "bugs\t\t: %s\n"