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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 385ABC43334 for ; Wed, 29 Jun 2022 15:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbiF2P7L (ORCPT ); Wed, 29 Jun 2022 11:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbiF2P7K (ORCPT ); Wed, 29 Jun 2022 11:59:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 670EE1BE8C for ; Wed, 29 Jun 2022 08:59:09 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id EBFA961892 for ; Wed, 29 Jun 2022 15:59:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A471AC34114; Wed, 29 Jun 2022 15:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656518348; bh=vkCMRqaCWUx4F0m0dc0QUXqxBSA2sPUMQx/IJbseS2s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=toanYwsEgQT1GQBCfgkgpOloQvb0+sOkiUXC5hGJ9PXvaVxKVSIk/boRFelncp4cn XxinNnjJS/1IDML3UkqDQ2/h+bssAeGimUdAtByN10tW+o9CJ6nHBfsvsfg19Jsf3a nQf06malJlk2TZKpNtqWWiZ98OOxymBWHg/ajc3fOmmPsYQCyZ0rK4y9JyyRVjBwAr +s/rwFP4uduBXrl2H/2ORHYoDOPaZp5EjVkZtm0aEPhB7C5BNwNU5EvScNj9Fyxerw OSNkGvcxnALbfmPan+VVYgvYH0MGSSlnImRZOjg5cKUIDLLDVj1FJnnTktwRxL0HUe TDuBDGc4JJcMg== Date: Wed, 29 Jun 2022 16:59:03 +0100 From: Mark Brown To: "Ivan T. Ivanov" Cc: Catalin Marinas , Will Deacon , Mark Rutland , "Madhavan T . Venkataraman" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] arm64: Add initial set of stack unwinder self tests Message-ID: References: <20220624141000.88120-1-iivanov@suse.de> <20220624141000.88120-2-iivanov@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OcGioRICVq9yfSBj" Content-Disposition: inline In-Reply-To: <20220624141000.88120-2-iivanov@suse.de> X-Cookie: Booths for two or more. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --OcGioRICVq9yfSBj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 24, 2022 at 05:10:00PM +0300, Ivan T. Ivanov wrote: > Add kunit tests for obvious cases where stack unwind could be needed. > Like these: >=20 > * Unwind a separate task > * Unwind starting from caller > * Unwind from irq context > * Unwind from kprobe handler called via ftrace > * Unwind from ftrace handler > * Unwind through kretprobed function > * Unwind from kretprobe handler >=20 > Tests are completely based on code used in s390 unwinder tests. > Cases which where not relevant to aarch64 where removed and > some places where adjusted to address aarch64 specifics. I think this would be a bit easier to digest if it were a series which builds things up with the test cases in individual patches, or at least things like ftrace and kprobes split out a bit more, rather than every single test all at once. I've got a few *very* superficial comments below, I think the code is fine but there's several moving pieces to check. > +/* > + * Calls test_arch_stack_walk() which is handy wrapper of aarch64 unwind > + * functionality, and verifies that the result contains unwindme_func2 > + *followed by unwindme_func1. Missing space. > + ret =3D register_ftrace_function(fops); > + if (!ret) { > + ret =3D test_unwind_ftraced_func(u); > + unregister_ftrace_function(fops); > + } else { > + kunit_err(current_test, > + "failed to register ftrace handler (%d)\n", ret); > + } Shouldn't we return an error here? --OcGioRICVq9yfSBj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmK8dsYACgkQJNaLcl1U h9C6Egf9GSle5eDoCuHiH/eFkHYYrFpZpnWzgNctALXJSONbkHnpSlnIyL4T6hzX XoYDY3/6N0WdvTS2bJX5HY29zpxHMT+4GILMsW8z3pBcd5QskK0fP37/xR8F34Bf /YHcW0mBh868LtHg6mdhPpWGQDOemt+BgB7oR+Uy68XxCP4BBZj1dsJuZIzxpu/E GUhh6t4zWGrP3gr51ZxsqCpcnun4NjyGHrDlliNApLItPpr7wLWrQ3ZdUzbFMjLg I7C5sRk5yV+xgnYRrYW3ZFrLuOoXsEf+aR95yguthYa4UG4VU+lll4ZAXObQbqH/ aZZZepN0KJE/dl/bd1Tx4N2GN7anNA== =XUtp -----END PGP SIGNATURE----- --OcGioRICVq9yfSBj-- 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 3D105C433EF for ; Wed, 29 Jun 2022 16:00:15 +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-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=qK+N9jY8mj1ZWnwvSB1uHKbh8xiT9IBaBZe36Ggj5Mo=; b=EQG05tVnL3dbafGQALprEOIOrI RBv1Xoc6KhMY0Paq4XJLCHuRm8prsdbwgnlV/PllbnuC9fE+PrQ9+dz5+zRMpYS+IagRhKYh00E// HB0ZxyiDFMlVLl65oXH1cz8a6W84Wse0qRBO6j5rAnzKlcAuKae70diM3Wzz7FIxvECI12K1IEQAH lQ+3qJcydv6FcXCmz2yZCkE9B9c8cGjbM0q3W7Yx4v0yZeDjIXL0agW1+Y+y4Iz+b5lmYMulqWYJb L19l0HZN5+xIoP+P40DlCEPnvkYEtIF5Qhv0a0sEHrtl9icApRybQOruO98a2RPxwS/FLlQxORF++ fzvuWaNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6a5x-00Co1H-6D; Wed, 29 Jun 2022 15:59:13 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6a5t-00Co0a-IX for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 15:59:10 +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 dfw.source.kernel.org (Postfix) with ESMTPS id ECB0E618AC; Wed, 29 Jun 2022 15:59:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A471AC34114; Wed, 29 Jun 2022 15:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656518348; bh=vkCMRqaCWUx4F0m0dc0QUXqxBSA2sPUMQx/IJbseS2s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=toanYwsEgQT1GQBCfgkgpOloQvb0+sOkiUXC5hGJ9PXvaVxKVSIk/boRFelncp4cn XxinNnjJS/1IDML3UkqDQ2/h+bssAeGimUdAtByN10tW+o9CJ6nHBfsvsfg19Jsf3a nQf06malJlk2TZKpNtqWWiZ98OOxymBWHg/ajc3fOmmPsYQCyZ0rK4y9JyyRVjBwAr +s/rwFP4uduBXrl2H/2ORHYoDOPaZp5EjVkZtm0aEPhB7C5BNwNU5EvScNj9Fyxerw OSNkGvcxnALbfmPan+VVYgvYH0MGSSlnImRZOjg5cKUIDLLDVj1FJnnTktwRxL0HUe TDuBDGc4JJcMg== Date: Wed, 29 Jun 2022 16:59:03 +0100 From: Mark Brown To: "Ivan T. Ivanov" Cc: Catalin Marinas , Will Deacon , Mark Rutland , "Madhavan T . Venkataraman" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] arm64: Add initial set of stack unwinder self tests Message-ID: References: <20220624141000.88120-1-iivanov@suse.de> <20220624141000.88120-2-iivanov@suse.de> MIME-Version: 1.0 In-Reply-To: <20220624141000.88120-2-iivanov@suse.de> X-Cookie: Booths for two or more. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220629_085909_713955_AA70121E X-CRM114-Status: GOOD ( 21.02 ) 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="===============8144989668529562253==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8144989668529562253== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OcGioRICVq9yfSBj" Content-Disposition: inline --OcGioRICVq9yfSBj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 24, 2022 at 05:10:00PM +0300, Ivan T. Ivanov wrote: > Add kunit tests for obvious cases where stack unwind could be needed. > Like these: >=20 > * Unwind a separate task > * Unwind starting from caller > * Unwind from irq context > * Unwind from kprobe handler called via ftrace > * Unwind from ftrace handler > * Unwind through kretprobed function > * Unwind from kretprobe handler >=20 > Tests are completely based on code used in s390 unwinder tests. > Cases which where not relevant to aarch64 where removed and > some places where adjusted to address aarch64 specifics. I think this would be a bit easier to digest if it were a series which builds things up with the test cases in individual patches, or at least things like ftrace and kprobes split out a bit more, rather than every single test all at once. I've got a few *very* superficial comments below, I think the code is fine but there's several moving pieces to check. > +/* > + * Calls test_arch_stack_walk() which is handy wrapper of aarch64 unwind > + * functionality, and verifies that the result contains unwindme_func2 > + *followed by unwindme_func1. Missing space. > + ret =3D register_ftrace_function(fops); > + if (!ret) { > + ret =3D test_unwind_ftraced_func(u); > + unregister_ftrace_function(fops); > + } else { > + kunit_err(current_test, > + "failed to register ftrace handler (%d)\n", ret); > + } Shouldn't we return an error here? --OcGioRICVq9yfSBj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmK8dsYACgkQJNaLcl1U h9C6Egf9GSle5eDoCuHiH/eFkHYYrFpZpnWzgNctALXJSONbkHnpSlnIyL4T6hzX XoYDY3/6N0WdvTS2bJX5HY29zpxHMT+4GILMsW8z3pBcd5QskK0fP37/xR8F34Bf /YHcW0mBh868LtHg6mdhPpWGQDOemt+BgB7oR+Uy68XxCP4BBZj1dsJuZIzxpu/E GUhh6t4zWGrP3gr51ZxsqCpcnun4NjyGHrDlliNApLItPpr7wLWrQ3ZdUzbFMjLg I7C5sRk5yV+xgnYRrYW3ZFrLuOoXsEf+aR95yguthYa4UG4VU+lll4ZAXObQbqH/ aZZZepN0KJE/dl/bd1Tx4N2GN7anNA== =XUtp -----END PGP SIGNATURE----- --OcGioRICVq9yfSBj-- --===============8144989668529562253== 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 --===============8144989668529562253==--