WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [qemu-xen-unstable] Update vcpu hotplug logic

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] Update vcpu hotplug logic
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 30 Apr 2010 09:50:08 -0700
Delivery-date: Fri, 30 Apr 2010 09:50:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit 376c64a4e068b3dc83f066b4050ed34d983a5c75
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Fri Apr 30 17:41:18 2010 +0100

    Update vcpu hotplug logic
    
    Add vcpu online/offline check to avoid redundant SCI interrupt.
    
    Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---
 hw/piix4acpi.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index fb905d1..3c52c4b 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -727,16 +727,24 @@ void i440fx_init_memory_mappings(PCIDevice *d) {
     /* our implementation doesn't need this */
 }
 
-static void enable_processor(GPEState *g, int cpu)
+static int enable_processor(GPEState *g, int cpu)
 {
+    if (g->cpus_sts[cpu/8] & (1 << (cpu%8)))
+        return 0;
+
     g->gpe0_sts[0] |= 4;
     g->cpus_sts[cpu/8] |= (1 << (cpu%8));
+    return 1;
 }
 
-static void disable_processor(GPEState *g, int cpu)
+static int disable_processor(GPEState *g, int cpu)
 {
+    if (!(g->cpus_sts[cpu/8] & (1 << (cpu%8))))
+        return 0;
+
     g->gpe0_sts[0] |= 4;
     g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
+    return 1;
 }
 
 void qemu_cpu_add_remove(int cpu, int state)
@@ -746,10 +754,13 @@ void qemu_cpu_add_remove(int cpu, int state)
         return;
     }
 
-    if (state)
-        enable_processor(&gpe_state, cpu);
-    else
-        disable_processor(&gpe_state, cpu);
+    if (state) {
+        if (!enable_processor(&gpe_state, cpu))
+            return;
+    } else {
+        if (!disable_processor(&gpe_state, cpu))
+            return;
+    }
 
     if (gpe_state.gpe0_en[0] & 4) {
         qemu_set_irq(sci_irq, 1);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] Update vcpu hotplug logic, Ian Jackson <=