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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B98C432BE for ; Thu, 29 Jul 2021 14:52:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D13B60EBC for ; Thu, 29 Jul 2021 14:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237756AbhG2Owi (ORCPT ); Thu, 29 Jul 2021 10:52:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:50648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237204AbhG2Owh (ORCPT ); Thu, 29 Jul 2021 10:52:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05093604DC; Thu, 29 Jul 2021 14:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627570354; bh=tlr6WfyAAfYIOdiTBqFltGkyg5uAuLp75iQ4ftRMncg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l4YivkEzcgjZAW7uNZ1Smg+4IvuOkmGFdXeC38ea30J5dD02s/HnACqaZsYos143X MMJSfbD95yJMFN2FYVsj99SJNghH0D8AVkz19WACcR9RQzaVw2duwWUpHYbm6kO6Dn k7uvd0vus2Dx95TJ6j4IZEbjvczQRoGaktY6KEakkEXPiVqC3EkbZoSNAJqpEk9NPQ O2ipJqRrpX6D/mlOFSLXsbbJW31CQv/0r4Au5ciTdRaxvQpAQdQNC/nidEXQIz81ST 1FDgJ8x+qHXXJ5dKUq2eafsc7ahNDY/HWHq0Xz6VBGaEsru9k8Lfj37UsYL4eoIlYD 84VIu9p8BT7ig== Date: Thu, 29 Jul 2021 15:52:10 +0100 From: Mark Brown To: "Madhavan T. Venkataraman" Cc: Mark Rutland , jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, pasha.tatashin@soleen.com, jthierry@redhat.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v6 3/3] arm64: Create a list of SYM_CODE functions, check return PC against list Message-ID: <20210729145210.GP4670@sirena.org.uk> References: <3f2aab69a35c243c5e97f47c4ad84046355f5b90> <20210630223356.58714-1-madvenka@linux.microsoft.com> <20210630223356.58714-4-madvenka@linux.microsoft.com> <20210728172523.GB47345@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="K9FEQnHYtEQyKlzu" Content-Disposition: inline In-Reply-To: X-Cookie: Vini, vidi, Linux! User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --K9FEQnHYtEQyKlzu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 29, 2021 at 09:06:26AM -0500, Madhavan T. Venkataraman wrote: > On 7/28/21 12:25 PM, Mark Rutland wrote: > > On Wed, Jun 30, 2021 at 05:33:56PM -0500, madvenka@linux.microsoft.com wrote: > > Since some of the above is speculative (e.g. the bit about optprobes), > > and as code will change over time, I think we should have a much terser > > comment, e.g. > > /* > > * As SYM_CODE functions don't follow the usual calling > > * conventions, we assume by default that any SYM_CODE function > > * cannot be unwound reliably. > > * > > * Note that this includes exception entry/return sequences and > > * trampoline for ftrace and kprobes. > > */ > Just to confirm, are you suggesting that I remove the entire large comment > detailing the various cases and replace the whole thing with the terse comment? > I did the large comment because of Mark Brown's input that we must be verbose > about all the cases so that it is clear in the future what the different > cases are and how we handle them in this code. As the code evolves, the comments > would evolve. I do agree with Mark that this has probably gone from one extreme to the other and could be cut back a lot - originally it didn't reference there being complicated cases like the trampoline at all IIRC so you needed external knowledge to figure out that those cases were handled. --K9FEQnHYtEQyKlzu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmECwJkACgkQJNaLcl1U h9CC9wf8DqjxuFSwcUy/+ixIXHiCPRzxZpCl+PK99VCWgx6pnx+ndjI6ulrAnESa D9dmwiLY6mPNFQYwHnyZF3n7+2QvlvJ0vtAfYzKTAD2GL5s8GU9eMCGkEeHCOdON vB9sT5dccjFTmyLsAXhYbET2Yrrir4Hb9mgIWW4e5/cl/lliMmgvOCjrbvA4ZDSL gMi++LRG+b5NJWoGBneeRug/uRq+wH3rVy7HESZWL4dkwemxoqIOrJuZ8pu1sHcO UplFpWBgmQUahCKe6T8vb23V45XOClSTaowYCEJZprveu5vOE2y+IFcwVA9chXrD XxdGLN9KS2gHj1Vw+RNnjG/IxwoH6Q== =4mHi -----END PGP SIGNATURE----- --K9FEQnHYtEQyKlzu-- 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 X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6708EC432BE for ; Thu, 29 Jul 2021 14:55:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 320C360EBC for ; Thu, 29 Jul 2021 14:55:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 320C360EBC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vXDAb9/W1xUIiLcjaLvXg5sCj3/pk1zWlAcvu55qmdc=; b=zGcUAtlWcb8sXfWqktIemQJCnM lavtPZ6UJSscCFCqmqNYxrytrJROm6r/Jw00ehMm0UmREhhRnQeAGaVcjjdaVLfm+l1AsLPilB9jy bC4mOqpsdaGrNf7okNMbYsO2o2F0ZOseDfTigvy5ySN9FrS1OZMYL+FghlrC0vPKt4/7Yl4jrzYDV DLvUYkFigKvs58xdcPmm9dmjTX7lPMCuiWO/ZYfXeZlxorRYiIw7nBckzAHNEI/j1W9f/oAMVnvyD Arok8ZxVwZMUeRF5qt6SqjvIR8C/+Dzm6o1qQCeQvC1FaxBpN62mP9VwJL8q5LT15IcWs7Z/qAAYn yHLchLQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m97On-004bt7-8j; Thu, 29 Jul 2021 14:52:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m97Ok-004bsP-F1 for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 14:52:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05093604DC; Thu, 29 Jul 2021 14:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627570354; bh=tlr6WfyAAfYIOdiTBqFltGkyg5uAuLp75iQ4ftRMncg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l4YivkEzcgjZAW7uNZ1Smg+4IvuOkmGFdXeC38ea30J5dD02s/HnACqaZsYos143X MMJSfbD95yJMFN2FYVsj99SJNghH0D8AVkz19WACcR9RQzaVw2duwWUpHYbm6kO6Dn k7uvd0vus2Dx95TJ6j4IZEbjvczQRoGaktY6KEakkEXPiVqC3EkbZoSNAJqpEk9NPQ O2ipJqRrpX6D/mlOFSLXsbbJW31CQv/0r4Au5ciTdRaxvQpAQdQNC/nidEXQIz81ST 1FDgJ8x+qHXXJ5dKUq2eafsc7ahNDY/HWHq0Xz6VBGaEsru9k8Lfj37UsYL4eoIlYD 84VIu9p8BT7ig== Date: Thu, 29 Jul 2021 15:52:10 +0100 From: Mark Brown To: "Madhavan T. Venkataraman" Cc: Mark Rutland , jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, pasha.tatashin@soleen.com, jthierry@redhat.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v6 3/3] arm64: Create a list of SYM_CODE functions, check return PC against list Message-ID: <20210729145210.GP4670@sirena.org.uk> References: <3f2aab69a35c243c5e97f47c4ad84046355f5b90> <20210630223356.58714-1-madvenka@linux.microsoft.com> <20210630223356.58714-4-madvenka@linux.microsoft.com> <20210728172523.GB47345@C02TD0UTHF1T.local> MIME-Version: 1.0 In-Reply-To: X-Cookie: Vini, vidi, Linux! 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-20210729_075234_560887_2421E8D0 X-CRM114-Status: GOOD ( 23.14 ) 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: multipart/mixed; boundary="===============4080196856235202032==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4080196856235202032== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="K9FEQnHYtEQyKlzu" Content-Disposition: inline --K9FEQnHYtEQyKlzu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 29, 2021 at 09:06:26AM -0500, Madhavan T. Venkataraman wrote: > On 7/28/21 12:25 PM, Mark Rutland wrote: > > On Wed, Jun 30, 2021 at 05:33:56PM -0500, madvenka@linux.microsoft.com wrote: > > Since some of the above is speculative (e.g. the bit about optprobes), > > and as code will change over time, I think we should have a much terser > > comment, e.g. > > /* > > * As SYM_CODE functions don't follow the usual calling > > * conventions, we assume by default that any SYM_CODE function > > * cannot be unwound reliably. > > * > > * Note that this includes exception entry/return sequences and > > * trampoline for ftrace and kprobes. > > */ > Just to confirm, are you suggesting that I remove the entire large comment > detailing the various cases and replace the whole thing with the terse comment? > I did the large comment because of Mark Brown's input that we must be verbose > about all the cases so that it is clear in the future what the different > cases are and how we handle them in this code. As the code evolves, the comments > would evolve. I do agree with Mark that this has probably gone from one extreme to the other and could be cut back a lot - originally it didn't reference there being complicated cases like the trampoline at all IIRC so you needed external knowledge to figure out that those cases were handled. --K9FEQnHYtEQyKlzu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmECwJkACgkQJNaLcl1U h9CC9wf8DqjxuFSwcUy/+ixIXHiCPRzxZpCl+PK99VCWgx6pnx+ndjI6ulrAnESa D9dmwiLY6mPNFQYwHnyZF3n7+2QvlvJ0vtAfYzKTAD2GL5s8GU9eMCGkEeHCOdON vB9sT5dccjFTmyLsAXhYbET2Yrrir4Hb9mgIWW4e5/cl/lliMmgvOCjrbvA4ZDSL gMi++LRG+b5NJWoGBneeRug/uRq+wH3rVy7HESZWL4dkwemxoqIOrJuZ8pu1sHcO UplFpWBgmQUahCKe6T8vb23V45XOClSTaowYCEJZprveu5vOE2y+IFcwVA9chXrD XxdGLN9KS2gHj1Vw+RNnjG/IxwoH6Q== =4mHi -----END PGP SIGNATURE----- --K9FEQnHYtEQyKlzu-- --===============4080196856235202032== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4080196856235202032==--