Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp290412iog; Thu, 30 Jun 2022 00:27:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uDfR4hEEUs/s1fXxWbgCZxs5/3WBkZQBSSaVjUFcsWXbO/3jhXUrhKgBqMRyObUdTTzocz X-Received: by 2002:a17:902:e84f:b0:16b:8a74:d572 with SMTP id t15-20020a170902e84f00b0016b8a74d572mr14492987plg.146.1656574023106; Thu, 30 Jun 2022 00:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656574023; cv=none; d=google.com; s=arc-20160816; b=ZzuHA+oWLCzvgcbWmP3W5H+T2Gx+0fdnes8alcgsmTVBVTCfFO30kkhiPxukQWcKqf U8Qegy6kvelxTvZ+Dsy6yfBmoRpIJjcA1OKpqBI5VW51YzjFmnzlMj/K4GmRk8g9pwX4 Wt2o6pYMJ0MKRKJXnOcCiJC6cn5oQuvAdc+jszRdr6RXUDHM3drhVvhZ1i6jLKXigHUZ VVu//KWcPD4O5DpKqrgDnAUg1AjGdCiUEXld6FVqm5Y/7QxCdqVCQqjd99yzwWOklYfM y8tcKOgdDdCb/F0ybSPLMA0P27KaF3Lpt99tkrei67rOUkdAe4vb8nM0o/DuAISJ1WRy tcfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=okYFeQHCpEqkIDhwEg2qpMDyzApIEQNLhlCs/1wRbT8=; b=mACM1N8hO63hUybTF55YxwWzOgNP3Ip5zpBF9/y2Vww2tS+jejHZp9RrjFopVZB06H od5htSHxGhNSRTpJqTpJNkhXDtss/JrHO5GraUNb1xmJWgCZgyH2RBlfiKB48FKPLd6k /PLVxbrNKiv14YbTClZ55zhmYL1N8U7fDAJZuw13LDEm8QDB/SQXvo/CoKyW9tfxMbb7 0X6OAq0hGUH8ORyDS7bxG/+BcHPdv87ZonO9tYn++NuKBQ00ziaPKYTuRVn/THge5sd9 HFpV1V3LMCnxCe0p5JdW0Dz4Hg08FPJ14HoaHbrP2waAfF5O3R/ixIVwHxVkqU/bJ1fr dK5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IR4PmIpG; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a170902ea0c00b0016a38086f4asi30720887plg.297.2022.06.30.00.26.24; Thu, 30 Jun 2022 00:27:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IR4PmIpG; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiF3Gzg (ORCPT + 99 others); Thu, 30 Jun 2022 02:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiF3Gzf (ORCPT ); Thu, 30 Jun 2022 02:55:35 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 619A0326DE for ; Wed, 29 Jun 2022 23:55:34 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1155021C17; Thu, 30 Jun 2022 06:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1656572133; h=from:from:reply-to: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=okYFeQHCpEqkIDhwEg2qpMDyzApIEQNLhlCs/1wRbT8=; b=IR4PmIpGWNfzHgXJeBDOJgxDGd2GV2hVt52Pr+5Oi2R3dRfjC60TkJdxm8EdAm0YDA9n1T e6t5FqpjyCHUsB0BxCG3IUIFuR2e9HBWVrnqYU9vuPlWAOJziwlvXc88359angqNk6Ip+E 3sAadl12d8N4HMmarUk5bvnsJ6EwcJg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1656572133; h=from:from:reply-to: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=okYFeQHCpEqkIDhwEg2qpMDyzApIEQNLhlCs/1wRbT8=; b=EQAdbyOGd9xMJFKrx8gvnMBF/SL6fFGcf3+4IiqJpDIuJCh/ZtD0B7mR87q/JhX7zfLEwn SZpTY1eWQ1KI2+CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EEFB8139E9; Thu, 30 Jun 2022 06:55:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GBWkOORIvWLeIwAAMHmgww (envelope-from ); Thu, 30 Jun 2022 06:55:32 +0000 Date: Thu, 30 Jun 2022 09:55:32 +0300 From: "Ivan T. Ivanov" To: Mark Brown 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: <20220630065532.i3alwmaenkooiwxw@suse> References: <20220624141000.88120-1-iivanov@suse.de> <20220624141000.88120-2-iivanov@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06-29 16:59, Mark Brown wrote: > > 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: > > > > * 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 > > > > 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. Ok. I will split and resend. > > > +/* > > + * 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. Sure. > > > + ret = register_ftrace_function(fops); > > + if (!ret) { > > + ret = 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? Error will be returned once we remove test_unwind_ftraced_func address from ftrace filters. Regards, Ivan