WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Clear all shadow caches when return to real mode from pr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Clear all shadow caches when return to real mode from protect mode.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Dec 2005 22:22:08 +0000
Delivery-date: Thu, 15 Dec 2005 22:24:08 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 37cafca1539e429495e0bd639aa874576e3bd8b6
# Parent  7e419ba80326589db4c43c30faa6f51f113ecd5b
Clear all shadow caches when return to real mode from protect mode.
So that, if OS modify some page tables in real mode and then
return to protect mode, no outdated shadow table be used because
out of sync machanism do not work in real mode.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>

diff -r 7e419ba80326 -r 37cafca1539e xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Thu Dec 15 19:35:32 2005
+++ b/xen/arch/x86/shadow32.c   Thu Dec 15 19:38:44 2005
@@ -2982,6 +2982,23 @@
     }
 }
 
+void clear_all_shadow_status(struct domain *d)
+{
+    shadow_lock(d);
+    free_shadow_pages(d);
+    free_shadow_ht_entries(d);
+    d->arch.shadow_ht = 
+        xmalloc_array(struct shadow_status, shadow_ht_buckets);
+    if ( d->arch.shadow_ht == NULL ) {
+        printk("clear all shadow status:xmalloc fail\n");
+        domain_crash_synchronous();
+    }
+    memset(d->arch.shadow_ht, 0,
+           shadow_ht_buckets * sizeof(struct shadow_status));
+
+    free_out_of_sync_entries(d);
+    shadow_unlock(d);
+}
 
 /************************************************************************/
 /************************************************************************/
diff -r 7e419ba80326 -r 37cafca1539e xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Thu Dec 15 19:35:32 2005
+++ b/xen/arch/x86/shadow_public.c      Thu Dec 15 19:38:44 2005
@@ -1747,6 +1747,24 @@
     shadow_unlock(d);
 }
 
+void clear_all_shadow_status(struct domain *d)
+{
+    shadow_lock(d);
+    free_shadow_pages(d);
+    free_shadow_ht_entries(d);
+    d->arch.shadow_ht = 
+        xmalloc_array(struct shadow_status, shadow_ht_buckets);
+    if ( d->arch.shadow_ht == NULL ) {
+        printk("clear all shadow status:xmalloc fail\n");
+        domain_crash_synchronous();
+    }
+    memset(d->arch.shadow_ht, 0,
+           shadow_ht_buckets * sizeof(struct shadow_status));
+
+    free_out_of_sync_entries(d);
+    shadow_unlock(d);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 7e419ba80326 -r 37cafca1539e xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Thu Dec 15 19:35:32 2005
+++ b/xen/arch/x86/vmx.c        Thu Dec 15 19:38:44 2005
@@ -1223,6 +1223,7 @@
             }
         }
 
+        clear_all_shadow_status(v->domain);
         if (vmx_assist(v, VMX_ASSIST_INVOKE)) {
             set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &v->arch.arch_vmx.cpu_state);
             __vmread(GUEST_RIP, &eip);
diff -r 7e419ba80326 -r 37cafca1539e xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Thu Dec 15 19:35:32 2005
+++ b/xen/include/asm-x86/shadow.h      Thu Dec 15 19:38:44 2005
@@ -1707,6 +1707,8 @@
     }
 }
 
+void clear_all_shadow_status(struct domain *d);
+
 #if SHADOW_DEBUG
 extern int _check_pagetable(struct vcpu *v, char *s);
 extern int _check_all_pagetables(struct vcpu *v, char *s);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Clear all shadow caches when return to real mode from protect mode., Xen patchbot -unstable <=