Received: from eggs.gnu.org ([2001:4830:134:3::10]:54272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6P6D-0004PQ-H2 for qemu-devel@nongnu.org; Fri, 27 May 2016 17:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6P69-0002WJ-BW for qemu-devel@nongnu.org; Fri, 27 May 2016 17:15:16 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:35659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6P69-0002WF-5X for qemu-devel@nongnu.org; Fri, 27 May 2016 17:15:13 -0400 Received: by mail-qg0-x231.google.com with SMTP id e93so56333434qgf.2 for ; Fri, 27 May 2016 14:15:13 -0700 (PDT) Sender: Richard Henderson References: <1464361598-30776-1-git-send-email-peter.maydell@linaro.org> <2601a20d-de08-1852-7058-cb6ec4885c68@twiddle.net> From: Richard Henderson Message-ID: Date: Fri, 27 May 2016 14:15:07 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: provide frame information in x86-64 safe_syscall List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Patch Tracking , Riku Voipio On 05/27/2016 09:34 AM, Peter Maydell wrote: > On 27 May 2016 at 17:21, Richard Henderson wrote: >> On 05/27/2016 08:06 AM, Peter Maydell wrote: >>> >>> @@ -31,6 +32,8 @@ safe_syscall_base: >>> * does not list any ABI differences regarding stack alignment.) >>> */ >>> push %rbp >>> + .cfi_def_cfa_offset 16 >>> + .cfi_offset rbp,-16 >> >> >> While this is correct, there are two other directives that make it easier to >> describe changes without having to compute globally correct constants. Here >> they would be: >> >> .cfi_adjust_cfa_offset 8 >> >> Add 8 to the offset, i.e. decrement the SP by 8. > > Presumably .cfi_startproc sets the initial offset to 8? > (It's not documented that it does so, which is I think partly why > I preferred to use a directive that definitely set the offset > to the right thing.) It is documented to set up the normal no-instructions-executed call frame. Which in the case of x86, does have a non-zero offset. There is a ".cfi_startproc simple" that begins a frame with no opcodes at all. r~