Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1304228pxk; Mon, 31 Aug 2020 15:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySKsXoeIwbLzSb6rC1LPGP52pXrGpACLgU38zN0dUNr+FpoeJNpDXQpS1ZcAny9EiEw4f1 X-Received: by 2002:a50:ce11:: with SMTP id y17mr3022566edi.86.1598914266197; Mon, 31 Aug 2020 15:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598914266; cv=none; d=google.com; s=arc-20160816; b=Yl3i1nIitlXpKSjC/hafd0hm3eCzzc6Yq/MFWMvXlb/0WGMcvlRwSGM7nzj/gElI9a kVxFRUeXVnLNNEpRRJUuOtHl5siWbg7/SQyLIb2q9zca/9lQr2LCUNiar8r1aCLZn0vU q48StsQgbF8hcuND6qbV5HR3m+Z5Jh7Hw5SvbwiwcFOL66QHBVXs4Wjgqk6NG2Ia/P4z 12JpE05P2xWDTroNkA9LvBW5ZiMM/5aZesnXYUVj1HCi5d2/2uxXO9NOL2P4ZSW7bMQl anUCRyHBSm8gWpBHltNxLnpar/QwS12T00IhZRGgMz+EQqJj+39enIqALz/EdRCLqJvc aNBw== 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=pg1EKJ08eC4msPPg4w9Q4tqRrD2nD69pzCZKjpi0eZg=; b=c7RWhfOMHLasQAWo6CwOsEZ/MKekZWpl31IPnuuSY4T+CwD3dFv1IDMGR7VeRCcHXn iQaayfKPZaHCmEZP3LgYoRkseWo+mM/V5NOcqT465Z49VIRo3238DKlGR5fAETtIjPG8 yib4WcgcQdyid7dmCBtVVYAijR/YB2NMPispe0oUUJ/8rXIwfzyug2TFMC4WVH66QyVv wZhS9z5mDJDopQCswQWeJSk7J52Aqysp7/pmUHNXPu4aShzg/B0OHETKeXgZdv9LWzK+ V4zo1DI28F7yQWlkmO1gmhFil58Rm1xzm9GueRWSgcsMOo/+L7jiSacge5/q+a5MLQuq OcwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WVXMJRV/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx7si1814462ejb.438.2020.08.31.15.50.43; Mon, 31 Aug 2020 15:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WVXMJRV/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728757AbgHaTzz (ORCPT + 99 others); Mon, 31 Aug 2020 15:55:55 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:49504 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728344AbgHaTzy (ORCPT ); Mon, 31 Aug 2020 15:55:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598903753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pg1EKJ08eC4msPPg4w9Q4tqRrD2nD69pzCZKjpi0eZg=; b=WVXMJRV/DxCsvgUte9kAtQbc2iT4gYG3HOYBgBPgPv3Sg/c1Xq6GP4XOBtMQ7P6e6AfFkr yi+MDtPvjd23+uO5K6YgyloQDVGzST3+/encwXFFiLPyVc9IOgmcGYv2Wxac5hMsp1H1lU n/FrDd9Vh31XgwZPlCKciMS1lAhbEoM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-246-mFuRQQa6OYWh8gPYCP7Hqw-1; Mon, 31 Aug 2020 15:55:50 -0400 X-MC-Unique: mFuRQQa6OYWh8gPYCP7Hqw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4DCF802B60; Mon, 31 Aug 2020 19:55:49 +0000 (UTC) Received: from treble (ovpn-114-37.rdu2.redhat.com [10.10.114.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA7FC5C1BB; Mon, 31 Aug 2020 19:55:48 +0000 (UTC) Date: Mon, 31 Aug 2020 14:55:46 -0500 From: Josh Poimboeuf To: Julien Thierry Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mbenes@suse.cz, raphael.gault@arm.com, benh@kernel.crashing.org Subject: Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading Message-ID: <20200831195546.gt72y5tplwuftqv7@treble> References: <20200730094652.28297-1-jthierry@redhat.com> <20200730094652.28297-10-jthierry@redhat.com> <20200730150341.udqnykbw7yfsjvin@treble> <1a078563-001d-c666-d2f5-9291f0efd35a@redhat.com> <20200731140441.cpzr4lrlkcrmoz2c@treble> <6a314dba-4086-717b-d226-6c292240a3e9@redhat.com> <20200803213506.hlbpdlitom7sjtqo@treble> <8fe8199e-a2f3-513f-6cdf-c61d7936dede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8fe8199e-a2f3-513f-6cdf-c61d7936dede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 01:31:46PM +0100, Julien Thierry wrote: > > > > The call to update_cfi_state_regs() is really regs-specific, not > > > > sp-specific. > > > > > > > > > > I must admit I don't really understand what "regs" is and why exactly such > > > an exception in stack state tracking is made where only operations to SP are > > > taken into account. > > > > "regs" is a special type of stack frame, usually for asm entry code, > > where the frame is actually an instance of 'struct pt_regs'. So if > > there's a variable associated it with it, maybe it should have "regs" in > > the name. > > > > Though I think non-x86 arches will also have regs frames, so would it > > make sense to just make the unwind hint types a global multiarch thing? > > They could be renamed to UNWIND_HINT_TYPE_REGS{_PARTIAL}. Then there > > wouldn't really be a need for the "sp_only" thing. > > > > If having regs frame means having a pt_regs on the stack when procedure > calls/return, then yes this will probably be the case on most archs (it is > for arm64 at least. The regs frames aren't for function/procedure calls, but rather exceptions/interrupts. > However in that case, arm64 still builds a stack frame and sets the frame > pointer, so only handling SP operations doesn't make much sense for arm64. If for example arm64 were to switch to ORC, it could have regs-only frames in entry code just like x86. > Also, things like ORC_TYPE_REGS_IRET don't have a use for arm64 (but maybe > for other non-x86 arches it does?) If we called it TYPE_REGS_PARTIAL, at least the name would be generic enough, even if it's not used by all arches. > In the end that's why I left the unwind hint types as arch defined. It seems > like every arch will have their specific semantics they might want to let > objtool know about. Ok, I guess I'd need to look at the code to have an opinion. If there turn out to be commonalities between the different arch unwind hints then we could always unify them later. -- Josh