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

[Xen-changelog] [xen staging] xen/common: Restore IRQ affinity when hotplugging a pCPU

commit efaa91afa28c36579a34702614fa3948c7e78aed
Author:     Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
AuthorDate: Fri Jun 1 15:17:46 2018 +0200
Commit:     Julien Grall <julien.grall@xxxxxxx>
CommitDate: Tue Jun 5 19:08:05 2018 +0100

    xen/common: Restore IRQ affinity when hotplugging a pCPU
    Non-boot pCPUs are being hot-unplugged during the system suspend to
    RAM and hotplugged during the resume. When non-boot pCPUs are
    hot-unplugged the interrupts that were targeted to them are migrated
    to the boot pCPU.
    On suspend, each guest could have its own wake-up devices/interrupts
    (passthrough) that could trigger the system resume. These interrupts
    could be targeted to a non-boot pCPU, e.g. if the guest's vCPU is
    pinned to a non-boot pCPU. Due to the hot-unplug of non-boot pCPUs
    during the suspend such interrupts will be migrated from non-boot pCPUs
    to the boot pCPU (this is fine). However, when non-boot pCPUs are
    hotplugged on resume, these interrupts are not migrated back to non-boot
    pCPUs, i.e. IRQ affinity is not restored on resume (this is wrong).
    This patch adds the restoration of IRQ affinity when a pCPU is hotplugged.
    Signed-off-by: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
    Reviewed-by: Dario Faggioli <dfaggioli@xxxxxxxx>
 xen/common/schedule.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 049f93f7aa..ccf936db83 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -737,6 +737,7 @@ void restore_vcpu_affinity(struct domain *d)
     for_each_vcpu ( d, v )
         spinlock_t *lock;
+        unsigned int old_cpu = v->processor;
@@ -769,6 +770,9 @@ void restore_vcpu_affinity(struct domain *d)
         lock = vcpu_schedule_lock_irq(v);
         v->processor = SCHED_OP(vcpu_scheduler(v), pick_cpu, v);
+        if ( old_cpu != v->processor )
+            sched_move_irqs(v);
generated by git-patchbot for /home/xen/git/xen.git#staging

Xen-changelog mailing list



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