From: "Ling, Xiaofeng" <xiaofeng.ling@intel.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH]Don't unshadow current used shadow L2 table.
Date: Thu, 08 Dec 2005 16:02:42 +0800 [thread overview]
Message-ID: <4397E8A2.20307@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
# HG changeset patch
# User Xiaofeng Ling <xiaofeng.ling@intel.com>
# Node ID cc6e19224d0b755d24358cd15d1a40f894d320b4
# Parent b215584242c43415eccd008b90c812f3d04b398d
Don't unshadow when the shadow l2 is the current used shadow table.
Otherwise, when destorying the domain, if the current sl2 is unpinned,
the shadow page will be freed without accquire the shadow_lock.
This may also improve the performance due to avoiding uncessary
unshadow.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
[-- Attachment #2: unshadow-fix.patch --]
[-- Type: text/x-patch, Size: 1914 bytes --]
# HG changeset patch
# User Xiaofeng Ling <xiaofeng.ling@intel.com>
# Node ID cc6e19224d0b755d24358cd15d1a40f894d320b4
# Parent b215584242c43415eccd008b90c812f3d04b398d
Don't unshadow when the shadow l2 is the current used shadow table.
Otherwise, when destory the domain, if the current sl2 is unpinned,
the shadow page will be freed without accquire the shadow_lock.
This may also improve the performance due to avoiding uncessary
unshadow.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
diff -r b215584242c4 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c Wed Dec 7 16:26:07 2005 +0000
+++ b/xen/arch/x86/shadow.c Thu Dec 8 15:07:52 2005 +0800
@@ -1450,6 +1450,7 @@
int changed;
u32 min_max_shadow, min_max_snapshot;
int min_shadow, max_shadow, min_snapshot, max_snapshot;
+ struct vcpu *v;
ASSERT(shadow_lock_is_acquired(d));
@@ -1739,6 +1740,9 @@
if ( unlikely(unshadow) )
{
+ for_each_vcpu(d, v)
+ if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+ return need_flush;
perfc_incrc(unshadow_l2_count);
shadow_unpin(smfn);
#if CONFIG_PAGING_LEVELS == 2
diff -r b215584242c4 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c Wed Dec 7 16:26:07 2005 +0000
+++ b/xen/arch/x86/shadow32.c Thu Dec 8 15:07:52 2005 +0800
@@ -2326,6 +2326,7 @@
int changed;
u32 min_max_shadow, min_max_snapshot;
int min_shadow, max_shadow, min_snapshot, max_snapshot;
+ struct vcpu *v;
ASSERT(shadow_lock_is_acquired(d));
@@ -2527,6 +2528,9 @@
if ( unlikely(unshadow) )
{
+ for_each_vcpu(d, v)
+ if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+ return need_flush;
perfc_incrc(unshadow_l2_count);
shadow_unpin(smfn);
if ( unlikely(shadow_mode_external(d)) )
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2005-12-08 8:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4397E8A2.20307@intel.com \
--to=xiaofeng.ling@intel.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.