* [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init()
@ 2014-08-08 14:12 Andrew Cooper
2014-08-09 14:59 ` Tim Deegan
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2014-08-08 14:12 UTC (permalink / raw)
To: Xen-devel; +Cc: Andrew Cooper, Tim Deegan, Jan Beulich
rather than repeatedly initialising them each time logdirty is enabled or the
vram tracking area changes.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
---
xen/arch/x86/mm/hap/hap.c | 15 +++++----------
xen/arch/x86/mm/paging.c | 2 --
xen/include/asm-x86/hap.h | 1 -
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 21f57c1..abf3d7a 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -81,7 +81,6 @@ int hap_track_dirty_vram(struct domain *d,
if ( !paging_mode_log_dirty(d) )
{
- hap_logdirty_init(d);
rc = paging_log_dirty_enable(d, 0);
if ( rc )
goto out;
@@ -219,15 +218,6 @@ static void hap_clean_dirty_bitmap(struct domain *d)
flush_tlb_mask(d->domain_dirty_cpumask);
}
-void hap_logdirty_init(struct domain *d)
-{
-
- /* Reinitialize logdirty mechanism */
- paging_log_dirty_init(d, hap_enable_log_dirty,
- hap_disable_log_dirty,
- hap_clean_dirty_bitmap);
-}
-
/************************************************/
/* HAP SUPPORT FUNCTIONS */
/************************************************/
@@ -438,6 +428,11 @@ static void hap_destroy_monitor_table(struct vcpu* v, mfn_t mmfn)
void hap_domain_init(struct domain *d)
{
INIT_PAGE_LIST_HEAD(&d->arch.paging.hap.freelist);
+
+ /* Use HAP logdirty mechanism. */
+ paging_log_dirty_init(d, hap_enable_log_dirty,
+ hap_disable_log_dirty,
+ hap_clean_dirty_bitmap);
}
/* return 0 for success, -errno for failure */
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 32764ba..455000d 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -594,8 +594,6 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
break;
/* Else fall through... */
case XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY:
- if ( hap_enabled(d) )
- hap_logdirty_init(d);
return paging_log_dirty_enable(d, 1);
case XEN_DOMCTL_SHADOW_OP_OFF:
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index 5161927..7876527 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -56,7 +56,6 @@ int hap_enable(struct domain *d, u32 mode);
void hap_final_teardown(struct domain *d);
void hap_teardown(struct domain *d);
void hap_vcpu_init(struct vcpu *v);
-void hap_logdirty_init(struct domain *d);
int hap_track_dirty_vram(struct domain *d,
unsigned long begin_pfn,
unsigned long nr,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init()
2014-08-08 14:12 [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init() Andrew Cooper
@ 2014-08-09 14:59 ` Tim Deegan
0 siblings, 0 replies; 2+ messages in thread
From: Tim Deegan @ 2014-08-09 14:59 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Jan Beulich, Xen-devel
At 15:12 +0100 on 08 Aug (1407507141), Andrew Cooper wrote:
> rather than repeatedly initialising them each time logdirty is enabled or the
> vram tracking area changes.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
I thought there was some subtlety of the ordering here, but I can't
see it now so maybe other changes have made it irrelevant. So,
Reviewed-by: Tim Deegan <tim@xen.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-09 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08 14:12 [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init() Andrew Cooper
2014-08-09 14:59 ` Tim Deegan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).