From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2E8BC4332F for ; Tue, 13 Dec 2022 12:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MJ2urowy8gm+CTIFM+vHDlr6V8my7/0OC3kVqwBJvaY=; b=AYikxkA/6ZUcyT 0eXdhOMAR9jSkhejVigzU9uLMTUIyEmtCPYlvDAmMtQmhrLjzVBYTXqdphEeBT+MpKgTXc5fCQuPv 0D4r6Tlae2JSqriiJGZUq2oh5MdG+/cTImuG/G1t0u9bVQpqCDuY5QIWiY92U3k+oatwWa3QZ18ZC rLiOZjlw2DXxawPFAOzBLAUWTAnluoFePv5AdC436E6FOSD7l/bYn8M5dcm9eALEpuyNnzVO9eJWK 4YZuCdqA2blzVYSDLHTrZDW8rCJaiuMCXZ7pdb7J49iXC2uI77r4CEt0RkV/T74Dg9w9DIG8Y5+oX RYFeoJcLTzv4sGHla2yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p54lr-00HSSo-Cj; Tue, 13 Dec 2022 12:52:31 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p54lo-00HSS7-LY for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 12:52:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 54F41B810DE; Tue, 13 Dec 2022 12:52:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6367C433D2; Tue, 13 Dec 2022 12:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670935946; bh=YDbdK/6Mmdgi3to1CDFzj3V50/m14VqpiVePGSRQyu0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dod63C9BETC3Bmw/6LnQYjUNny6Og/QnogfDFw0MACXguAWg7RIYEYDxj7cpEThhn jZB1CvyNa9LXdkdJ7/GgZYm21C98ST4IPnbTA3F3h97Khx8zClFGxZvXuehxarVB1i hmSiHWJbghTNUeFqY5s3Q/M+54VLxaSBXPep8zrACRAPSPylb7WdrlLIt+001HdgSL Fer5UweSQieBPj5WV2YrXJ+z8UHJH4q9Ku56H3SJRvgHPFcRWg7gYuOmo4/MB3xSjt 2+5HVBntJVGw60VrSLUSK7QJWUYPzBvBhq++OduVys2INUH7ac8aqYihJzEv/xh/pV VhMUNibZZ9jkg== Date: Tue, 13 Dec 2022 12:52:20 +0000 From: Will Deacon To: Ard Biesheuvel Cc: Linus Torvalds , catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, maz@kernel.org Subject: Re: [GIT PULL] arm64 updates for 6.2 Message-ID: <20221213125219.GC5719@willie-the-truck> References: <20221209112500.GA3116@willie-the-truck> <20221213121118.GB5719@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221213_045228_876402_2758D5A6 X-CRM114-Status: GOOD ( 21.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 13, 2022 at 01:36:09PM +0100, Ard Biesheuvel wrote: > On Tue, 13 Dec 2022 at 13:11, Will Deacon wrote: > > Ard -- do you think we could tweak the patching so that we patch the push > > and the pop together (e.g. by tracking the two locations on a per-frame > > basis and postponing the text poking until just before we return from > > scs_handle_fde_frame())? > > > > The push and the pop are not necessarily balanced (there may be more > than one pop for each push), and the opcode we look for > (DW_CFA_negate_ra_state) may occur in places which are not actually a > pop, so tracking these is not as straight-forward as this. Duh, yes, of course. You only _execute_ one of the pops for a given run through the function, but there could be numerous return points. So my idea doesn't work at all :) > What we could do is track the push and the first pop on a first pass, > and if we don't encounter any unexpected opcodes, patch the push and > do a second pass starting from the first pop. Or just simply run it > twice and do no patching the first time around (the DWARF frames are > not very big) Doing a dry-run first sounds fairly easy to implement, so it would probably be a good starting point. It also means that if anybody complains about the overhead, then we can get them to work on doing it at build time instead! Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel