From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init()
Date: Fri, 8 Aug 2014 15:12:21 +0100 [thread overview]
Message-ID: <1407507141-30497-1-git-send-email-andrew.cooper3@citrix.com> (raw)
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
next reply other threads:[~2014-08-08 14:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 14:12 Andrew Cooper [this message]
2014-08-09 14:59 ` [PATCH] x86/hap: Initialise HAP logdirty function pointers once in hap_domain_init() Tim Deegan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407507141-30497-1-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).