public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features
@ 2021-02-17 16:28 Brian Inglis
  2021-02-17 16:28 ` [PATCH v2 1/2] cpuinfo: fix check for cpuid 0x80000007 support Brian Inglis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Brian Inglis @ 2021-02-17 16:28 UTC (permalink / raw)
  To: cygwin-patches

Brian Inglis (2):
  fix check for cpuid 0x80000007 support
  add AVX features; move SME, SEV/_ES features

 winsup/cygwin/fhandler_proc.cc | 46 ++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 22 deletions(-)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] cpuinfo: fix check for cpuid 0x80000007 support
  2021-02-17 16:28 [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features Brian Inglis
@ 2021-02-17 16:28 ` Brian Inglis
  2021-02-17 16:28 ` [PATCH v2 2/2] cpuinfo: add AVX features; move SME, SEV/_ES features Brian Inglis
  2021-02-18  8:40 ` [PATCH v2 0/2] cpuinfo: fix check; " Corinna Vinschen
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2021-02-17 16:28 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

---
 winsup/cygwin/fhandler_proc.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-cpuinfo-fix-check-for-cpuid-0x80000007-support.patch --]
[-- Type: text/x-patch; name="0001-cpuinfo-fix-check-for-cpuid-0x80000007-support.patch", Size: 476 bytes --]

diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 8e23c0609485..d4c8613eb392 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -1293,7 +1293,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
 
 /* features scattered in various CPUID levels. */
       /* cpuid 0x80000007 edx */
