Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5378970yba; Wed, 8 May 2019 12:18:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/P6fh2ioUIumx/AuAG68cDNUnQPXhEevIvEzeejmdEQnc6gmypDWVrmr/LQ1UVKQDuQ2v X-Received: by 2002:a63:e711:: with SMTP id b17mr42736334pgi.202.1557343096395; Wed, 08 May 2019 12:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557343096; cv=none; d=google.com; s=arc-20160816; b=vy4+4bnOqsDt8B2rlfJ+Qxcr5BY7IF3E+H07m9m45sJuiSFYyv3ibVoAo44bouDKvA 91mDvD7jHECIJsHFa3bPiVMrS74p0g1ZOAKOIN7+VtfJzameHtOlhe5fDo6PY619FXl1 Q9QY2UEO805PCqNdnciPau3RBKeAfQswL0rohyPcL6OI1pVGfAvCFghz2qaeW2haxHKi Rf2CXIAE3dG4kCTqPvREQOLFifcHxMgQlwORJdo2BEixywPJ424Ehd4h+PJW67eBJ83x 1hjsdZIQFcpITphjB/h8k0pgGlqsacjrKU1tNeBCyYWa8eUAWxfBC8WUNXbRlOmmC4GH 13Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=j6fWJ4A9Uc09A5hdsUZUSr0dsTRAuCtBZFtmc0S31r8=; b=ginIOeoCuqEahKclCbAyVtxrgCjaHeJp8JVccuJUcXVl7cmsjy7UvQjIhR/3QJ6KWU X3m6Jx7DZYm1Q5Tj0JgjhB7nUOwcE/kdqYtZPIqOPnVF9IMIw9wyb09RlIy1u5M2I46O UT1reC9byKrb62JTL2lH9zudxAN59ZGUHf9sFiS/GB6aWu5w/iZ2fCNg8vmK1YAJx9qP nOn77L2R/HnusWFzyesDTqIIMorKkCtWwh74j624ubE3uX2wiclJssWICkAV0lT4wYxq NatA4mA8erDpsENMmBuH/4sAGAfGp/pvO7k/V0qymBPBPw6MuGZ0UO07QG3mc+Tjj9vk rD2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si984023pfq.237.2019.05.08.12.17.59; Wed, 08 May 2019 12:18:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727615AbfEHStB (ORCPT + 99 others); Wed, 8 May 2019 14:49:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbfEHStB (ORCPT ); Wed, 8 May 2019 14:49:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 535FA34CF; Wed, 8 May 2019 18:49:00 +0000 (UTC) Received: from treble (ovpn-123-166.rdu2.redhat.com [10.10.123.166]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C15166266F; Wed, 8 May 2019 18:48:50 +0000 (UTC) Date: Wed, 8 May 2019 13:48:48 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , linux-kselftest@vger.kernel.org, Masami Hiramatsu Subject: Re: [PATCH 2/4] x86/kprobes: Fix frame pointer annotations Message-ID: <20190508184848.qerg3flv3ej3xsev@treble> References: <20190508074901.982470324@infradead.org> <20190508080612.721269814@infradead.org> <20190508115416.nblx7c2kocidpytm@treble> <20190508120416.GL2589@hirez.programming.kicks-ass.net> <20190508124248.u5ukpbhnh4wpiccq@treble> <20190508153907.GM2589@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190508153907.GM2589@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 08 May 2019 18:49:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 05:39:07PM +0200, Peter Zijlstra wrote: > On Wed, May 08, 2019 at 07:42:48AM -0500, Josh Poimboeuf wrote: > > On Wed, May 08, 2019 at 02:04:16PM +0200, Peter Zijlstra wrote: > > > > Do the x86_64 variants also want some ORC annotation? > > > > Maybe so. Though it looks like regs->ip isn't saved. The saved > > registers might need to be tweaked. I'll need to look into it. > > What all these sites do (and maybe we should look at unifying them > somehow) is turn a CALL frame (aka RET-IP) into an exception frame (aka > pt_regs). > > So regs->ip will be the return address (which is fixed up to be the CALL > address in the handler). But from what I can tell, trampoline_handler() hard-codes regs->ip to point to kretprobe_trampoline(), and the original return address is placed in regs->sp. Masami, is there a reason why regs->ip doesn't have the original return address and regs->sp doesn't have the original SP? I think that would help the unwinder understand things. -- Josh