All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug for vcpu hotplug
@ 2010-08-06  3:36 Liu, Jinsong
  2010-08-15 12:06 ` Avi Kivity
  0 siblings, 1 reply; 9+ messages in thread
From: Liu, Jinsong @ 2010-08-06  3:36 UTC (permalink / raw)
  To: kvm, seabios
  Cc: Avi Kivity, Kevin O'Connor, Jiang, Yunhong, Li, Xin, Zheng,
	Shaohui, You, Yongkang

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Recently seabios implement vcpu hotplug infrastructure.
During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
This patch is to fix the bug, mark bus->allow_hotplug as 1 after qdev_hotplug init done.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

[-- Attachment #2: fix-vcpu-hotplug.patch --]
[-- Type: application/octet-stream, Size: 1137 bytes --]

From 5a126af98bf6d109490756c739b584a2a2e5b475 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Fri, 6 Aug 2010 11:05:54 +0800
Subject: [PATCH] Fix bug for vcpu hotplug

Recently seabios implement vcpu hotplug infrastructure.
During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
This patch is to fix the bug, mark bus->allow_hotplug as 1 after qdev_hotplug init done.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 hw/qdev.c        |    3 +++
 pc-bios/bios.bin |  Bin 131072 -> 131072 bytes
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..c60c8f7 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -117,6 +117,9 @@ DeviceState *qdev_create(BusState *bus, const char *name)
         hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);
     }
 
+    if (qdev_hotplug)
+        bus->allow_hotplug = 1;
+
     return qdev_create_from_info(bus, info);
 }
 
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d0d4b6a..f6b094b 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
-- 
1.6.5.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix bug for vcpu hotplug
  2010-08-06  3:36 [PATCH] Fix bug for vcpu hotplug Liu, Jinsong
@ 2010-08-15 12:06 ` Avi Kivity
  2010-08-18  7:17     ` [Qemu-devel] " Liu, Jinsong
  0 siblings, 1 reply; 9+ messages in thread
From: Avi Kivity @ 2010-08-15 12:06 UTC (permalink / raw)
  To: Liu, Jinsong
  Cc: kvm, seabios, Kevin O'Connor, Jiang, Yunhong, Li, Xin, Zheng,
	Shaohui, You, Yongkang

  On 08/06/2010 06:36 AM, Liu, Jinsong wrote:
> Recently seabios implement vcpu hotplug infrastructure.
> During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
> This patch is to fix the bug, mark bus->allow_hotplug as 1 after qdev_hotplug init done.

Please copy qemu-devel on qemu patches.

> @@ -117,6 +117,9 @@ DeviceState *qdev_create(BusState *bus, const char *name)
>           hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);
>       }
>
> +    if (qdev_hotplug)
> +        bus->allow_hotplug = 1;
> +
>       return qdev_create_from_info(bus, info);
>   }

Doesn't seem right - this will set allow_hotplug on all busses.

It needs to be set only on the system bus (hw/sysbus.c).

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] Fix bug for vcpu hotplug
  2010-08-15 12:06 ` Avi Kivity
@ 2010-08-18  7:17     ` Liu, Jinsong
  0 siblings, 0 replies; 9+ messages in thread
From: Liu, Jinsong @ 2010-08-18  7:17 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, qemu-devel, Jiang, Yunhong, Yang, Sheng, Li, Xin

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

Avi Kivity wrote:
>   On 08/06/2010 06:36 AM, Liu, Jinsong wrote:
>> Recently seabios implement vcpu hotplug infrastructure.
>> During test, we found qemu-kvm has a bug result in guestos shutdown
>> when vcpu hotadd. This patch is to fix the bug, mark
>> bus->allow_hotplug as 1 after qdev_hotplug init done. 
> 
> Please copy qemu-devel on qemu patches.
> 
>> @@ -117,6 +117,9 @@ DeviceState *qdev_create(BusState *bus, const
>>           char *name) hw_error("Unknown device '%s' for bus '%s'\n",
>> name, bus->info->name);       } 
>> 
>> +    if (qdev_hotplug)
>> +        bus->allow_hotplug = 1;
>> +
>>       return qdev_create_from_info(bus, info);
>>   }
> 
> Doesn't seem right - this will set allow_hotplug on all busses.
> 
> It needs to be set only on the system bus (hw/sysbus.c).


Thanks Avi for comments!
We update the patch to fix the bug in a simple way, your opinion?


Thanks,
Jinsong

[-- Attachment #2: fix-vcpu-hotplug.patch --]
[-- Type: application/octet-stream, Size: 1178 bytes --]

From 1e680bc92e31321795dd0b69f579df927bb9da4a Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 18 Aug 2010 14:18:56 +0800
Subject: [PATCH] Fix bug for vcpu hotplug

Recently seabios implement vcpu hotplug infrastructure.
During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
This patch is to fix the bug, allow hotplug for sysbus qdev.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 hw/qdev.c        |    1 +
 pc-bios/bios.bin |  Bin 131072 -> 131072 bytes
 2 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..66a5f82 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
     if (!bus) {
         if (!main_system_bus) {
             main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus");
+            main_system_bus->allow_hotplug = 1;
         }
         bus = main_system_bus;
     }
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d0d4b6a..e98f96c 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
-- 
1.6.5.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] RE: [PATCH] Fix bug for vcpu hotplug
@ 2010-08-18  7:17     ` Liu, Jinsong
  0 siblings, 0 replies; 9+ messages in thread
