[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.3] x86/hvm: refine the judgment on IDENT_PT for EMT
commit 896a105366dca3259f7a84d8b9282738122c9d73 Author: Dongxiao Xu <dongxiao.xu@xxxxxxxxx> AuthorDate: Fri Mar 14 17:39:11 2014 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Fri Mar 14 17:39:11 2014 +0100 x86/hvm: refine the judgment on IDENT_PT for EMT When trying to get the EPT EMT type, the judgment on HVM_PARAM_IDENT_PT is not correct which always returns WB type if the parameter is not set. Remove the related code. Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx> We can't fully drop the dependency yet, but we should certainly avoid overriding cases already properly handled. The reason for this is that the guest setting up its MTRRs happens _after_ the EPT tables got already constructed, and no code is in place to propagate this to the EPT code. Without this check we're forcing the guest to run with all of its memory uncachable until something happens to re-write every single EPT entry. But of course this has to be just a temporary solution. In the same spirit we should defer the "very early" (when the guest is still being constructed and has no vCPU yet) override to the last possible point. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx> Acked-by: Keir Fraser <keir@xxxxxxx> master commit: cadfd7bca999c0a795dc27be72d43c92e8943a0b master date: 2014-03-10 11:02:25 +0100 --- xen/arch/x86/hvm/mtrr.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index 4ff1e55..e2da462 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -689,12 +689,8 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn, *ipat = 0; - if ( (current->domain != d) && - ((d->vcpu == NULL) || ((v = d->vcpu[0]) == NULL)) ) - return MTRR_TYPE_WRBACK; - - if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] ) - return MTRR_TYPE_WRBACK; + if ( v->domain != d ) + v = d->vcpu ? d->vcpu[0] : NULL; if ( !mfn_valid(mfn_x(mfn)) ) return MTRR_TYPE_UNCACHABLE; @@ -717,7 +713,9 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn, return MTRR_TYPE_WRBACK; } - gmtrr_mtype = get_mtrr_type(&v->arch.hvm_vcpu.mtrr, (gfn << PAGE_SHIFT)); + gmtrr_mtype = v && d->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] ? + get_mtrr_type(&v->arch.hvm_vcpu.mtrr, (gfn << PAGE_SHIFT)) : + MTRR_TYPE_WRBACK; hmtrr_mtype = get_mtrr_type(&mtrr_state, (mfn_x(mfn) << PAGE_SHIFT)); return ((gmtrr_mtype <= hmtrr_mtype) ? gmtrr_mtype : hmtrr_mtype); } -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.3 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |