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
bit
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.

BUG=b:73231009
TEST=Verified that lscpu shows consistent information after cold and
warm reboot.

Change-Id: I3027b396eaf5eb560bbdba623ed8e96e04c5a7d5
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/924501
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
1 file changed