From: Liu, Jinsong @ 2010-08-18  7:17 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Yang, Sheng, qemu-devel, kvm, Li, Xin

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

Avi Kivity wrote:
>   On 08/06/2010 06:36 AM, Liu, Jinsong wrote:
>> Recently seabios implement vcpu hotplug infrastructure.
>> During test, we found qemu-kvm has a bug result in guestos shutdown
>> when vcpu hotadd. This patch is to fix the bug, mark
>> bus->allow_hotplug as 1 after qdev_hotplug init done. 
> 
> Please copy qemu-devel on qemu patches.
> 
>> @@ -117,6 +117,9 @@ DeviceState *qdev_create(BusState *bus, const
>>           char *name) hw_error("Unknown device '%s' for bus '%s'\n",
>> name, bus->info->name);       } 
>> 
>> +    if (qdev_hotplug)
>> +        bus->allow_hotplug = 1;
>> +
>>       return qdev_create_from_info(bus, info);
>>   }
> 
> Doesn't seem right - this will set allow_hotplug on all busses.
> 
> It needs to be set only on the system bus (hw/sysbus.c).


Thanks Avi for comments!
We update the patch to fix the bug in a simple way, your opinion?


Thanks,
Jinsong

[-- Attachment #2: fix-vcpu-hotplug.patch --]
[-- Type: application/octet-stream, Size: 1178 bytes --]

From 1e680bc92e31321795dd0b69f579df927bb9da4a Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Wed, 18 Aug 2010 14:18:56 +0800
Subject: [PATCH] Fix bug for vcpu hotplug

Recently seabios implement vcpu hotplug infrastructure.
During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
This patch is to fix the bug, allow hotplug for sysbus qdev.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 hw/qdev.c        |    1 +
 pc-bios/bios.bin |  Bin 131072 -> 131072 bytes
 2 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..66a5f82 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
     if (!bus) {
         if (!main_system_bus) {
             main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus");
+            main_system_bus->allow_hotplug = 1;
         }
         bus = main_system_bus;
     }
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d0d4b6a..e98f96c 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
-- 
1.6.5.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix bug for vcpu hotplug
  2010-08-18  7:17     ` [Qemu-devel] " Liu, Jinsong
@ 2010-08-18  7:33       ` Avi Kivity
  -1 siblings, 0 replies; 9+ messages in thread
From: Avi Kivity @ 2010-08-18  7:33 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: kvm, qemu-devel, Jiang, Yunhong, Yang, Sheng, Li, Xin

  On 08/18/2010 10:17 AM, Liu, Jinsong wrote:
> During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
> This patch is to fix the bug, allow hotplug for sysbus qdev.
>
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
>       if (!bus) {
>           if (!main_system_bus) {
>               main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus");
> +            main_system_bus->allow_hotplug = 1;
>           }
>           bus = main_system_bus;
>       }


Looks reasonable to me.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
@ 2010-08-18  7:33       ` Avi Kivity
  0 siblings, 0 replies; 9+ messages in thread
From: Avi Kivity @ 2010-08-18  7:33 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Yang, Sheng, qemu-devel, kvm, Li, Xin

  On 08/18/2010 10:17 AM, Liu, Jinsong wrote:
> During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
> This patch is to fix the bug, allow hotplug for sysbus qdev.
>
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
>       if (!bus) {
>           if (!main_system_bus) {
>               main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus");
> +            main_system_bus->allow_hotplug = 1;
>           }
>           bus = main_system_bus;
>       }


Looks reasonable to me.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
  2010-08-18  7:33       ` [Qemu-devel] " Avi Kivity
  (?)
@ 2010-08-19 15:24       ` Anthony Liguori
  2010-08-19 15:34         ` Avi Kivity
  -1 siblings, 1 reply; 9+ messages in thread
From: Anthony Liguori @ 2010-08-19 15:24 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Liu, Jinsong, Yang, Sheng, qemu-devel, kvm, Li, Xin

On 08/18/2010 02:33 AM, Avi Kivity wrote:
>  On 08/18/2010 10:17 AM, Liu, Jinsong wrote:
>> During test, we found qemu-kvm has a bug result in guestos shutdown 
>> when vcpu hotadd.
>> This patch is to fix the bug, allow hotplug for sysbus qdev.
>>
>> --- a/hw/qdev.c
>> +++ b/hw/qdev.c
>> @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const 
>> char *name)
>>       if (!bus) {
>>           if (!main_system_bus) {
>>               main_system_bus = qbus_create(&system_bus_info, NULL, 
>> "main-system-bus");
>> +            main_system_bus->allow_hotplug = 1;
>>           }
>>           bus = main_system_bus;
>>       }
>
>
> Looks reasonable to me.

