Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1458203ybb; Thu, 2 Apr 2020 00:52:37 -0700 (PDT) X-Google-Smtp-Source: APiQypIB0oXvdgY9PCokeY7PKX1IYuBeEjcwYf5pg/porIbqFTEhxr1yO9RkQvJD6Ok0/j4uNfDd X-Received: by 2002:a9d:6744:: with SMTP id w4mr1400447otm.220.1585813956873; Thu, 02 Apr 2020 00:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585813956; cv=none; d=google.com; s=arc-20160816; b=HCEYk6lCXFbILZVorg9ADAI3fgpn2YqHZqaFRdmGFOo1gFgtoej6ufASkbqNoZoyHw kskffNhmq3d09q5lrtfHlFXi7v91R1+zKPgFjk47LttJRbkLAauC2UdkAtfGRWCTdbrd BWycyekPMzZ8NCrEfnOwTSVWoPEHZZ1FnArZXT/yVHnbkvBNJ1hnjVF3lPAP4e/Y90nX 8kqB+K1EimL3OA9qnFZ0f2EKMSkIWnwLgigFdolAjLY7M0CNaX3e3W6Ke02RU7g7ZSJe JaVFl4e8N8NX+jBt7CdPRpzuO5uyoFCP1ooXJkF0eZoKGH5BCcvWsyN8+ErmVBCRQZcZ FZ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sOBTBRUpbh8YXdcpFE2qq+gU+izZL8xxVOZMV+Zvzmg=; b=lja0l2AZpGTl2dtRx+Px1b2w8GlKQKp8nNmu/NrNOnIgPsWF4dx6fGACqDgEPtUQ7+ D0OUBElMO2npQvSWYOR4uC8M3S/L2061Z7ODVWjM0QzZLZrtILmBweOmq946c5RZkHVA FIxJGIuG7tzsmiWbwemIFjYCvb1J8Am9SlmAdZ4ZMbRjP7KYeDDlm+q8eyCpnlemgGe0 Xz62gtgUukxB7cD7KG9Jie/mv513t4glLQSCuwcPFOz13b+JBrUVIcWnH3gGfjTZFsRb 1SRebp3VYVLu9kI0iJ7qUL9d7M4EVxWW1rr0w1rg4CeA/J8aBeAbrsZEOnuTt1cezv6M NXwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jRgJ+VKQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si1960679otk.166.2020.04.02.00.52.24; Thu, 02 Apr 2020 00:52:36 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jRgJ+VKQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387476AbgDBHur (ORCPT + 99 others); Thu, 2 Apr 2020 03:50:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41922 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbgDBHur (ORCPT ); Thu, 2 Apr 2020 03:50:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sOBTBRUpbh8YXdcpFE2qq+gU+izZL8xxVOZMV+Zvzmg=; b=jRgJ+VKQkwpxjCzParG0RExRyk 3dB7GbgwhTZBfOMrvf0RTn5Cr+MtzIKMXwD3CyeuePxJgr4/G3ef0LxGpCNBmGKdZ2YF+u2iBj345 K5NN+3laVqb0mYDBIobqhwivZAfy9asN7KXoT3ECj7+xST63TbVW5ViYy/Zqirdk+6gAS8Io0ALwu 5ZboTgEZ6G39/0aFJYQZV8dvUiJ8FWKZufmy4ylLsToFmIVZ0tkCiuHNoWjh2+HTFab4ZMG/KwM0E HrNkGkjj6VyaIr1e0ou/BVkNKOnTmhapwqbUGoXQvH0VDuSKui0cvyCK853h7YAIZT50KKNaGvkyY 4472yqOQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJucY-0007Fp-Pm; Thu, 02 Apr 2020 07:50:38 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C53BA3010BC; Thu, 2 Apr 2020 09:50:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 77383202451B4; Thu, 2 Apr 2020 09:50:36 +0200 (CEST) Date: Thu, 2 Apr 2020 09:50:36 +0200 From: Peter Zijlstra To: Julien Thierry Cc: Josh Poimboeuf , tglx@linutronix.de, linux-kernel@vger.kernel.org, x86@kernel.org, mhiramat@kernel.org, mbenes@suse.cz, Steven Rostedt Subject: Re: [PATCH v2] objtool,ftrace: Implement UNWIND_HINT_RET_OFFSET Message-ID: <20200402075036.GA20730@hirez.programming.kicks-ass.net> References: <20200330200254.GV20713@hirez.programming.kicks-ass.net> <20200331111652.GH20760@hirez.programming.kicks-ass.net> <20200331202315.zialorhlxmml6ec7@treble> <20200331204047.GF2452@worktop.programming.kicks-ass.net> <20200331211755.pb7f3wa6oxzjnswc@treble> <20200331212040.7lrzmj7tbbx2jgrj@treble> <20200331222703.GH2452@worktop.programming.kicks-ass.net> <20200401170910.GX20730@hirez.programming.kicks-ass.net> <684d6e29-4a01-b4a5-f906-7bdee5ad108f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <684d6e29-4a01-b4a5-f906-7bdee5ad108f@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 07:41:46AM +0100, Julien Thierry wrote: > On 4/1/20 6:09 PM, Peter Zijlstra wrote: > > The code in question (x86's sync_core()), is an exception return to > > self. It pushes an exception frame that points to right after the > > exception return instruction. > > > > This is the only usage of IRET in STT_FUNC symbols. > > > > So rather than teaching objtool how to interpret the whole > > push;push;push;push;push;iret sequence, teach it how big the frame is > > (arch_exception_frame_size) and let it continue. > > > > All the other (real) IRETs are in STT_NOTYPE in the entry assembly. > > > > Right, I see.. However I'm not completely convinced by this. I must admit I > haven't followed the whole conversation, but what was the issue with the > HINT_IRET_SELF? It seemed more elegant, but I might be missing some context. https://lkml.kernel.org/r/20200331211755.pb7f3wa6oxzjnswc@treble Josh didn't think it was worth it, I think. > Otherwise, it might be worth having a comment in the code to point that this > only handles the sync_core() case. I can certainly do that. Does ARM have any ERETs sprinkled around in places it should not have? That is, is this going to be a problem for you? > Also, instead of adding a special "arch_exception_frame_size", I could > suggest: > - Picking this patch [1] from a completely arbitrary source > - Getting rid of INSN_STACK type, any instruction could then include stack > ops on top of their existing semantics, they can just have an empty list if > they don't touch SP/BP > - x86 decoder adds a stack_op to the iret to modify the stack pointer by the > right amount That's not the worst idea, lemme try that.