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

[Xen-changelog] [xen master] xen/arm: move and rename is_vcpu_running function to sched.h



commit 28432b536c5161b09c4171647e1a15c5b3518ed3
Author:     Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Jul 9 10:26:16 2014 +0530
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Jul 10 13:42:53 2014 +0100

    xen/arm: move and rename is_vcpu_running function to sched.h
    
    is_vcpu_running function in vgic driver is generic. So move
    this to sched.h and rename it as is_vcpu_online
    
    Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
    Acked-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    CC: jbeulich@xxxxxxxx
    CC: keir@xxxxxxx
    CC: george.dunlap@xxxxxxxxxx
---
 xen/arch/arm/vgic.c     |   21 +++------------------
 xen/include/xen/sched.h |    5 +++++
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 96bd7c1..da807bd 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -405,22 +405,6 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, 
int n)
     }
 }
 
-static inline int is_vcpu_running(struct domain *d, int vcpuid)
-{
-    struct vcpu *v;
-
-    if ( vcpuid >= d->max_vcpus )
-        return 0;
-
-    v = d->vcpu[vcpuid];
-    if ( v == NULL )
-        return 0;
-    if (test_bit(_VPF_down, &v->pause_flags) )
-        return 0;
-
-    return 1;
-}
-
 static int vgic_to_sgi(struct vcpu *v, register_t sgir)
 {
     struct domain *d = v->domain;
@@ -444,7 +428,8 @@ static int vgic_to_sgi(struct vcpu *v, register_t sgir)
         case GICD_SGI_TARGET_OTHERS:
             for ( i = 0; i < d->max_vcpus; i++ )
             {
-                if ( i != current->vcpu_id && is_vcpu_running(d, i) )
+                if ( i != current->vcpu_id && d->vcpu[i] != NULL &&
+                     is_vcpu_online(d->vcpu[i]) )
                     set_bit(i, &vcpu_mask);
             }
             break;
@@ -459,7 +444,7 @@ static int vgic_to_sgi(struct vcpu *v, register_t sgir)
 
     for_each_set_bit( vcpuid, &vcpu_mask, d->max_vcpus )
     {
-        if ( !is_vcpu_running(d, vcpuid) )
+        if ( d->vcpu[vcpuid] != NULL && !is_vcpu_online(d->vcpu[vcpuid]) )
         {
             gdprintk(XENLOG_WARNING, "vGICD: GICD_SGIR write r=%"PRIregister" 
vcpu_mask=%lx, wrong CPUTargetList\n",
                      sgir, vcpu_mask);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index d5bc461..2f876f5 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -838,6 +838,11 @@ void watchdog_domain_destroy(struct domain *d);
 #define need_iommu(d)    (0)
 #endif
 
+static inline bool_t is_vcpu_online(const struct vcpu *v)
+{
+    return !test_bit(_VPF_down, &v->pause_flags);
+}
+
 void set_vcpu_migration_delay(unsigned int delay);
 unsigned int get_vcpu_migration_delay(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

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