From: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
To: cygwin-patches@cygwin.com (Cygwin Patches)
Subject: [PATCH] fhandler_proc.cc(format_proc_cpuinfo): add Linux 5.18 cpuinfo flags
Date: Wed, 25 May 2022 06:30:45 -0600 [thread overview]
Message-ID: <20220525123045.8880-1-Brian.Inglis@SystematicSW.ab.ca> (raw)
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
0x80000008:0 EBX:31 brs AMD Branch Sampling available
0x80000022:0 EAX:0 perfmon_v2 AMD ExtPerfMonAndDbg Performance Monitoring Version 2
0x00000021:0 EBX|EDX|ECX=="IntelTDX " tdx_guest Intel Trust Domain Extensions- Guest Support
---
winsup/cygwin/fhandler_proc.cc | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-fhandler_proc.cc-format_proc_cpuinfo-add-Linux-5.18-cpuinfo-flags.patch --]
[-- Type: text/x-patch; name="0001-fhandler_proc.cc-format_proc_cpuinfo-add-Linux-5.18-cpuinfo-flags.patch", Size: 2093 bytes --]
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 9ba241981a5e..af553644e231 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -1362,14 +1362,21 @@ format_proc_cpuinfo (void *, char *&destbuf)
if (maxe >= 0x80000008)
{
/* cpuid (&unused, &features1, &unused, &unused, 0x80000008, 0); */
-/* from above */
+/* from above ^ */
ftcprint (features1, 6, "mba"); /* memory bandwidth alloc */
}
+ /* cpuid 0x80000022 ebx AMD ExtPerfMonAndDbg */
+ if (maxe >= 0x80000022)
+ {
+ cpuid (&features2, &unused, &unused, &unused, 0x80000022);
+
+ ftcprint (features2, 0, "perfmon_v2"); /* Performance Monitoring Version 2 */
+ }
/* cpuid 0x80000008 ebx */
if (maxe >= 0x80000008)
{
/* cpuid (&unused, &features1, &unused, &unused, 0x80000008, 0); */
-/* from above */
+/* from above ^ */
/* ftcprint (features1, 0, "clzero"); *//* clzero instruction */
/* ftcprint (features1, 1, "irperf"); *//* instr retired count */
/* ftcprint (features1, 2, "xsaveerptr");*//* save/rest FP err ptrs */
@@ -1388,6 +1395,16 @@ format_proc_cpuinfo (void *, char *&destbuf)
/* ftcprint (features1, 26, "ssb_no"); *//* ssb fixed in hardware */
}
+ /* cpuid 0x00000021 ebx|edx|ecx == "IntelTDX " */
+ if (is_intel && maxf >= 0x00000021)
+ {
+ uint32_t tdx[3];
+
+ cpuid (&unused, &tdx[0], &tdx[2], &tdx[1], 0x00000021, 0);
+ if (!memcmp ("IntelTDX ", tdx, sizeof (tdx)))
+ ftuprint ("tdx_guest"); /* Intel Trust Domain Extensions Guest Support */
+ }
+
/* cpuid 0x00000007 ebx */
if (maxf >= 0x00000007)
{
@@ -1485,6 +1502,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
ftcprint (features1, 25, "virt_ssbd"); /* vir spec store byp dis */
/* ftcprint (features1, 26, "ssb_no"); */ /* ssb fixed in hardware */
ftcprint (features1, 27, "cppc"); /* collab proc perf ctl */
+ ftcprint (features1, 31, "brs"); /* branch sampling */
}
/* thermal & power cpuid 0x00000006 eax */
next reply other threads:[~2022-05-25 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 12:30 Brian Inglis [this message]
2022-05-25 17:32 ` Ken Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220525123045.8880-1-Brian.Inglis@SystematicSW.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).