diff mbox series

hvm/mtrr: remove unnecessary is_hvm_domain check

Message ID 20210323112900.40723-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series hvm/mtrr: remove unnecessary is_hvm_domain check | expand

Commit Message

Roger Pau Monné March 23, 2021, 11:29 a.m. UTC
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é <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/mtrr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Jan Beulich March 23, 2021, 12:12 p.m. UTC | #1
On 23.03.2021 12:29, Roger Pau Monne wrote:
> 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é <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index fb051d59c3f..82ded1635c3 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;