]> xenbits.xensource.com Git - xen.git/commitdiff
x86/shadow: Alter shadow_{pro,de}mote() to take a domain
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 21 Aug 2014 18:55:48 +0000 (19:55 +0100)
committerTim Deegan <tim@xen.org>
Fri, 20 Feb 2015 14:47:30 +0000 (14:47 +0000)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/mm/shadow/private.h

index 6945dfea4ee2490fae8f58b5cc8eef4e3ef64087..c6b8e6f1faccd219297821e5d466dfc0761ef7e2 100644 (file)
@@ -990,9 +990,8 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn)
  * involves making sure there are no writable mappings available to the guest
  * for this page.
  */
-void shadow_promote(struct vcpu *v, mfn_t gmfn, unsigned int type)
+void shadow_promote(struct domain *d, mfn_t gmfn, unsigned int type)
 {
-    struct domain *d = v->domain;
     struct page_info *page = mfn_to_page(gmfn);
 
     ASSERT(mfn_valid(gmfn));
@@ -1017,9 +1016,8 @@ void shadow_promote(struct vcpu *v, mfn_t gmfn, unsigned int type)
     TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_PROMOTE);
 }
 
-void shadow_demote(struct vcpu *v, mfn_t gmfn, u32 type)
+void shadow_demote(struct domain *d, mfn_t gmfn, u32 type)
 {
-    struct domain *d = v->domain;
     struct page_info *page = mfn_to_page(gmfn);
 
     ASSERT(test_bit(_PGC_page_table, &page->count_info));
index 82759a67912b885585750f7ba930f889a721faca..f2dea162f048551a63dcb50ad146548254569c11 100644 (file)
@@ -1563,7 +1563,7 @@ sh_make_shadow(struct vcpu *v, mfn_t gmfn, u32 shadow_type)
         }
     }
 
-    shadow_promote(v, gmfn, shadow_type);
+    shadow_promote(d, gmfn, shadow_type);
     set_shadow_status(d, gmfn, shadow_type, smfn);
 
     return smfn;
@@ -1898,7 +1898,7 @@ void sh_destroy_l4_shadow(struct vcpu *v, mfn_t smfn)
     /* Record that the guest page isn't shadowed any more (in this type) */
     gmfn = backpointer(sp);
     delete_shadow_status(d, gmfn, t, smfn);
-    shadow_demote(v, gmfn, t);
+    shadow_demote(d, gmfn, t);
     /* Decrement refcounts of all the old entries */
     sl4mfn = smfn;
     SHADOW_FOREACH_L4E(sl4mfn, sl4e, 0, 0, d, {
@@ -1930,7 +1930,7 @@ void sh_destroy_l3_shadow(struct vcpu *v, mfn_t smfn)
     /* Record that the guest page isn't shadowed any more (in this type) */
     gmfn = backpointer(sp);
     delete_shadow_status(d, gmfn, t, smfn);
-    shadow_demote(v, gmfn, t);
+    shadow_demote(d, gmfn, t);
 
     /* Decrement refcounts of all the old entries */
     sl3mfn = smfn;
@@ -1968,7 +1968,7 @@ void sh_destroy_l2_shadow(struct vcpu *v, mfn_t smfn)
     /* Record that the guest page isn't shadowed any more (in this type) */
     gmfn = backpointer(sp);
     delete_shadow_status(d, gmfn, t, smfn);
-    shadow_demote(v, gmfn, t);
+    shadow_demote(d, gmfn, t);
 
     /* Decrement refcounts of all the old entries */
     sl2mfn = smfn;
@@ -2005,7 +2005,7 @@ void sh_destroy_l1_shadow(struct vcpu *v, mfn_t smfn)
     {
         mfn_t gmfn = backpointer(sp);
         delete_shadow_status(d, gmfn, t, smfn);
-        shadow_demote(v, gmfn, t);
+        shadow_demote(d, gmfn, t);
     }
 
     if ( shadow_mode_refcounts(d) )
index 7abb0e0490b2142c09baf9671beba122bd5f7458..3820d9ef370200e738f7c7a666ca73b680cbed41 100644 (file)
@@ -350,8 +350,8 @@ void  shadow_hash_delete(struct domain *d,
                          unsigned long n, unsigned int t, mfn_t smfn);
 
 /* shadow promotion */
-void shadow_promote(struct vcpu *v, mfn_t gmfn, u32 type);
-void shadow_demote(struct vcpu *v, mfn_t gmfn, u32 type);
+void shadow_promote(struct domain *d, mfn_t gmfn, u32 type);
+void shadow_demote(struct domain *d, mfn_t gmfn, u32 type);
 
 /* Shadow page allocation functions */
 void  shadow_prealloc(struct domain *d, u32 shadow_type, unsigned int count);