From 67d06722969513e00bfb7bd33401b50b9870937c Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 31 Jan 2022 17:41:29 +0100 Subject: [PATCH] soc/intel/cannonlake: Add `disable_vmx` devtree option This option isn't meant to be assigned statically through devicetrees, but at runtime according to some config mechanism. It works in conjunction with the existing Kconfig option. Change-Id: Ia760be61466bc6a0ec187746e6e32537029512b4 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/61506 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph Reviewed-by: Marvin Drees --- src/soc/intel/cannonlake/chip.h | 2 ++ src/soc/intel/cannonlake/cpu.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/cannonlake/chip.h b/src/soc/intel/cannonlake/chip.h index 774b5268db..c7e71f6fe6 100644 --- a/src/soc/intel/cannonlake/chip.h +++ b/src/soc/intel/cannonlake/chip.h @@ -448,6 +448,8 @@ struct soc_intel_cannonlake_config { /* Disable CPU Turbo in IA32_MISC_ENABLE */ bool cpu_turbo_disable; + + bool disable_vmx; }; typedef struct soc_intel_cannonlake_config config_t; diff --git a/src/soc/intel/cannonlake/cpu.c b/src/soc/intel/cannonlake/cpu.c index 6af3e1a56f..10921a2e9e 100644 --- a/src/soc/intel/cannonlake/cpu.c +++ b/src/soc/intel/cannonlake/cpu.c @@ -144,7 +144,8 @@ void soc_core_init(struct device *cpu) enable_turbo(); /* Enable Vmx */ - set_vmx_and_lock(); + set_feature_ctrl_vmx_arg(CONFIG(ENABLE_VMX) && !cfg->disable_vmx); + set_feature_ctrl_lock(); } static void per_cpu_smm_trigger(void)