All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] i386/kvm: QEMU crash when doing 'info cpus' after CPU hotplug
@ 2017-10-09 17:19 Greg Kurz
  2017-10-10 12:40 ` Igor Mammedov
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2017-10-09 17:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Eduardo Habkost, Igor Mammedov

Hi x86 folks,

While trying to reproduce on x86 an issue we're currently hitting on ppc,
I got this:

$ ./x86_64-softmmu/qemu-system-x86_64 -snapshot -no-shutdown -nographic -machine q35,accel=kvm -smp 1,maxcpus=2 -serial mon:stdio -drive file=$HOME/images/fedora26-x86_64.qcow2,if=virtio
QEMU 2.10.50 monitor - type 'help' for more information
(qemu) device_add host-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=foo
(qemu) info cpus
error: failed to get MSR 0x38d
qemu-system-x86_64: /home/greg/Work/qemu/qemu-devel/target/i386/kvm.c:2121: kvm_get_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Aborted (core dumped)

Same happens with a pc machine.

But it doesn't happen if I use cpu-add instead of device_add:

(qemu) cpu-add 1
(qemu) [    8.335221] CPU1 has been hot-added
(qemu) info cpus
* CPU #0: pc=0xffffffffb08986e6 (halted) thread_id=23964
  CPU #1: pc=0x00000000fffffff0 thread_id=24001

This is with the QEMU master branch SHA1 530049bc1dcc24c.

Cheers,

--
Greg

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

* Re: [Qemu-devel] i386/kvm: QEMU crash when doing 'info cpus' after CPU hotplug
  2017-10-09 17:19 [Qemu-devel] i386/kvm: QEMU crash when doing 'info cpus' after CPU hotplug Greg Kurz
@ 2017-10-10 12:40 ` Igor Mammedov
  2017-10-10 15:39   ` Greg Kurz
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Mammedov @ 2017-10-10 12:40 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-devel, Paolo Bonzini, Eduardo Habkost

On Mon, 9 Oct 2017 19:19:15 +0200
Greg Kurz <groug@kaod.org> wrote:

> Hi x86 folks,
> 
> While trying to reproduce on x86 an issue we're currently hitting on ppc,
> I got this:
> 
> $ ./x86_64-softmmu/qemu-system-x86_64 -snapshot -no-shutdown -nographic -machine q35,accel=kvm -smp 1,maxcpus=2 -serial mon:stdio -drive file=$HOME/images/fedora26-x86_64.qcow2,if=virtio
> QEMU 2.10.50 monitor - type 'help' for more information
> (qemu) device_add host-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=foo
cpu type here doesn't match currently in use one,
I've just sent patch that adds check

valid cpu type and other mandatory for hotplug properties
one could find out with HMP command:
  info hotpluggable-cpus
or its QMP equivalent

> (qemu) info cpus
> error: failed to get MSR 0x38d
> qemu-system-x86_64: /home/greg/Work/qemu/qemu-devel/target/i386/kvm.c:2121: kvm_get_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
> Aborted (core dumped)
> 
> Same happens with a pc machine.
> 
> But it doesn't happen if I use cpu-add instead of device_add:
> 
> (qemu) cpu-add 1
that one works because of it plugs the same cpu type

PS:
we probably should obsolete cpu-add in couple releases as the last user (s390)
just gained support for device_add cpu, so it won't confuse people.

> (qemu) [    8.335221] CPU1 has been hot-added
> (qemu) info cpus
> * CPU #0: pc=0xffffffffb08986e6 (halted) thread_id=23964
>   CPU #1: pc=0x00000000fffffff0 thread_id=24001
> 
> This is with the QEMU master branch SHA1 530049bc1dcc24c.
> 
> Cheers,
> 
> --
> Greg
> 

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

* Re: [Qemu-devel] i386/kvm: QEMU crash when doing 'info cpus' after CPU hotplug
  2017-10-10 12:40 ` Igor Mammedov
@ 2017-10-10 15:39   ` Greg Kurz
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2017-10-10 15:39 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: qemu-devel, Paolo Bonzini, Eduardo Habkost

On Tue, 10 Oct 2017 14:40:58 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> On Mon, 9 Oct 2017 19:19:15 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
> > Hi x86 folks,
> > 
> > While trying to reproduce on x86 an issue we're currently hitting on ppc,
> > I got this:
> > 
> > $ ./x86_64-softmmu/qemu-system-x86_64 -snapshot -no-shutdown -nographic -machine q35,accel=kvm -smp 1,maxcpus=2 -serial mon:stdio -drive file=$HOME/images/fedora26-x86_64.qcow2,if=virtio
> > QEMU 2.10.50 monitor - type 'help' for more information
> > (qemu) device_add host-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=foo  
> cpu type here doesn't match currently in use one,

Oh, I didn't realize that...

> I've just sent patch that adds check
> 

I'll test it ASAP.

> valid cpu type and other mandatory for hotplug properties
> one could find out with HMP command:
>   info hotpluggable-cpus
> or its QMP equivalent
> 

Sure, I'll do that to see if I hit the issue I was initially trying to
reproduce.

> > (qemu) info cpus
> > error: failed to get MSR 0x38d
> > qemu-system-x86_64: /home/greg/Work/qemu/qemu-devel/target/i386/kvm.c:2121: kvm_get_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
> > Aborted (core dumped)
> > 
> > Same happens with a pc machine.
> > 
> > But it doesn't happen if I use cpu-add instead of device_add:
> > 
> > (qemu) cpu-add 1  
> that one works because of it plugs the same cpu type
> 
> PS:
> we probably should obsolete cpu-add in couple releases as the last user (s390)
> just gained support for device_add cpu, so it won't confuse people.
> 

Good idea indeed.

Thanks for the clarification.

> > (qemu) [    8.335221] CPU1 has been hot-added
> > (qemu) info cpus
> > * CPU #0: pc=0xffffffffb08986e6 (halted) thread_id=23964
> >   CPU #1: pc=0x00000000fffffff0 thread_id=24001
> > 
> > This is with the QEMU master branch SHA1 530049bc1dcc24c.
> > 
> > Cheers,
> > 
> > --
> > Greg
> >   
> 

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

end of thread, other threads:[~2017-10-10 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 17:19 [Qemu-devel] i386/kvm: QEMU crash when doing 'info cpus' after CPU hotplug Greg Kurz
2017-10-10 12:40 ` Igor Mammedov
2017-10-10 15:39   ` Greg Kurz

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.