Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3886910ybb; Tue, 31 Mar 2020 14:08:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsJhBG0FV90hOyEm6q+HI+a4EcixBfxy9WbqWOkiWWwqVTKNF4oLdmL2/3B9j0Y9SpHctO3 X-Received: by 2002:a9d:5888:: with SMTP id x8mr13909224otg.361.1585688902078; Tue, 31 Mar 2020 14:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585688902; cv=none; d=google.com; s=arc-20160816; b=IkaZOYoGpZUHZUecNjxGmZMTahPiwF/Obpy/mdT3f/ySMHB5d6ojyJ7l0XhDz2YOjG SSThS344tiMhqcsbrvt0VBVVZvOfyooL0c/Z2y+23D1QhI4s5+5HEiws4vGrEHBnE+z1 M2zS1NhsJ/MOixIu4cuUmrFkcBZhovYBE+qQLHeFsp4WtY9yTMDvee9fXv87UglX4q6i WW91nDfMRx55NvtvExFB1PjuMuFVOXQv3obnVoiiaU4aXGAbdOWkTcI4xUpFO7f03fWo f5Dh5A/p2i+x9I59x2rtCa/97rMZ7sgFKomOlPtVL7oMWgXNSpP+VzgpILI20GwmpH9+ F9BA== 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:dkim-signature; bh=TdKLErdYAhpy+aevf+rPoQWJBOmm5AFEN10IJcqqdTA=; b=pgRUsuXh/tzhkEtrkmtBxk6llV/uEC2wCnqudfWeMVjAAikF1s8Zjc8Fu4k7AHLu9l mtKojn4D/rB2X6jVja2VQ1hM+88Htub1VCB1odvzInZ9n7tr1U6nQNpAdKyozGwZ9+vX np7q+igzYyA5OOQ3mwdariJXfWBFWqbQ3Ash8lqzTctWASNgxHKGd51VBkvOKhu65Km5 qf8XqUbT2d0LIQ/CFO0p7yvee/dwKLQVtxDgWj3EOJwPoeCo4etkyoPm/cZOSX3saQoe 2IJ1MAszEDc1nfxBVIGx9zcidcnOuGVj7pYUgpZ32K6EKNus6JHhNkp6sCrRUNdbhpBW I+wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=gCFMJoI5; 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 n70si8072390ota.89.2020.03.31.14.08.08; Tue, 31 Mar 2020 14:08:22 -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=merlin.20170209 header.b=gCFMJoI5; 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 S1731145AbgCaVHd (ORCPT + 99 others); Tue, 31 Mar 2020 17:07:33 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51726 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbgCaVHd (ORCPT ); Tue, 31 Mar 2020 17:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=TdKLErdYAhpy+aevf+rPoQWJBOmm5AFEN10IJcqqdTA=; b=gCFMJoI5t1iLIbrbakBPfey08z r4FSRSNoq+3IjxCH6HfkCgcD3t0IikcK57Uxd2OVPkAj86HJbGfXxW9kJX/Na6iTquXJDPrpzT4jl 6WdvpYy7SVc9hdokiiYPKSvick4f5e13cervutSgE+62Rcayfd4phdInk5HqnWXwhRFHKfVZWKrPK Y4FG8hUXpwu9icbvoTJpDysml7UjaN3JyfwRRSYNs17lzEde3eEB9w/1P/M8DBivCR1UKFDt0s5JI KWBwpeR+1JZ4QKaNglBpR+bHh4kEb/IgfZlxRnwoBoljiDZwndCOisJxo6jm+XsH60wb2sWCEVMJn aK+NcPbA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJO6V-0005iL-8I; Tue, 31 Mar 2020 21:07:23 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 692A098354A; Tue, 31 Mar 2020 23:07:20 +0200 (CEST) Date: Tue, 31 Mar 2020 23:07:20 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, x86@kernel.org, mhiramat@kernel.org, mbenes@suse.cz, Steven Rostedt Subject: Re: [RFC][PATCH] objtool,ftrace: Implement UNWIND_HINT_RET_OFFSET Message-ID: <20200331210720.GG2452@worktop.programming.kicks-ass.net> References: <20200326135620.tlmof5fa7p5wct62@treble> <20200326154938.GO20713@hirez.programming.kicks-ass.net> <20200326195718.GD2452@worktop.programming.kicks-ass.net> <20200327010001.i3kebxb4um422ycb@treble> <20200330170200.GU20713@hirez.programming.kicks-ass.net> <20200330190205.k5ssixd5hpshpjjq@treble> <20200330200254.GV20713@hirez.programming.kicks-ass.net> <20200331111652.GH20760@hirez.programming.kicks-ass.net> <20200331202315.zialorhlxmml6ec7@treble> <20200331204047.GF2452@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331204047.GF2452@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2020 at 10:40:47PM +0200, Peter Zijlstra wrote: > On Tue, Mar 31, 2020 at 03:23:15PM -0500, Josh Poimboeuf wrote: > > I now understand what you're trying to do with the RET_TAIL thing, and I > > guess it's ok for the ftrace case. But I'd rather an UNWIND_HINT_IGNORE > > before the tail cail, which would tell objtool to just silence the tail > > call warning. It's simpler for the user to understand, it's simpler > > logic in objtool, and I think an "ignore warnings for the next insn" > > hint would be more generally applicable anyway. > > I like how this is specific on how far the stack can be off, as opposed > so say 'ignore any warning on this instruction'. > > Because by saying this RET should be +8, we'll still get a warning when > this is not the case (and in fact I should strengthen the patch to > implement that). Like this; I'm confused on what cfa.offset is vs stack_size though. But this way we're strict and always warn when the unexpected happens. --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1423,8 +1423,7 @@ static bool has_modified_stack_frame(str !(ret_offset && state->cfa.offset == initial_func_cfi.cfa.offset + ret_offset)) return true; - if (state->stack_size != initial_func_cfi.cfa.offset && - !(ret_offset && state->stack_size == initial_func_cfi.cfa.offset + ret_offset)) + if (state->stack_size != initial_func_cfi.cfa.offset + ret_offset) return true; for (i = 0; i < CFI_NUM_REGS; i++) {