public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* SIGSEGV with -smp 17+, and error handling around...
@ 2010-03-17 20:12 Michael Tokarev
  2010-03-24 12:11 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2010-03-17 20:12 UTC (permalink / raw)
  To: KVM list

When run with -smp 17 or greather, kvm
fails like this:

$ kvm -smp 17
kvm_create_vcpu: Invalid argument
kvm_setup_mce FAILED: Invalid argument
KVM_SET_LAPIC failed
Segmentation fault
$ _

In qemu-kvm.c, the kvm_create_vcpu() routine
(which is used in a vcpu thread to set up
vcpu) is declared as void, i.e, no error
return.  And the code that calls it blindly
assumes that it will never fail...

But the first error message above is from kernel,
which - apparently - refuses to create 17th vCPU.
Hence we've a vcpu thread which is empty/dummy and
not even fully initialized... so it fails later
in the game.

This all looks quite... raw, not polished ;)

Can we somehow handle the (several possible) errors
in that (and other) places, and how we ever can act
on them?  Abort?  Warn the user and reduce the number
of vcpus accordingly (seems wrong, esp. if it were
some first vcpus or in the middle which failed)...

Thanks!

/mjt

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

* Re: SIGSEGV with -smp 17+, and error handling around...
  2010-03-17 20:12 SIGSEGV with -smp 17+, and error handling around Michael Tokarev
@ 2010-03-24 12:11 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-03-24 12:11 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: KVM list

On 03/17/2010 10:12 PM, Michael Tokarev wrote:
> When run with -smp 17 or greather, kvm
> fails like this:
>
> $ kvm -smp 17
> kvm_create_vcpu: Invalid argument
> kvm_setup_mce FAILED: Invalid argument
> KVM_SET_LAPIC failed
> Segmentation fault
> $ _
>
> In qemu-kvm.c, the kvm_create_vcpu() routine
> (which is used in a vcpu thread to set up
> vcpu) is declared as void, i.e, no error
> return.  And the code that calls it blindly
> assumes that it will never fail...
>
> But the first error message above is from kernel,
> which - apparently - refuses to create 17th vCPU.
> Hence we've a vcpu thread which is empty/dummy and
> not even fully initialized... so it fails later
> in the game.
>
> This all looks quite... raw, not polished ;)
>
> Can we somehow handle the (several possible) errors
> in that (and other) places, and how we ever can act
> on them?  Abort?  Warn the user and reduce the number
> of vcpus accordingly (seems wrong, esp. if it were
> some first vcpus or in the middle which failed)...
>    

A patch from Alex fixing this was just committed.  I'll apply it to the 
stable branch as well.

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


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

end of thread, other threads:[~2010-03-24 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 20:12 SIGSEGV with -smp 17+, and error handling around Michael Tokarev
2010-03-24 12:11 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox