====== Check x86 CPU feature ====== ===== Synopsis ===== cpuid [--ext] [--ecx] ===== Examples ===== === Check if CPU supports 64-bit operation ("long mode") === cpuid --ext 29 && set arch x86_64 || set arch i386 === Check if CPU supports physical address extensions ("PAE") === cpuid 6 && set pae yes || === Check if CPU supports hardware virtualisation === cpuid --ecx 5 && set vmx yes || cpuid --ext --ecx 2 && set svm yes || isset ${vmx} || isset ${svm} && set hw_virt yes || ===== Description ===== Check for the existence of the specified x86 CPU feature using the ''[[http://en.wikipedia.org/wiki/CPUID|CPUID]]'' instruction. If the ''%%--ext%%'' option is specified then the [[http://support.amd.com/us/Embedded_TechDocs/25481.pdf|extended feature set]] is checked, otherwise the [[http://download.intel.com/design/processor/applnots/24161832.pdf|standard feature set]] is checked. If the ''%%--ecx%%'' option is specified then the feature set contained in the ''%%%ecx%%'' register is checked, otherwise the feature set contained in the ''%%%edx%%'' register is checked. Some useful features to check are: ^ Feature set ^ Register ^ Bit ^ Feature ^ Command | | Extended | ''%%%edx%%'' | 29 ^ Long mode (64-bit) | ''%%cpuid --ext 29%%'' | | Standard | ''%%%edx%%'' | 28 ^ Hyper-threading (HTT) | ''%%cpuid 28%%'' | | Standard | ''%%%edx%%'' | 6 ^ Physical address extensions (PAE) | ''%%cpuid 6%%'' | | Standard | ''%%%ecx%%'' | 5 ^ Intel Virtual Machine Extensions (VMX) | ''%%cpuid --ecx 5%%'' | | Extended | ''%%%ecx%%'' | 2 ^ AMD Secure Virtual Machine (SVM) | ''%%cpuid --ext --ecx 2%%'' | | Standard | ''%%%edx%%'' | 15 ^ Conditional Move (CMOV) | ''%%cpuid 15%%'' | ===== Command status ===== ^ Success | The specified x86 CPU feature is present | ^ Failure | The specified x86 CPU feature is not present | ===== See also ===== * ''[[:cmd:set]]'' * iPXE [[:scripting|scripting]] guide * [[:cmd|List of all iPXE commands]] ===== Notes ===== The [[http://download.intel.com/design/processor/applnots/24161832.pdf|standard feature set]] represents the values returned in ''%%%ecx%%'' and ''%%%edx%%'' when ''CPUID'' is called with ''%%%eax=0x00000001%%''. The [[http://support.amd.com/us/Embedded_TechDocs/25481.pdf|extended feature set]] represents the values returned in ''%%%ecx%%'' and ''%%%edx%%'' when ''CPUID'' is called with ''%%%eax=0x80000001%%''.