From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1FjZgU-0002u6-Ft for User-mode-linux-devel@lists.sourceforge.net; Fri, 26 May 2006 03:36:46 -0700 Received: from ns.suse.de ([195.135.220.2] helo=mx1.suse.de) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1FjZgT-0005un-7r for User-mode-linux-devel@lists.sourceforge.net; Fri, 26 May 2006 03:36:46 -0700 From: Andi Kleen References: <20060526032424.GA8283@ccure.user-mode-linux.org> In-Reply-To: <20060526032424.GA8283@ccure.user-mode-linux.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605261236.26814.ak@suse.de> Subject: [uml-devel] Re: [discuss] [RFC] [PATCH] Double syscall exit traces on x86_64 Sender: user-mode-linux-devel-admin@lists.sourceforge.net Errors-To: user-mode-linux-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: The user-mode Linux development list List-Post: List-Help: List-Subscribe: , List-Archive: Date: Fri, 26 May 2006 12:36:26 +0200 To: discuss@x86-64.org Cc: Jeff Dike , linux-kernel@vger.kernel.org, User-mode-linux-devel@lists.sourceforge.net, Steven James , Roland McGrath , Blaisorblade On Friday 26 May 2006 05:24, Jeff Dike wrote: > We are seeing double ptrace notifications of system call returns on recent > x86_64 kernels. This breaks UML and at least one other app. I believe this patch is the correct fix. Can you confirm it works for you? -Andi Don't do syscall exit tracing twice int_ret_from_syscall already does syscall exit tracing, so no need to do it again in the caller. This caused problems for UML and some other special programs doing syscall interception. Signed-off-by: Andi Kleen Index: linux/arch/x86_64/kernel/entry.S =================================================================== --- linux.orig/arch/x86_64/kernel/entry.S +++ linux/arch/x86_64/kernel/entry.S @@ -282,12 +282,7 @@ tracesys: ja 1f movq %r10,%rcx /* fixup for C */ call *sys_call_table(,%rax,8) - movq %rax,RAX-ARGOFFSET(%rsp) -1: SAVE_REST - movq %rsp,%rdi - call syscall_trace_leave - RESTORE_TOP_OF_STACK %rbx - RESTORE_REST +1: movq %rax,RAX-ARGOFFSET(%rsp) /* Use IRET because user could have changed frame */ jmp int_ret_from_sys_call CFI_ENDPROC ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751381AbWEZKgl (ORCPT ); Fri, 26 May 2006 06:36:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751383AbWEZKgl (ORCPT ); Fri, 26 May 2006 06:36:41 -0400 Received: from mail.suse.de ([195.135.220.2]:50404 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1751381AbWEZKgk (ORCPT ); Fri, 26 May 2006 06:36:40 -0400 From: Andi Kleen To: discuss@x86-64.org Subject: Re: [discuss] [RFC] [PATCH] Double syscall exit traces on x86_64 Date: Fri, 26 May 2006 12:36:26 +0200 User-Agent: KMail/1.9.1 Cc: Jeff Dike , linux-kernel@vger.kernel.org, User-mode-linux-devel@lists.sourceforge.net, Steven James , Roland McGrath , Blaisorblade References: <20060526032424.GA8283@ccure.user-mode-linux.org> In-Reply-To: <20060526032424.GA8283@ccure.user-mode-linux.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605261236.26814.ak@suse.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Friday 26 May 2006 05:24, Jeff Dike wrote: > We are seeing double ptrace notifications of system call returns on recent > x86_64 kernels. This breaks UML and at least one other app. I believe this patch is the correct fix. Can you confirm it works for you? -Andi Don't do syscall exit tracing twice int_ret_from_syscall already does syscall exit tracing, so no need to do it again in the caller. This caused problems for UML and some other special programs doing syscall interception. Signed-off-by: Andi Kleen Index: linux/arch/x86_64/kernel/entry.S =================================================================== --- linux.orig/arch/x86_64/kernel/entry.S +++ linux/arch/x86_64/kernel/entry.S @@ -282,12 +282,7 @@ tracesys: ja 1f movq %r10,%rcx /* fixup for C */ call *sys_call_table(,%rax,8) - movq %rax,RAX-ARGOFFSET(%rsp) -1: SAVE_REST - movq %rsp,%rdi - call syscall_trace_leave - RESTORE_TOP_OF_STACK %rbx - RESTORE_REST +1: movq %rax,RAX-ARGOFFSET(%rsp) /* Use IRET because user could have changed frame */ jmp int_ret_from_sys_call CFI_ENDPROC