From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 243123857BBB; Wed, 25 May 2022 17:30:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 243123857BBB Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] fhandler_proc.cc(format_proc_cpuinfo): add Linux 5.18 cpuinfo flags X-Act-Checkin: newlib-cygwin X-Git-Author: Brian Inglis X-Git-Refname: refs/heads/master X-Git-Oldrev: 2f8ba4004675ff13741dcfd7de2014bec6834ca3 X-Git-Newrev: 9af21ada23389d9e6bcc0082fcc0e01545d8fd15 Message-Id: <20220525173001.243123857BBB@sourceware.org> Date: Wed, 25 May 2022 17:30:01 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 17:30:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D9af21ada233= 89d9e6bcc0082fcc0e01545d8fd15 commit 9af21ada23389d9e6bcc0082fcc0e01545d8fd15 Author: Brian Inglis Date: Wed May 25 06:30:45 2022 -0600 fhandler_proc.cc(format_proc_cpuinfo): add Linux 5.18 cpuinfo flags =20 0x80000008:0 EBX:31 brs AMD Branch Sampling available 0x80000022:0 EAX:0 perfmon_v2 AMD ExtPerfMonAndDbg Performance Monito= ring Version 2 0x00000021:0 EBX|EDX|ECX=3D=3D"IntelTDX " tdx_guest Intel Trust Doma= in Extensions- Guest Support Diff: --- winsup/cygwin/fhandler_proc.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc index 9ba241981..af553644e 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 >=3D 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 >=3D 0x80000022) + { + cpuid (&features2, &unused, &unused, &unused, 0x80000022); + + ftcprint (features2, 0, "perfmon_v2"); /* Performance Monitoring Versi= on 2 */ + } /* cpuid 0x80000008 ebx */ if (maxe >=3D 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 */ } =20 + /* cpuid 0x00000021 ebx|edx|ecx =3D=3D "IntelTDX " */ + if (is_intel && maxf >=3D 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 Suppor= t */ + } + /* cpuid 0x00000007 ebx */ if (maxf >=3D 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 */ } =20 /* thermal & power cpuid 0x00000006 eax */