Re: KVM overflows the stack

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Wednesday, July 16, 2008 - 10:52 pm

Dave Hansen wrote:

Yes!   It's obvious, once you know it...


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:

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.

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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kvm causing memory corruption? ~2.6.25-rc6, Dave Hansen, (Tue Mar 25, 2:12 pm)
Re: kvm causing memory corruption? now 2.6.26-rc4, Dave Hansen, (Mon Jun 2, 3:30 pm)
Re: kvm causing memory corruption? now 2.6.26-rc4, Dave Hansen, (Mon Jun 2, 5:59 pm)
Re: kvm causing memory corruption? now 2.6.26-rc4, Avi Kivity, (Wed Jun 4, 6:42 am)
Re: kvm causing memory corruption? now 2.6.26-rc4, Dave Hansen, (Fri Jun 6, 12:41 am)
Re: kvm causing memory corruption? now 2.6.26-rc4, Avi Kivity, (Thu Jun 12, 6:10 am)
Re: kvm causing memory corruption? now 2.6.26-rc4, Dave Hansen, (Mon Jun 16, 11:07 am)
Re: kvm causing memory corruption? now 2.6.26-rc8, Dave Hansen, (Tue Jul 15, 11:57 am)
Re: kvm causing memory corruption? now 2.6.26, Dave Hansen, (Wed Jul 16, 2:44 pm)
KVM overflows the stack, Dave Hansen, (Wed Jul 16, 3:48 pm)
Re: kvm causing memory corruption? now 2.6.26, Avi Kivity, (Wed Jul 16, 10:38 pm)
Re: KVM overflows the stack, Avi Kivity, (Wed Jul 16, 10:52 pm)
Re: KVM overflows the stack, Roland Dreier, (Wed Jul 16, 11:08 pm)
Re: KVM overflows the stack, Dave Hansen, (Wed Jul 16, 11:14 pm)
Re: KVM overflows the stack, Dave Hansen, (Wed Jul 16, 11:27 pm)
Re: KVM overflows the stack, Avi Kivity, (Wed Jul 16, 11:42 pm)
[PATCH] update kvm's anon_inodes.c for r/o bind mounts, Dave Hansen, (Wed Jul 16, 11:45 pm)
Re: KVM overflows the stack, Dave Hansen, (Thu Jul 17, 7:06 am)
Re: KVM overflows the stack, Avi Kivity, (Thu Jul 17, 7:15 am)