From: Roger Pau Monné Date: Tue, 30 Mar 2021 12:37:53 +0000 (+0200) Subject: hvm/mtrr: remove unnecessary is_hvm_domain check X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~790 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=14612851867e61cf5b46f13aca5a2ce2c329efb6;p=xen.git hvm/mtrr: remove unnecessary is_hvm_domain check epte_get_entry_emt will only be called for HVM domains, so the is_hvm_domain check is unnecessary. It's a remnant of PVHv1. Shouldn't result in any functional change. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index fb051d59c3..82ded1635c 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -851,10 +851,8 @@ int epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn, if ( gmtrr_mtype == -EADDRNOTAVAIL ) return -1; - gmtrr_mtype = is_hvm_domain(d) && v ? - get_mtrr_type(&v->arch.hvm.mtrr, - gfn << PAGE_SHIFT, order) : - MTRR_TYPE_WRBACK; + gmtrr_mtype = v ? get_mtrr_type(&v->arch.hvm.mtrr, gfn << PAGE_SHIFT, order) + : MTRR_TYPE_WRBACK; hmtrr_mtype = get_mtrr_type(&mtrr_state, mfn_x(mfn) << PAGE_SHIFT, order); if ( gmtrr_mtype < 0 || hmtrr_mtype < 0 ) return -1;