Auteur Sujet: Comment savoir si mon CPU supporte LAHF, SAHF, CMPXCHG16b et PrefetchW ?  (Lu 4952 fois)

0 Membres et 1 Invité sur ce sujet

vivien

  • Administrateur
  • *
  • Messages: 47 086
    • Twitter LaFibre.info
Comment savoir si mon processeur 64 bits supporte LAHF, SAHF, CMPXCHG16b et PrefetchW ?

Windows 8.1 et Windows 10 nécessitent d'avoir les instructions LAHF, SAHF, CMPXCHG16b et PrefetchW pour fonctionner en 64bits (par contre Windows 8 et ses prédécesseurs fonctionnent bien en 64bits sans).

Les premiers Pentium 4 64bits et les premiers Athlon 64 n'ont pas ces instructions.

Comment savoir si ce Athlon 64 supporte ces 4 instructions via un lscpu sous Linux ?


$ lscpu
Architecture:          x86_64
Mode(s) opératoire(s) des processeurs :32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) par cœur : 1
Cœur(s) par socket : 1
Socket(s):             1
Nœud(s) NUMA :       1
Identifiant constructeur :AuthenticAMD
Famille de processeur :15
Modèle :             95
Model name:            AMD Athlon(tm) 64 Processor 3200+
Révision :           2
Vitesse du processeur en MHz :1000.000
CPU max MHz:           2000,0000
CPU min MHz:           1000,0000
BogoMIPS:              2004.36
Virtualisation :      AMD-V
Cache L1d :           64K
Cache L1i :           64K
Cache L2 :            512K
NUMA node0 CPU(s):     0
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 lahf_lm svm extapic cr8_legacy 3dnowprefetch vmmcall


Sur un processeur de dernière génération, qui supporte bien sur ces instructions, je ne vois pas de flag "PREFETCH/PREFETCHW",  "CMPXCHG16B"  ou "SAHF". Il y a par contre un flag "lahf_lm" :

$ lscpu
Architecture:          x86_64
Mode(s) opératoire(s) des processeurs :32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) par cœur : 2
Cœur(s) par socket : 4
Socket(s):             1
Nœud(s) NUMA :       1
Identifiant constructeur :GenuineIntel
Famille de processeur :6
Modèle :             158
Model name:            Intel(R) Xeon(R) CPU E3-1240 v6 @ 3.70GHz
Révision :           9
Vitesse du processeur en MHz :3700.000
CPU max MHz:           4100,0000
CPU min MHz:           800,0000
BogoMIPS:              7392.00
Virtualisation :      VT-x
Cache L1d :           32K
Cache L1i :           32K
Cache L2 :            256K
Cache L3 :            8192K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp

alain_p

  • Abonné Free fibre
  • *
  • Messages: 16 170
  • Delta S 10G-EPON sur Les Ulis (91)
Comment savoir si mon CPU supporte LAHF, SAHF, CMPXCHG16b et PrefetchW ?
« Réponse #1 le: 20 janvier 2018 à 21:49:57 »
Tu peux utiliser l'outils sysinternals coreinfo :
https://docs.microsoft.com/en-us/sysinternals/downloads/coreinfo

Ex :
PS G:\download\Microsoft\sysintrenals\Coreinfo> .\Coreinfo.exe /?

Coreinfo v3.31 - Dump information on system CPU and memory topology
Copyright (C) 2008-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

For each resource it shows a map of the OS-visible processors
that correspond to the specified resources, with '*' representing the
applicable processors. For example, on a 4-core system, a line in the
cache output with a map of shared by cores 3 and 4.

Usage: coreinfo [-c][-f][-g][-l][-n][-s][-m][-v]
  -c       Dump information on cores.
  -f       Dump core feature information.
  -g       Dump information on groups.
  -l       Dump information on caches.
  -n       Dump information on NUMA nodes.
  -s       Dump information on sockets.
  -m       Dump NUMA access cost.
  -v       Dump only virtualization-related features including
           support for second level address translation
           (requires administrative rights on Intel systems).

All options except -v are selected by default.

PS G:\download\Microsoft\sysintrenals\Coreinfo> .\Coreinfo.exe -f > coreinfo.txt

Coreinfo v3.31 - Dump information on system CPU and memory topology
Copyright (C) 2008-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

J'ai donc redirigé la sortie vers un fichier texte, et dans celui-ci, on a les informations, par exemple :

Citer
CX16         *   Supports CMPXCHG16B instruction
...
PREFETCHW    *   Supports PREFETCHW instruction
« Modifié: 20 janvier 2018 à 22:11:26 par alain_p »