mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
hv: enable MTRR virtualization
- unmask MTRR from guest CPUID to enable MTRR - MTRR virtualization can be disabled by commenting out CONFIG_MTRR_ENABLED Signed-off-by: bliu11 <baohong.liu@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -283,8 +283,10 @@ void guest_cpuid(struct vcpu *vcpu,
|
||||
*ebx &= ~APIC_ID_MASK;
|
||||
*ebx |= (apicid & APIC_ID_MASK);
|
||||
|
||||
#ifndef CONFIG_MTRR_ENABLED
|
||||
/* mask mtrr */
|
||||
*edx &= ~CPUID_EDX_MTRR;
|
||||
#endif
|
||||
|
||||
/* Patching X2APIC, X2APIC mode is disabled by default. */
|
||||
if (x2apic_enabled)
|
||||
|
@@ -107,6 +107,10 @@ int create_vcpu(int cpu_id, struct vm *vm, struct vcpu **rtn_vcpu_handle)
|
||||
/* Create per vcpu vlapic */
|
||||
vlapic_create(vcpu);
|
||||
|
||||
#ifdef CONFIG_MTRR_ENABLED
|
||||
init_mtrr(vcpu);
|
||||
#endif
|
||||
|
||||
/* Populate the return handle */
|
||||
*rtn_vcpu_handle = vcpu;
|
||||
|
||||
|
Reference in New Issue
Block a user