[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/4] xen/common: Break domain_unmap_resources() out of domain_kill()



A subsequent change is going to need an x86-specific unmapping step, so take
the opportunity to split the current vcpu unmapping out into a dedicated path.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
CC: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/domain.c      | 16 +++++++++++++---
 xen/include/xen/domain.h |  4 ++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 32bca8d..e66f7ea 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -700,10 +700,21 @@ int rcu_lock_live_remote_domain_by_id(domid_t dom, struct 
domain **d)
     return 0;
 }
 
+static void domain_unmap_resources(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        unmap_vcpu_info(v);
+
+        arch_vcpu_unmap_resources(v);
+    }
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
-    struct vcpu *v;
 
     if ( d == current->domain )
         return -EINVAL;
@@ -732,13 +743,12 @@ int domain_kill(struct domain *d)
         d->tmem_client = NULL;
         /* fallthrough */
     case DOMDYING_dying:
+        domain_unmap_resources(d);
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
         if ( cpupool_move_domain(d, cpupool0) )
             return -ERESTART;
-        for_each_vcpu ( d, v )
-            unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
         /* Mem event cleanup has to go here because the rings 
          * have to be put before we call put_domain. */
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index d1bfc82..f53c3a9 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -90,6 +90,10 @@ void arch_dump_domain_info(struct domain *d);
 
 int arch_vcpu_reset(struct vcpu *);
 
+#ifndef arch_vcpu_unmap_resources
+static inline void arch_vcpu_unmap_resources(struct vcpu *v) {}
+#endif
+
 bool_t domctl_lock_acquire(void);
 void domctl_lock_release(void);
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.