summaryrefslogtreecommitdiff
path: root/src/cpu/intel/common
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2022-01-31 17:38:06 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-02-02 13:26:02 +0000
commitb998fd073dc404556e8f11b798f3e045d7342114 (patch)
tree0e083361127b83d49366048b15608368ab562b55 /src/cpu/intel/common
parent57fc1b91b935cf1984d87690221d6f87b9942cbf (diff)
cpu/intel/common: Add `set_feature_ctrl_vmx_arg()`
Allow deciding whether to enable VMX through a function parameter. Used in a follow-up. Change-Id: I4f932de53207cd4e24cb4c67d20c60f708bfaa89 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61505 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Marvin Drees <marvin.drees@9elements.com>
Diffstat (limited to 'src/cpu/intel/common')
-rw-r--r--src/cpu/intel/common/common.h1
-rw-r--r--src/cpu/intel/common/common_init.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/src/cpu/intel/common/common.h b/src/cpu/intel/common/common.h
index 909f75ac40..ef0a5d9044 100644
--- a/src/cpu/intel/common/common.h
+++ b/src/cpu/intel/common/common.h
@@ -8,6 +8,7 @@
void set_vmx_and_lock(void);
void set_feature_ctrl_vmx(void);
+void set_feature_ctrl_vmx_arg(bool enable);
void set_feature_ctrl_lock(void);
/*
diff --git a/src/cpu/intel/common/common_init.c b/src/cpu/intel/common/common_init.c
index 765a174dd1..0f40e4b1dd 100644
--- a/src/cpu/intel/common/common_init.c
+++ b/src/cpu/intel/common/common_init.c
@@ -16,11 +16,10 @@ void set_vmx_and_lock(void)
set_feature_ctrl_lock();
}
-void set_feature_ctrl_vmx(void)
+void set_feature_ctrl_vmx_arg(bool enable)
{
msr_t msr;
uint32_t feature_flag;
- int enable = CONFIG(ENABLE_VMX);
feature_flag = cpu_get_feature_flags_ecx();
/* Check that the VMX is supported before reading or writing the MSR. */
@@ -62,6 +61,12 @@ void set_feature_ctrl_vmx(void)
printk(BIOS_DEBUG, "VMX status: %s\n",
enable ? "enabled" : "disabled");
}
+
+void set_feature_ctrl_vmx(void)
+{
+ set_feature_ctrl_vmx_arg(CONFIG(ENABLE_VMX));
+}
+
void set_feature_ctrl_lock(void)
{
msr_t msr;