Re: KVM overflows the stack

From: Dave Hansen
Date: Thu Jul 17 2008 - 02:15:32 EST


On Thu, 2008-07-17 at 08:52 +0300, Avi Kivity wrote:
> Dave Hansen wrote:
> > Avi, how would you like this fixed? I'd be happy to prepare some
> > patches. Do you have a particular approach that you think we should
> > use? Just make the big objects dynamically allocated?
> >
>
> Yes, things like kvm_lapic_state are way too big to be on the stack.
> There's an additional problem here, that apparently your gcc (which
> version?) doesn't fold objects in a switch statement into the same stack
> slot:

$ gcc -v
gcc version 3.4.6 (Ubuntu 3.4.6-6ubuntu5)

> switch (...) {
> case x: {
> struct medium a;
> ...
> }
> case y:
> struct medium b;
> ...
> }
> };
>
> These could be solved either by stack allocation, or by moving into
> functions marked noinline. Whichever is easier.

Did you mean dynamic allocation? :)

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/