-      if (maxf >= 0x00000007)
+      if (maxe >= 0x80000007)
 	{
 	  cpuid (&unused, &unused, &unused, &features1, 0x80000007);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] cpuinfo: add AVX features; move SME, SEV/_ES features
  2021-02-17 16:28 [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features Brian Inglis
  2021-02-17 16:28 ` [PATCH v2 1/2] cpuinfo: fix check for cpuid 0x80000007 support Brian Inglis
@ 2021-02-17 16:28 ` Brian Inglis
  2021-02-18  8:40 ` [PATCH v2 0/2] cpuinfo: fix check; " Corinna Vinschen
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2021-02-17 16:28 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]


Linux 5.11 💕 Valentine's Day Edition 💕 added features and changes:
add Intel 0x00000007 EDX:23 avx512_fp16 and 0x00000007:1 EAX:4 avx_vnni;
group scattered AMD 0x8000001f EAX Secure Mem/Encrypted Virt features at end:
0 sme, 1 sev, 3 sev_es (more to come not yet displayed)
---
 winsup/cygwin/fhandler_proc.cc | 44 ++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 21 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-cpuinfo-add-AVX-features-move-SME-SEV-_ES-features.patch --]
[-- Type: text/x-patch; name="0002-cpuinfo-add-AVX-features-move-SME-SEV-_ES-features.patch", Size: 4060 bytes --]

diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index d4c8613eb392..501c157daae5 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -1330,13 +1330,6 @@ format_proc_cpuinfo (void *, char *&destbuf)
 	  ftcprint (features1,  7, "hw_pstate");	/* hw P state */
 	  ftcprint (features1, 11, "proc_feedback"); /* proc feedback interf */
 	}
-      /* cpuid 0x8000001f eax */
-      if (maxe >= 0x8000001f)
-	{
-	  cpuid (&features1, &unused, &unused, &unused, 0x8000001f);
-
-	  ftcprint (features1,  0, "sme");	/* secure memory encryption */
-	}
 
 /*	  ftcprint (features1, 11, "pti");*//* Page Table Isolation reqd with Meltdown */
 
@@ -1370,14 +1363,6 @@ format_proc_cpuinfo (void *, char *&destbuf)
 /*	  from above */
 	  ftcprint (features1,  6, "mba");	/* memory bandwidth alloc */
 	}
-      /* cpuid 0x8000001f eax */
-      if (maxe >= 0x8000001f)
-	{
-	  cpuid (&features2, &unused, &unused, &unused, 0x8000001f);
-
-	  ftcprint (features2,  1, "sev");	/* secure encrypted virt */
-	/*ftcprint (features2,  3, "sev_es"); - print below */
-	}
       /* cpuid 0x80000008 ebx */
       if (maxe >= 0x80000008)
         {
@@ -1401,12 +1386,6 @@ format_proc_cpuinfo (void *, char *&destbuf)
 /*	  ftcprint (features1, 26, "ssb_no");	*//* ssb fixed in hardware */
         }
 
-      /* cpuid 0x8000001f eax - set above */
-      if (maxe >= 0x8000001f)
-	{
-	  ftcprint (features2,  3, "sev_es");	/* AMD SEV encrypted state */
-	}
-
       /* cpuid 0x00000007 ebx */
       if (maxf >= 0x00000007)
 	{
@@ -1478,6 +1457,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
 	{
 	  cpuid (&features1, &unused, &unused, &unused, 0x00000007, 1);
 
+	  ftcprint (features1,  4, "avx_vnni");	    /* vex enc NN vec */
 	  ftcprint (features1,  5, "avx512_bf16");  /* vec bfloat16 short */
 	}
 
@@ -1539,6 +1519,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
 	  ftcprint (features1, 13, "avic");             /* virt int control */
 	  ftcprint (features1, 15, "v_vmsave_vmload");  /* virt vmsave vmload */
 	  ftcprint (features1, 16, "vgif");             /* virt glb int flag */
+/*	  ftcprint (features1, 28, "svme_addr_chk");  *//* secure vmexit addr check */
         }
 
       /* Intel cpuid 0x00000007 ecx */
@@ -1592,10 +1573,31 @@ format_proc_cpuinfo (void *, char *&destbuf)
           ftcprint (features1, 16, "tsxldtrk");		   /* TSX Susp Ld Addr Track */
           ftcprint (features1, 18, "pconfig");		   /* platform config */
           ftcprint (features1, 19, "arch_lbr");		   /* last branch records */
+          ftcprint (features1, 23, "avx512_fp16");	   /* avx512 fp16 */
           ftcprint (features1, 28, "flush_l1d");	   /* flush l1d cache */
           ftcprint (features1, 29, "arch_capabilities");   /* arch cap MSR */
         }
 
+      /* cpuid x8000001f eax */
+      if (is_amd && maxe >= 0x8000001f)
+	{
+	  cpuid (&features2, &unused, &unused, &unused, 0x8000001f);
+
+	  ftcprint (features2,  0, "sme");	/* secure memory encryption */
+	  ftcprint (features2,  1, "sev");	/* AMD secure encrypted virt */
+/*	  ftcprint (features2,  2, "vm_page_flush");*/	/* VM page flush MSR */
+	  ftcprint (features2,  3, "sev_es");	/* AMD SEV encrypted state */
+/*	  ftcprint (features2,  4, "sev_snp");*//* AMD SEV secure nested paging */
+/*	  ftcprint (features2,  5, "vmpl");   *//* VM permission levels support */
+/*	  ftcprint (features2, 10, "sme_coherent");   *//* SME h/w cache coherent */
+/*	  ftcprint (features2, 11, "sev_64b");*//* SEV 64 bit host guest only */
+/*	  ftcprint (features2, 12, "sev_rest_inj");   *//* SEV restricted injection */
+/*	  ftcprint (features2, 13, "sev_alt_inj");    *//* SEV alternate injection */
+/*	  ftcprint (features2, 14, "sev_es_dbg_swap");*//* SEV-ES debug state swap */
+/*	  ftcprint (features2, 15, "no_host_ibs");    *//* host IBS unsupported */
+/*	  ftcprint (features2, 16, "vte");    *//* virtual transparent encryption */
+	}
+
       print ("\n");
 
       bufptr += __small_sprintf (bufptr, "bogomips\t: %d.00\n",

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features
  2021-02-17 16:28 [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features Brian Inglis
  2021-02-17 16:28 ` [PATCH v2 1/2] cpuinfo: fix check for cpuid 0x80000007 support Brian Inglis
  2021-02-17 16:28 ` [PATCH v2 2/2] cpuinfo: add AVX features; move SME, SEV/_ES features Brian Inglis
@ 2021-02-18  8:40 ` Corinna Vinschen
  2 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2021-02-18  8:40 UTC (permalink / raw)
  To: cygwin-patches

On Feb 17 09:28, Brian Inglis wrote:
> Brian Inglis (2):
>   fix check for cpuid 0x80000007 support
>   add AVX features; move SME, SEV/_ES features
> 
>  winsup/cygwin/fhandler_proc.cc | 46 ++++++++++++++++++----------------
>  1 file changed, 24 insertions(+), 22 deletions(-)
> 
> -- 
> 2.30.0

Pushed.

Thanks,
Corinna

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-18  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 16:28 [PATCH v2 0/2] cpuinfo: fix check; add AVX features; move SME, SEV/_ES features Brian Inglis
2021-02-17 16:28 ` [PATCH v2 1/2] cpuinfo: fix check for cpuid 0x80000007 support Brian Inglis
2021-02-17 16:28 ` [PATCH v2 2/2] cpuinfo: add AVX features; move SME, SEV/_ES features Brian Inglis
2021-02-18  8:40 ` [PATCH v2 0/2] cpuinfo: fix check; " Corinna Vinschen

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).