mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: cpu: x86: Enable MTRR feature in CPUID
The MTRR feature was missing from the CPUID, which is causing the guest to ignore the MTRR settings exposed through dedicated MSRs. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -59,6 +59,8 @@ use vmm_sys_util::signal::{register_signal_handler, SIGRTMIN};
|
|||||||
const TSC_DEADLINE_TIMER_ECX_BIT: u8 = 24; // tsc deadline timer ecx bit.
|
const TSC_DEADLINE_TIMER_ECX_BIT: u8 = 24; // tsc deadline timer ecx bit.
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
const HYPERVISOR_ECX_BIT: u8 = 31; // Hypervisor ecx bit.
|
const HYPERVISOR_ECX_BIT: u8 = 31; // Hypervisor ecx bit.
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
const MTRR_EDX_BIT: u8 = 12; // Hypervisor ecx bit.
|
||||||
|
|
||||||
// Debug I/O port
|
// Debug I/O port
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
@@ -742,6 +744,17 @@ impl CpuManager {
|
|||||||
edx_bit: None,
|
edx_bit: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Enable MTRR feature
|
||||||
|
cpuid_patches.push(CpuidPatch {
|
||||||
|
function: 1,
|
||||||
|
index: 0,
|
||||||
|
flags_bit: None,
|
||||||
|
eax_bit: None,
|
||||||
|
ebx_bit: None,
|
||||||
|
ecx_bit: None,
|
||||||
|
edx_bit: Some(MTRR_EDX_BIT),
|
||||||
|
});
|
||||||
|
|
||||||
// Supported CPUID
|
// Supported CPUID
|
||||||
let mut cpuid = hypervisor
|
let mut cpuid = hypervisor
|
||||||
.get_cpuid()
|
.get_cpuid()
|
||||||
|
|||||||
Reference in New Issue
Block a user