From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [Fwd: stack overflow "cause" found] Date: Wed, 26 Jul 2006 16:49:21 -0400 Message-ID: <44C7D551.3030601@redhat.com> References: <44C7C789.1030707@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <44C7C789.1030707@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Rik van Riel wrote: > Xen really should not be doing this. We could either uninline some of > these functions, or try gcc -O2 or gcc -Os. OK, with -Os it doesn't quite build due to the built-ins not being inlined. With -O2 the stack usage changes dramatically... > Currently the top stack users are: > > $ objdump -dS xen-syms | ./checkstack.pl x86_64 > 0xffff8300001c7c47 find_unisys_acpi_oem_table: 1296 > 0xffff83000011182e do_xen_version: 1280 > 0xffff83000015bc3e x86_emulate_memop: 1264 > 0xffff8300001adbaa vmx_world_save: 1040 > 0xffff8300001aeac5 vmx_world_save: 1040 > 0xffff8300001af923 vmx_assist: 224 The function vmx_world_save is inlined into vmx_assist with -O2, and the combined stack use is only 200 bytes, down from 1264 ! I guess we'll want to build Xen with -O2. I'm testing a -O2 built hypervisor right now... -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan