CHROMIUM: x86: Clear X86_FEATURE_VMX always when disablevmx is set

X86_FEATURE_VMX was being cleared only if MSR_IA32_FEATURE_CONTROL is
changed. However, this results in lscpu to provide inconsistent
information across warm reboots:

1. Cold boot -- disablevmx is true
2. BIOS does not lock MSR_IA32_FEATURE_CONTROL, so kernel sets lock
3. Since MSR_IA32_FEATURE_CONTROL is updated and disablevmx is true,
X86_FEATURE_VMX is cleared.
4. Now, on a warm reboot as the system has not made a trip to S5,
MSR_IA32_FEATURE_CONTROL lock bit is not reset.
5. Kernel sees that there is no change required to
MSR_IA32_FEATURE_CONTROL. Thus, it results in early return in
cpu_control_vmx and X86_FEATURE_VMX is not cleared.

This change clears X86_FEATURE_VMX in cpu_control_vmx if
MSR_IA32_FEATURE_CONTROL is successfully updated or if no update is
required and disablevmx is true.

TEST=Verified that lscpu shows consistent information after cold and
warm reboot.

Change-Id: I3027b396eaf5eb560bbdba623ed8e96e04c5a7d5
Signed-off-by: Furquan Shaikh <>
Reviewed-by: Aaron Durbin <>
Reviewed-by: Dylan Reid <>
1 file changed