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

[xen staging] domain: skip more stuff for idle's vCPU-s in vcpu_create()



commit bada5850036bd284685fe2b60a156fa3cd579b94
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Feb 18 10:18:53 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 18 10:18:53 2026 +0100

    domain: skip more stuff for idle's vCPU-s in vcpu_create()
    
    Nothing hypercall-related needs setting up there. Nor do we need to
    check whether the idle domain is shutting down - it never will.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/common/domain.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index de6fdf5923..2e46207d2d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,12 +475,6 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int 
vcpu_id)
     v->vcpu_id = vcpu_id;
     v->dirty_cpu = VCPU_CPU_CLEAN;
 
-    rwlock_init(&v->virq_lock);
-
-    tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
-
-    grant_table_init_vcpu(v);
-
     if ( is_idle_domain(d) )
     {
         v->runstate.state = RUNSTATE_running;
@@ -488,6 +482,12 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int 
vcpu_id)
     }
     else
     {
+        rwlock_init(&v->virq_lock);
+
+        tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
+
+        grant_table_init_vcpu(v);
+
         v->runstate.state = RUNSTATE_offline;
         v->runstate.state_entry_time = NOW();
         set_bit(_VPF_down, &v->pause_flags);
@@ -516,7 +516,8 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int 
vcpu_id)
     }
 
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
-    vcpu_check_shutdown(v);
+    if ( !is_idle_domain(d) )
+        vcpu_check_shutdown(v);
 
     return v;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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