x86/p2m: the recalc hook is HVM-only
authorJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:28:33 +0000 (15:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:28:33 +0000 (15:28 +0200)
Exclude functions involved in its use from !HVM builds, thus making it
possible to exclude the hook as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h

index 4a70ee4f192ac9db67a9a7bc59a1fac269ee4a62..efbe5fd1952442dd6ec18b7a0a4f06346e9e2528 100644 (file)
@@ -1173,8 +1173,8 @@ void p2m_pt_init(struct p2m_domain *p2m)
 {
     p2m->set_entry = p2m_pt_set_entry;
     p2m->get_entry = p2m_pt_get_entry;
-    p2m->recalc = do_recalc;
 #ifdef CONFIG_HVM
+    p2m->recalc = do_recalc;
     p2m->change_entry_type_global = p2m_pt_change_entry_type_global;
     p2m->change_entry_type_range = p2m_pt_change_entry_type_range;
 #endif
index 0e469369b9cf7fa2a098b82311360f61b88973e0..ad388e0802d91e626717284404198765a741e0be 100644 (file)
@@ -1182,8 +1182,6 @@ void p2m_change_type_range(struct domain *d,
     p2m_unlock(hostp2m);
 }
 
-#endif /* CONFIG_HVM */
-
 /*
  * Finish p2m type change for gfns which are marked as need_recalc in a range.
  * Uses the current p2m's max_mapped_pfn to further clip the invalidation
@@ -1234,7 +1232,6 @@ int p2m_finish_type_change(struct domain *d,
     if ( rc < 0 )
         goto out;
 
-#ifdef CONFIG_HVM
     if ( unlikely(altp2m_active(d)) )
     {
         unsigned int i;
@@ -1252,7 +1249,6 @@ int p2m_finish_type_change(struct domain *d,
                     goto out;
             }
     }
-#endif
 
  out:
     p2m_unlock(hostp2m);
@@ -1260,8 +1256,6 @@ int p2m_finish_type_change(struct domain *d,
     return rc;
 }
 
-#ifdef CONFIG_HVM
-
 /*
  * Returns:
  *    0              for success
index 1ed7da947321312e11cc14be42aed06cf79bbce0..979fc83d02bd5550f95c01e82aa4856eb2296057 100644 (file)
@@ -259,9 +259,9 @@ struct p2m_domain {
                                     p2m_query_t q,
                                     unsigned int *page_order,
                                     bool_t *sve);
+#ifdef CONFIG_HVM
     int                (*recalc)(struct p2m_domain *p2m,
                                  unsigned long gfn);
-#ifdef CONFIG_HVM
     void               (*enable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*disable_hardware_log_dirty)(struct p2m_domain *p2m);
     void               (*flush_hardware_cached_dirty)(struct p2m_domain *p2m);