Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30524
Change subject: cpu/intel/common: improve VMX/lock bit debug output ......................................................................
cpu/intel/common: improve VMX/lock bit debug output
Currently, if the IA32_FEATURE_CONTROL lock bit is already set, VMX status isn't reported. Adjust debug output to provide more useful infomation on both VMX and lock bit statuses.
Test: build/boot google/chell, observe useful output in cbmem log regardless of lock bit status.
Change-Id: Ie50f214f7e3fcfd6c3d0d2de034a93518c0a6b46 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/cpu/intel/common/common_init.c 1 file changed, 16 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/30524/1
diff --git a/src/cpu/intel/common/common_init.c b/src/cpu/intel/common/common_init.c index 9c0fcbb..486e412 100644 --- a/src/cpu/intel/common/common_init.c +++ b/src/cpu/intel/common/common_init.c @@ -43,27 +43,26 @@ msr = rdmsr(IA32_FEATURE_CONTROL);
if (msr.lo & (1 << 0)) { - printk(BIOS_ERR, "IA32_FEATURE_CONTROL is locked, so %s will do nothing\n", - __func__); + printk(BIOS_DEBUG, "IA32_FEATURE_CONTROL already locked; "); /* IA32_FEATURE_CONTROL locked. If we set it again we get an * illegal instruction */ - return; + } else { + + /* IA32_FEATURE_CONTROL MSR may initialize with random values. + * It must be cleared regardless of VMX config setting. + */ + msr.hi = msr.lo = 0; + + if (enable) { + msr.lo |= (1 << 2); + if (feature_flag & CPUID_SMX) + msr.lo |= (1 << 1); + } + + wrmsr(IA32_FEATURE_CONTROL, msr); }
- /* The IA32_FEATURE_CONTROL MSR may initialize with random values. - * It must be cleared regardless of VMX config setting. - */ - msr.hi = msr.lo = 0; - - if (enable) { - msr.lo |= (1 << 2); - if (feature_flag & CPUID_SMX) - msr.lo |= (1 << 1); - } - - wrmsr(IA32_FEATURE_CONTROL, msr); - printk(BIOS_DEBUG, "VMX status: %s\n", enable ? "enabled" : "disabled"); } @@ -75,15 +74,10 @@ msr = rdmsr(IA32_FEATURE_CONTROL);
if (msr.lo & (1 << 0)) { - printk(BIOS_ERR, "IA32_FEATURE_CONTROL is locked, so %s will do nothing\n", - __func__); /* IA32_FEATURE_CONTROL locked. If we set it again we get an * illegal instruction */ - return; - } - - if (lock) { + } else if (lock) { /* Set lock bit */ msr.lo |= (1 << 0); wrmsr(IA32_FEATURE_CONTROL, msr);