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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A05EDC433EF for ; Mon, 25 Oct 2021 02:36:00 +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 6779061002 for ; Mon, 25 Oct 2021 02:36:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6779061002 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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: 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=hmbzwr1dhiZG+VKOSiAztS1g0IhdNsKsqcMl9yfQ6Y4=; b=nV26C8IdtmdYC1 fC76+sXWQZl6DPgu8sx0QpsJQOoU8FG7UbP1w9lx3UjraMeeBG9+3/r0R+d7KdpwVu1pBAimwR1dC NxfMEdoPrbUlA/p56/ZnW7S9w+GsFvtLP2t2kOvle1AecemLQHDfDm30sV/DzPs5j4lscdf6yNnUy a4Qt99wFOnZKrY+SOP/nTpgIEjh428QO8fx2PqlpF1DsqQm608j8rgKPBNK92QvOvsEqolBPKq1yq 77aFx3qtNZOkNI+q3F/yMTSqIWW0kOTqHosZgCNaK/U06h0mN8USlpIo5/OLoWjEsVvxV0l/2Qt6o KADu37WzlmKoZwxT5QLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mepop-00F23f-IQ; Mon, 25 Oct 2021 02:34:35 +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 1mepol-00F22r-Sk for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 02:34:33 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A2A7360F22; Mon, 25 Oct 2021 02:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635129270; bh=f6OSyvhMIWi68Z3XkUru890c/lNshTQisOxI1LmUwK8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h7Q5HDx7kupXfXJzh6ltB73mY9CelxUv9F0vAvZZu5RVRj0/PZfDZhF8OfBeoGVAf lquY/afDsM82L/9LmVLvRRzFuE5Ykw9u0b0AE3EJIUpTxYM5FgR6yvP4aAQkxEof2O EffmgX+3COq6qu//2D2JTR+6G5oZPw/dtNcD5jFDLjU4qoBG8pSAPtXSIORwXBYwjA yyYOsRFUa4Rlo2F7Xdnp8BkzcKKC6ROc6bMT3KA0XlLKchwsRDV61Lm3MuMSgV5Bxr hCb9dAGCeQ0lN0YXxg2dK9p7VvT7HHRbEs5Byz3sE9/FJiQkIEyvJ+cjlhCozpOV5L Jcdo3lsWGI2UQ== Date: Mon, 25 Oct 2021 11:34:27 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: "Naveen N . Rao" , Ananth N Mavinakayanahalli , Ingo Molnar , linux-kernel@vger.kernel.org, Sven Schnelle , Catalin Marinas , Will Deacon , Russell King , Nathan Chancellor , Nick Desaulniers , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 2/9] kprobes: Add a test case for stacktrace from kretprobe handler Message-Id: <20211025113427.b3e29c2fe16564578c401387@kernel.org> In-Reply-To: <20211022121537.32821979@gandalf.local.home> References: <163477765570.264901.3851692300287671122.stgit@devnote2> <163477767243.264901.10894979830215919916.stgit@devnote2> <20211022121537.32821979@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211024_193432_001422_E9872CE3 X-CRM114-Status: GOOD ( 24.61 ) 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 Fri, 22 Oct 2021 12:15:37 -0400 Steven Rostedt wrote: > On Thu, 21 Oct 2021 09:54:32 +0900 > Masami Hiramatsu wrote: > > > Add a test case for stacktrace from kretprobe handler and > > nested kretprobe handlers. > > > > This test checks both of stack trace inside kretprobe handler > > and stack trace from pt_regs. Those stack trace must include > > actual function return address instead of kretprobe trampoline. > > The nested kretprobe stacktrace test checks whether the unwinder > > can correctly unwind the call frame on the stack which has been > > modified by the kretprobe. > > > > Since the stacktrace on kretprobe is correctly fixed only on x86, > > this introduces a meta kconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE > > which tells user that the stacktrace on kretprobe is correct or not. > > > > The test results will be shown like below; > > > > TAP version 14 > > 1..1 > > # Subtest: kprobes_test > > 1..6 > > ok 1 - test_kprobe > > ok 2 - test_kprobes > > ok 3 - test_kretprobe > > ok 4 - test_kretprobes > > ok 5 - test_stacktrace_on_kretprobe > > ok 6 - test_stacktrace_on_nested_kretprobe > > # kprobes_test: pass:6 fail:0 skip:0 total:6 > > # Totals: pass:6 fail:0 skip:0 total:6 > > ok 1 - kprobes_test > > So my allmodconfig test failed on this: > > ERROR: modpost: "stack_trace_save_regs" [kernel/test_kprobes.ko] undefined! Oops. > > + /* > > + * Test stacktrace from pt_regs at the return address. Thus the stack > > + * trace must start from the target return address. > > + */ > > + ret = stack_trace_save_regs(regs, stack_buf, STACK_BUF_SIZE, 0); > > + KUNIT_EXPECT_NE(current_test, ret, 0); > > + KUNIT_EXPECT_EQ(current_test, stack_buf[0], target_return_address[1]); > > + > > + return 0; > > +} > > It appears that that "stack_trace_save_regs" is not exported. And this code > can be compiled as a module. Yes, if the selftest is compiled as a module, it has to remove the stack_trace_save_regs(). > > I'm going to continue testing my code, as I have over 40 patches that need > to go into next. I'll just rebase removing this commit only (hopefully > nothing else breaks), and if everything then passes, I'll push to next. OK, let me fix that. Thank you, > > -- Steve -- Masami Hiramatsu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel