public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Vasilis Liaskovitis <vliaskov@gmail.com>,
	"seabios@seabios.org" <seabios@seabios.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"armbru@redhat.com" <armbru@redhat.com>
Subject: Re: [PATCH] cpu hotplug issue
Date: Wed, 03 Aug 2011 12:42:11 +0200	[thread overview]
Message-ID: <4E392603.5010102@siemens.com> (raw)
In-Reply-To: <20110803103847.GD4404@redhat.com>

On 2011-08-03 12:38, Gleb Natapov wrote:
> On Wed, Aug 03, 2011 at 12:37:13PM +0200, Jan Kiszka wrote:
>> On 2011-08-03 12:07, Vasilis Liaskovitis wrote:
>>> When rebooting after a CPU hotplug in qemu-kvm, Seabios can get stuck in smp_probe().
>>> Normally cmos_smp_count is read from cmos and the smp_ap_boot_code is run on all cpus 
>>> except bootstrap. The expected result is CountCPUs == cmos_smp_count + 1.  After a 
>>> cpu hotplug, more than cmos_smp_count cpus are active, so we get a situation where 
>>> CountCPUs > cmos_smp_count + 1 and Seabios keeps looping forever in smp_probe. In some
>>> cases, the while loop exit condition is tested before CountCPUs gets larger (i.e. 
>>> before smp_ap_boot_code runs on all CPUs), so the hang is not always reproducible.
>>>
>>> This patch introduces a new fw_cfg variable called hotplugged_cpus that gets updated from
>>> qemu-kvm hoplug code. Seabios reads this variable on each call to smp_probe() and adjusts
>>> the expected number of online CPUs.
>>>
>>> The qemu-kvm part of this patch is against Jan Kiszka's cpu-hotplug tree:
>>> git://git.kiszka.org/qemu-kvm.git queues/cpu-hotplug
>>> tested with qemu-system-x86_64.
>>>
>>> An alternative to this patch would be to update the smp_cpus variable in qemu-kvm and 
>>> do a "cmos update" to 0x5f from the cpu-hotplug code. Access to the rtc_state (cmos device) 
>>> would be required in hw/acpi_piix4.c.  This way no change to Seabios would be required.
>>>
>>
>> ...
>>
>>>  src/paravirt.c |   12 ++++++++++++
>>>  src/paravirt.h |    2 ++
>>>  src/smp.c      |    6 ++++--
>>>  3 files changed, 18 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/paravirt.c b/src/paravirt.c
>>> index 9cf77de..3367609 100644
>>> --- a/src/paravirt.c
>>> +++ b/src/paravirt.c
>>> @@ -305,6 +305,18 @@ u16 qemu_cfg_get_max_cpus(void)
>>>      return cnt;
>>>  }
>>>  
>>> +u16 qemu_cfg_get_hplug_cpus(void)
>>> +{
>>> +    u16 cnt;
>>> +
>>> +    if (!qemu_cfg_present)
>>> +        return 0;
>>> +
>>> +    qemu_cfg_read_entry(&cnt, QEMU_CFG_HPLUG_CPUS, sizeof(cnt));
>>
>> Why can't Seabios read to true number online CPUs from the PIIX4 device?
>> The information is there already, no need for addition PV here.
>>
> Where is it in PIIX4 device?

PROC registers (or however they are called).

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-08-03 10:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 17:40 cpu hotplug issue Vasilis Liaskovitis
2011-07-20  8:35 ` Gleb Natapov
2011-07-21 11:06   ` [PATCH] " Vasilis Liaskovitis
2011-07-21 11:33     ` Gleb Natapov
2011-07-21 11:42       ` Jan Kiszka
2011-07-21 11:51         ` Gleb Natapov
2011-07-21 11:55           ` Jan Kiszka
2011-07-21 12:00             ` Gleb Natapov
2011-07-21 12:18             ` Avi Kivity
2011-07-21 12:22               ` Gleb Natapov
2011-07-21 12:39               ` Jan Kiszka
2011-07-21 13:27               ` Lucas Meneghel Rodrigues
2011-07-21 12:45           ` Gleb Natapov
2011-07-22 10:56             ` Jan Kiszka
2011-07-24 11:56               ` Gleb Natapov
2011-07-24 16:11                 ` Jan Kiszka
2011-07-25 13:18                   ` Jan Kiszka
2011-07-25 13:21                     ` Gleb Natapov
2011-07-25 13:26                       ` Jan Kiszka
2011-07-27 16:35                     ` Vasilis Liaskovitis
2011-07-28 16:52                       ` Jan Kiszka
2011-08-02  9:46                         ` Vasilis Liaskovitis
2011-08-02 10:24                           ` Jan Kiszka
2011-08-02 13:41                             ` Vasilis Liaskovitis
2011-08-03 10:07                               ` Vasilis Liaskovitis
2011-08-03 10:37                                 ` Jan Kiszka
2011-08-03 10:38                                   ` Gleb Natapov
2011-08-03 10:42                                     ` Jan Kiszka [this message]
2011-08-03 16:25                                       ` Vasilis Liaskovitis
2011-08-04  8:01                                         ` Gleb Natapov
2011-08-04  8:40                                           ` Jan Kiszka
2011-07-21 13:08       ` Vasilis Liaskovitis
2011-07-21 13:11         ` Gleb Natapov
2011-07-21 13:12           ` Vasilis Liaskovitis
2011-07-21 13:13             ` Gleb Natapov
2011-07-21 13:15         ` Avi Kivity
2011-07-21 13:15           ` Avi Kivity
2011-07-21 11:36     ` Jan Kiszka
2011-07-21 12:22     ` Jan Kiszka
2011-07-21 12:25       ` Gleb Natapov
2011-07-21 12:35         ` Jan Kiszka
2011-07-21 12:40           ` Gleb Natapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E392603.5010102@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=armbru@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=seabios@seabios.org \
    --cc=vliaskov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox