coreboot/src
Angel Pons 7d6362d56b mb/prodrive/hermes: Ensure VMX setting is applied
VMX is enabled through a bit in the IA32_FEATURE_CONTROL MSR, which can
be locked. The MSR remains locked after a non-power cycle reset, though.
If the MSR is locked, coreboot bails out and leaves VMX in the state it
was found. Because of this, changes to the VMX enable option in the BMC
only take effect after the system is power cycled.

This behaviour is highly undesirable because users are likely not aware
that a power cycle is required for changes to VMX state to take effect.
So, if VMX is supported, the IA32_FEATURE_CONTROL MSR is locked and the
current VMX state does not match the requested state, then issue a full
reset. This will power cycle the system and unlock the MSR, so that the
desired VMX state can be programmed into the MSR. This is checked early
to avoid needlessly doing time-consuming operations (running FSP) twice
if we know we will need to power cycle the system anyway.

Note that a user may change the VMX setting after the newly-added check
but before the setting is read in ramstage to program the MSR, but this
is a non-issue as firmware settings need a reset to take effect anyway.

TEST: Toggle VMX setting in BMC and reboot without power cycle, observe
      coreboot automatically issues a power cycle reset because the MSR
      is locked and the VMX state differs. Verify that the system boots
      properly with VMX in the correct state after having power cycled.

Change-Id: Id9061ba896a7062da45a86fb26eeb58927184dcb
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75141
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2023-05-13 09:19:32 +00:00
..
acpi acpi/acpigen: add acpigen_resource_io to generate I/O resource 2023-05-11 19:30:10 +00:00
arch arch/x86/car.ld: Fix undefined macro 2023-05-09 18:15:45 +00:00
commonlib {commonlib, soc/intel/cmn/cse}: Store CSE firmware version into CBMEM 2023-04-21 17:22:00 +00:00
console console: Deselect using ANSI escape characters when SimNow is used 2023-03-30 13:36:35 +00:00
cpu cpu,nb/amd/pi/00730F01: dynamically generate CPU devices 2023-05-13 00:14:32 +00:00
device lib/version: Move board identification strings 2023-04-22 16:20:49 +00:00
drivers drivers/ocp/ewl: Add EWL driver for EWL type 3 error handling 2023-05-12 15:03:29 +00:00
ec ec/google/chromeec: Handle ACPI S4 in chromeec_smi_sleep() 2023-05-07 14:54:12 +00:00
include acpi/acpigen: add acpigen_resource_io to generate I/O resource 2023-05-11 19:30:10 +00:00
lib Convert literal uses of CONFIG_MAINBOARD_{VENDOR,PART_NUMBER} 2023-05-05 13:56:34 +00:00
mainboard mb/prodrive/hermes: Ensure VMX setting is applied 2023-05-13 09:19:32 +00:00
northbridge cpu,nb/amd/pi/00730F01: dynamically generate CPU devices 2023-05-13 00:14:32 +00:00
sbom payloads/Yabits: Remove deprecated Yabits Payload 2023-02-17 01:21:43 +00:00
security security/tpm: make usage of PCRs configurable via Kconfig 2023-04-10 04:01:08 +00:00
soc soc/intel/apl: Remove set but unused variable 2023-05-12 16:37:33 +00:00
southbridge sb,soc/amd,intel: Sync FADT entries visually 2023-05-10 21:26:55 +00:00
superio treewide: Remove useless "_STA: Status" comment 2023-02-19 11:20:37 +00:00
vendorcode vendorcode/cavium: Fix set but unused variables 2023-05-12 16:33:33 +00:00
Kconfig Kconfig: Group dependency on X86EMU_DEBUG 2023-05-02 18:49:50 +00:00