+ kvm-breaks-cpu-hotplug.patch added to -mm tree

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

 



The patch titled
     KVM breaks CPU hotplug
has been added to the -mm tree.  Its filename is
     kvm-breaks-cpu-hotplug.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: KVM breaks CPU hotplug
From: Shaohua Li <shaohua.li@xxxxxxxxx>

When testing CPU hotplug, I found cpu can't be onlined with kvm enabled
sometimes.  The reason is smp_call_function_single is a nop if the thread
is running on the target cpu.  I think CPU_ONLINE case doesn't require the
fix as the online CPU isn't plugged into sheduler yet.

Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
Cc: Avi Kivity <avi@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/kvm/kvm_main.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff -puN drivers/kvm/kvm_main.c~kvm-breaks-cpu-hotplug drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c~kvm-breaks-cpu-hotplug
+++ a/drivers/kvm/kvm_main.c
@@ -2782,6 +2782,7 @@ static int kvm_cpu_hotplug(struct notifi
 			   void *v)
 {
 	int cpu = (long)v;
+	int this_cpu;
 
 	switch (val) {
 	case CPU_DOWN_PREPARE:
@@ -2789,8 +2790,13 @@ static int kvm_cpu_hotplug(struct notifi
 		printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n",
 		       cpu);
 		decache_vcpus_on_cpu(cpu);
-		smp_call_function_single(cpu, kvm_arch_ops->hardware_disable,
-					 NULL, 0, 1);
+		this_cpu = get_cpu();
+		if (this_cpu == cpu)
+			kvm_arch_ops->hardware_disable(NULL);
+		else
+			smp_call_function_single(cpu,
+				kvm_arch_ops->hardware_disable,  NULL, 0, 1);
+		put_cpu();
 		break;
 	case CPU_ONLINE:
 		printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n",
_

Patches currently in -mm which might be from shaohua.li@xxxxxxxxx are

git-acpi.patch
kvm-breaks-cpu-hotplug.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux