mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv: vmtrr: hide mtrr if hide_mtrr is true
Now we only configure "hide MTRR" explicitly to false for SOS. For other VMs, we don't configure it which means hide_mtrr is false by default. And remove global config MTRR_ENABLED Tracked-On: #1842 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -407,11 +407,11 @@ int32_t rdmsr_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
case MSR_IA32_MTRR_FIX4K_F0000:
|
||||
case MSR_IA32_MTRR_FIX4K_F8000:
|
||||
{
|
||||
#ifdef CONFIG_MTRR_ENABLED
|
||||
v = read_vmtrr(vcpu, msr);
|
||||
#else
|
||||
err = -EACCES;
|
||||
#endif
|
||||
if (!vm_hide_mtrr(vcpu->vm)) {
|
||||
v = read_vmtrr(vcpu, msr);
|
||||
} else {
|
||||
err = -EACCES;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MSR_IA32_BIOS_SIGN_ID:
|
||||
@@ -549,11 +549,11 @@ int32_t wrmsr_vmexit_handler(struct acrn_vcpu *vcpu)
|
||||
case MSR_IA32_MTRR_FIX4K_F0000:
|
||||
case MSR_IA32_MTRR_FIX4K_F8000:
|
||||
{
|
||||
#ifdef CONFIG_MTRR_ENABLED
|
||||
write_vmtrr(vcpu, msr, v);
|
||||
#else
|
||||
err = -EACCES;
|
||||
#endif
|
||||
if (!vm_hide_mtrr(vcpu->vm)) {
|
||||
write_vmtrr(vcpu, msr, v);
|
||||
} else {
|
||||
err = -EACCES;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MSR_IA32_BIOS_SIGN_ID:
|
||||
|
||||
Reference in New Issue
Block a user