Not really to me.

SysBus does not support hotplugging and CPU hot plug shouldn't have 
anything to do with qdev hotplug.

Can you explain a bit more why this is needed?

Regards,

Anthony Liguori



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
  2010-08-19 15:24       ` Anthony Liguori
@ 2010-08-19 15:34         ` Avi Kivity
  2010-08-19 19:04           ` Anthony Liguori
  0 siblings, 1 reply; 9+ messages in thread
From: Avi Kivity @ 2010-08-19 15:34 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Liu, Jinsong, Yang, Sheng, qemu-devel, kvm, Li, Xin

  On 08/19/2010 06:24 PM, Anthony Liguori wrote:
> On 08/18/2010 02:33 AM, Avi Kivity wrote:
>>  On 08/18/2010 10:17 AM, Liu, Jinsong wrote:
>>> During test, we found qemu-kvm has a bug result in guestos shutdown 
>>> when vcpu hotadd.
>>> This patch is to fix the bug, allow hotplug for sysbus qdev.
>>>
>>> --- a/hw/qdev.c
>>> +++ b/hw/qdev.c
>>> @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const 
>>> char *name)
>>>       if (!bus) {
>>>           if (!main_system_bus) {
>>>               main_system_bus = qbus_create(&system_bus_info, NULL, 
>>> "main-system-bus");
>>> +            main_system_bus->allow_hotplug = 1;
>>>           }
>>>           bus = main_system_bus;
>>>       }
>>
>>
>> Looks reasonable to me.
>
> Not really to me.
>
> SysBus does not support hotplugging and CPU hot plug shouldn't have 
> anything to do with qdev hotplug.
>
> Can you explain a bit more why this is needed?
>

On cpu hotplug an apic is added, and apics live on main_system_bus.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
  2010-08-19 15:34         ` Avi Kivity
@ 2010-08-19 19:04           ` Anthony Liguori
  0 siblings, 0 replies; 9+ messages in thread
From: Anthony Liguori @ 2010-08-19 19:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Liu, Jinsong, Yang, Sheng, qemu-devel, kvm, Li, Xin

On 08/19/2010 10:34 AM, Avi Kivity wrote:
>  On 08/19/2010 06:24 PM, Anthony Liguori wrote:
>> On 08/18/2010 02:33 AM, Avi Kivity wrote:
>>>  On 08/18/2010 10:17 AM, Liu, Jinsong wrote:
>>>> During test, we found qemu-kvm has a bug result in guestos shutdown 
>>>> when vcpu hotadd.
>>>> This patch is to fix the bug, allow hotplug for sysbus qdev.
>>>>
>>>> --- a/hw/qdev.c
>>>> +++ b/hw/qdev.c
>>>> @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const 
>>>> char *name)
>>>>       if (!bus) {
>>>>           if (!main_system_bus) {
>>>>               main_system_bus = qbus_create(&system_bus_info, NULL, 
>>>> "main-system-bus");
>>>> +            main_system_bus->allow_hotplug = 1;
>>>>           }
>>>>           bus = main_system_bus;
>>>>       }
>>>
>>>
>>> Looks reasonable to me.
>>
>> Not really to me.
>>
>> SysBus does not support hotplugging and CPU hot plug shouldn't have 
>> anything to do with qdev hotplug.
>>
>> Can you explain a bit more why this is needed?
>>
>
> On cpu hotplug an apic is added, and apics live on main_system_bus.

That's the problem then.  An APIC does not live on any bus and that's 
where the problem ought to be fixed.

Regards,

Anthony Liguori



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-19 19:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06  3:36 [PATCH] Fix bug for vcpu hotplug Liu, Jinsong
2010-08-15 12:06 ` Avi Kivity
2010-08-18  7:17   ` Liu, Jinsong
2010-08-18  7:17     ` [Qemu-devel] " Liu, Jinsong
2010-08-18  7:33     ` Avi Kivity
2010-08-18  7:33       ` [Qemu-devel] " Avi Kivity
2010-08-19 15:24       ` Anthony Liguori
2010-08-19 15:34         ` Avi Kivity
2010-08-19 19:04           ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.