mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
VMX: fix PAT value seen by guest
The XSA-60 fixes introduced a window during which the guest PAT gets
forced to all zeros. This shouldn't be visible to the guest. Therefore
we need to intercept PAT MSR accesses during that time period.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Liu Jinsong <jinsong.liu@intel.com>
master commit: fce79f8ce9
master date: 2014-04-01 16:49:18 +0200
This commit is contained in:
1 parent
015fd7910b
commit
852d1f224d
1 file changed
+5
@@ -978,6 +978,8 @@ static void vmx_handle_cd(struct vcpu *v, unsigned long value)
|
||||
|
||||
vmx_get_guest_pat(v, pat);
|
||||
vmx_set_guest_pat(v, uc_pat);
|
||||
vmx_enable_intercept_for_msr(v, MSR_IA32_CR_PAT,
|
||||
MSR_TYPE_R | MSR_TYPE_W);
|
||||
|
||||
wbinvd(); /* flush possibly polluted cache */
|
||||
hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
|
||||
@@ -987,6 +989,9 @@ static void vmx_handle_cd(struct vcpu *v, unsigned long value)
|
||||
{
|
||||
v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
|
||||
vmx_set_guest_pat(v, *pat);
|
||||
if ( !iommu_enabled || iommu_snoop )
|
||||
vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT,
|
||||
MSR_TYPE_R | MSR_TYPE_W);
|
||||
hvm_asid_flush_vcpu(v); /* no need to flush cache */
|
||||
}
|
||||
}
|
||||
|
||||