diff options
author | Subrata Banik <subrata.banik@intel.com> | 2018-12-10 14:11:35 +0530 |
---|---|---|
committer | Subrata Banik <subrata.banik@intel.com> | 2018-12-13 04:32:57 +0000 |
commit | 53b08c347f54970cf5f6ce35b8e1a1fe5f8a11f9 (patch) | |
tree | b4eed19fbf1b9f35dfbdddcc43fc84469176ec59 /src/soc/intel/common/block/vmx | |
parent | e3110b862071ae0797afb0688495315a7dd47739 (diff) |
cpuid: Add helper function for cpuid(1) functions
This patch introduces 3 helper function for cpuid(1) :
1. cpu_get_cpuid() -> to get processor id (from cpuid.eax)
2. cpu_get_feature_flags_ecx -> to get processor feature flag (from cpuid.ecx)
3. cpu_get_feature_flags_edx -> to get processor feature flag (from cpuid.edx)
Above 3 helper functions are targeted to replace majority of cpuid(1)
references.
Change-Id: Ib96a7c79dadb1feff0b8d58aa408b355fbb3bc50
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/30123
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/common/block/vmx')
-rw-r--r-- | src/soc/intel/common/block/vmx/vmx.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/soc/intel/common/block/vmx/vmx.c b/src/soc/intel/common/block/vmx/vmx.c index 2cffdabd2e..d0086d080e 100644 --- a/src/soc/intel/common/block/vmx/vmx.c +++ b/src/soc/intel/common/block/vmx/vmx.c @@ -11,8 +11,10 @@ * GNU General Public License for more details. */ +#include <arch/cpu.h> #include <console/console.h> #include <cpu/x86/msr.h> +#include <intelblocks/cpulib.h> #include <intelblocks/msr.h> #include <intelblocks/vmx.h> #include <soc/cpu.h> @@ -46,11 +48,11 @@ static int soc_vmx_enabled(void) void vmx_configure(void *unused) { msr_t msr; - struct cpuid_result regs; + uint32_t feature_flag; - regs = cpuid(1); + feature_flag = cpu_get_feature_flags_ecx(); - if (!soc_vmx_enabled() || !(regs.ecx & CPUID_VMX)) { + if (!soc_vmx_enabled() || !(feature_flag & CPUID_VMX)) { printk(BIOS_ERR, "VMX: pre-conditions not met\n"); return; } |