config_tools: add BIOS invalid setting check

1. check if VMX feature is enabled in the BIOS setting.
If disabled, board inspector will show error message.
2. check if Hyper-Threading is enabled in the BIOS setting.
If enabled, board inspector will show warning message.
3. check if VT-d is enabled in the BIOS setting.
If disabled, board inspector will show error message.

v2-->v3:
Use the class names instead of addresses, and invoke the rdmsr method
of each class.

v1-->v2:
1. For the Hyper-Threading BIOS check, update the log level to the warning.
2. For VMX invalid BIOS check, the XDS does the actual check,
the board inspector only collects information.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Kunhui-Li 2022-03-15 14:41:09 +08:00 committed by acrnsi-robot
parent 7dfc3c683c
commit c9de9b61a3
3 changed files with 38 additions and 3 deletions

View File

@ -13,6 +13,19 @@ class MSR_IA32_MISC_ENABLE(MSR):
"fast_string",
]
class MSR_IA32_FEATURE_CONTROL(MSR):
addr = 0x03a
msr_ia32_feature_control_lock = msrfield(1, 0, doc=None)
msr_ia32_feature_control_vmx_no_smx = msrfield(1, 2, doc=None)
@property
def disable_vmx(self):
return self.msr_ia32_feature_control_lock and not self.msr_ia32_feature_control_vmx_no_smx
capability_bits = [
"disable_vmx",
]
class MSR_IA32_VMX_PROCBASED_CTLS2(MSR):
addr = 0x0000048B

View File

@ -53,9 +53,10 @@ def extract_model(processors_node, cpu_id, family_id, model_id, core_type, nativ
if getattr(leaf_data, cap) == 1:
add_child(n, "capability", id=cap)
msr_regs = [MSR_IA32_MISC_ENABLE, MSR_IA32_VMX_BASIC, MSR_IA32_VMX_PINBASED_CTLS,
MSR_IA32_VMX_PROCBASED_CTLS, MSR_IA32_VMX_EXIT_CTLS, MSR_IA32_VMX_ENTRY_CTLS,
MSR_IA32_VMX_MISC, MSR_IA32_VMX_PROCBASED_CTLS2, MSR_IA32_VMX_EPT_VPID_CAP]
msr_regs = [MSR_IA32_MISC_ENABLE, MSR_IA32_FEATURE_CONTROL, MSR_IA32_VMX_BASIC,
MSR_IA32_VMX_PINBASED_CTLS, MSR_IA32_VMX_PROCBASED_CTLS, MSR_IA32_VMX_EXIT_CTLS,
MSR_IA32_VMX_ENTRY_CTLS, MSR_IA32_VMX_MISC, MSR_IA32_VMX_PROCBASED_CTLS2,
MSR_IA32_VMX_EPT_VPID_CAP]
for msr_reg in msr_regs:
msr_data = msr_reg.rdmsr(cpu_id)
for cap in msr_data.capability_bits:

View File

@ -3,6 +3,27 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:acrn="https://projectacrn.org">
<xs:assert test="contains(//DRHD_INFO[text()], 'DRHD0')">
<xs:annotation acrn:severity="error">
<xs:documentation>Intel Virtualization Technology for Directed I/O (VT-d) feature is not enabled.
ACRN requires this feature to function properly. Please enable it in your BIOS settings.</xs:documentation>
</xs:annotation>
</xs:assert>
<xs:assert test="//processors//core[count(thread) = 1]">
<xs:annotation acrn:severity="warning">
<xs:documentation>Hyper-Threading (HT) is enabled. While this feature can provide more overall processing power,
hyperthreading can adversely impact predictable real-time performance behavior.</xs:documentation>
</xs:annotation>
</xs:assert>
<xs:assert test="every $model in processors/model satisfies not($model/capability[@id='disable_vmx'])">
<xs:annotation acrn:severity="error">
<xs:documentation>Virtual Machine Extensions (VMX) feature is not enabled.
ACRN requires this feature to function properly. Please enable it in BIOS.</xs:documentation>
</xs:annotation>
</xs:assert>
<xs:assert test="every $model in processors/model satisfies exists($model/capability[@id='vmx'])">
<xs:annotation acrn:severity="error">
<xs:documentation>Virtual Machine Extensions (VMX) feature is not supported on this processor. ACRN requires this feature to function properly.</xs:documentation>