diff options
author | Dave Hansen <dave@linux.vnet.ibm.com> | 2008-08-11 10:01:45 -0700 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 10:15:18 +0200 |
commit | f0d662759a2465babdba1160749c446648c9d159 (patch) | |
tree | d98d36f37df91bab55e2cb74cd5647fbf2bfb13e /virt | |
parent | 4d5c5d0fe89c921336b95f5e7e4f529a9df92f53 (diff) | |
download | linux-f0d662759a2465babdba1160749c446648c9d159.tar.bz2 |
KVM: Reduce kvm stack usage in kvm_arch_vm_ioctl()
On my machine with gcc 3.4, kvm uses ~2k of stack in a few
select functions. This is mostly because gcc fails to
notice that the different case: statements could have their
stack usage combined. It overflows very nicely if interrupts
happen during one of these large uses.
This patch uses two methods for reducing stack usage.
1. dynamically allocate large objects instead of putting
on the stack.
2. Use a union{} member for all of the case variables. This
tricks gcc into combining them all into a single stack
allocation. (There's also a comment on this)
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions