Mailing List Archive

[PATCH v2 07/12] x86/p2m: the recalc hook is HVM-only
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>
---
v2: New.

--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -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
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1182,8 +1182,6 @@ void p2m_change_type_range(struct domain
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
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
goto out;
}
}
-#endif

out:
p2m_unlock(hostp2m);
@@ -1260,8 +1256,6 @@ int p2m_finish_type_change(struct domain
return rc;
}

-#ifdef CONFIG_HVM
-
/*
* Returns:
* 0 for success
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -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);
Re: [PATCH v2 07/12] x86/p2m: the recalc hook is HVM-only [ In reply to ]
On Mon, Apr 12, 2021 at 04:09:18PM +0200, Jan Beulich wrote:
> 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>

Thanks, Roger.