UefiCpuPkg CpuCommonFeaturesLib: Fix smx/vmx enable logic error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed: Jeff Fan <jeff.fan@intel.com>
This commit is contained in:
Eric Dong
2017-07-11 10:07:36 +08:00
parent 05973f9e8a
commit b1fe2029fa
3 changed files with 55 additions and 117 deletions

View File

@@ -346,7 +346,7 @@ VmxSupport (
);
/**
Initializes VMX inside SMX feature to specific state.
Initializes VMX feature to specific state.
@param[in] ProcessorNumber The index of the CPU executing this function.
@param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
@@ -355,42 +355,16 @@ VmxSupport (
by CPU_FEATURE_GET_CONFIG_DATA. NULL if
CPU_FEATURE_GET_CONFIG_DATA was not provided in
RegisterCpuFeature().
@param[in] State If TRUE, then the VMX inside SMX feature must be enabled.
If FALSE, then the VMX inside SMX feature must be disabled.
@param[in] State If TRUE, then the VMX feature must be enabled.
If FALSE, then the VMX feature must be disabled.
@retval RETURN_SUCCESS VMX inside SMX feature is initialized.
@retval RETURN_SUCCESS VMX feature is initialized.
@note This service could be called by BSP only.
**/
RETURN_STATUS
EFIAPI
VmxInsideSmxInitialize (
IN UINTN ProcessorNumber,
IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
IN VOID *ConfigData, OPTIONAL
IN BOOLEAN State
);
/**
Initializes SENTER feature to specific state.
@param[in] ProcessorNumber The index of the CPU executing this function.
@param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
structure for the CPU executing this function.
@param[in] ConfigData A pointer to the configuration buffer returned
by CPU_FEATURE_GET_CONFIG_DATA. NULL if
CPU_FEATURE_GET_CONFIG_DATA was not provided in
RegisterCpuFeature().
@param[in] State If TRUE, then the SENTER feature must be enabled.
If FALSE, then the SENTER feature must be disabled.
@retval RETURN_SUCCESS SENTER feature is initialized.
@note This service could be called by BSP only.
**/
RETURN_STATUS
EFIAPI
SenterInitialize (
VmxInitialize (
IN UINTN ProcessorNumber,
IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
IN VOID *ConfigData, OPTIONAL
@@ -472,7 +446,7 @@ SmxSupport (
);
/**
Initializes VMX outside SMX feature to specific state.
Initializes SMX feature to specific state.
@param[in] ProcessorNumber The index of the CPU executing this function.
@param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
@@ -481,16 +455,17 @@ SmxSupport (
by CPU_FEATURE_GET_CONFIG_DATA. NULL if
CPU_FEATURE_GET_CONFIG_DATA was not provided in
RegisterCpuFeature().
@param[in] State If TRUE, then the VMX outside SMX feature must be enabled.
If FALSE, then the VMX outside SMX feature must be disabled.
@param[in] State If TRUE, then SMX feature must be enabled.
If FALSE, then SMX feature must be disabled.
@retval RETURN_SUCCESS VMX outside SMX feature is initialized.
@retval RETURN_SUCCESS SMX feature is initialized.
@retval RETURN_UNSUPPORTED VMX not initialized.
@note This service could be called by BSP only.
**/
RETURN_STATUS
EFIAPI
VmxOutsideSmxInitialize (
SmxInitialize (
IN UINTN ProcessorNumber,
IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
IN VOID *ConfigData, OPTIONAL