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 9F05DC46467 for ; Mon, 7 Feb 2022 15:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384701AbiBGPnt (ORCPT ); Mon, 7 Feb 2022 10:43:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241112AbiBGPj3 (ORCPT ); Mon, 7 Feb 2022 10:39:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A57C0401CA for ; Mon, 7 Feb 2022 07:39:28 -0800 (PST) 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 E29FFB815C8 for ; Mon, 7 Feb 2022 15:39:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29087C004E1; Mon, 7 Feb 2022 15:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644248365; bh=1DQ+ee9g1kPRpknTH9hCM9jJ9V2o/CPiuwSx/K5V5x4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dIL+arbBgvnsxXrL9Zdz0tDdM0fM1KQIMILvSSA254Zf8aDJx0Ic/3o4oxVspdfVB +DuZ9T30eNoE42XnVZek54hoj/UqqFHjsm9JiqL2lbZysDpqSWNSSZJNu1B0gNgprn wxrmxR0yhc9zfv28Xi/PbzJRvfYfWIqGVR8CSZUuPrGe1Kmg1BJWyO+Rj4ezk3+zK2 Ayjr0IEywBbaluqIQqb7EXJ58AkzJGVbCZY+7eypPawZCywPq6J4zSdHn5W8T9gsrL 5ukcdahGpfqZTmkvQGYMYLpwXOJDWa4aJBST9UubwvfrMSUul7C7vru9mvfpNDJmPH lp2Aq4Xes/4eg== Date: Mon, 7 Feb 2022 23:31:41 +0800 From: Jisheng Zhang To: ChangbinCONFIG_IRQSOFF_TRACER Du Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] riscv: fix oops caused by irq on/off tracer Message-ID: References: <20220129004226.32868-1-changbin.du@gmail.com> <20220207123850.l4r5qjswaegwisbx@mail.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220207123850.l4r5qjswaegwisbx@mail.google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 07, 2022 at 08:38:50PM +0800, ChangbinCONFIG_IRQSOFF_TRACER Du wrote: > On Mon, Feb 07, 2022 at 01:25:03AM +0800, Jisheng Zhang wrote: > > On Sat, Jan 29, 2022 at 08:42:26AM +0800, Changbin Du wrote: > > > The trace_hardirqs_on/off requires at least two parent call frames. > > > If not, the code generated by CALLER_ADDR1 (aka. ftrace_return_address(1)) > > > could trigger memory access fault. > > > > > > [ 0.039615][ T0] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 > > > [ 0.041925][ T0] Oops [#1] > > > [ 0.042063][ T0] Modules linked in: > > > [ 0.042864][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-rc1-00233-g9a20c48d1ed2 #29 > > > [ 0.043568][ T0] Hardware name: riscv-virtio,qemu (DT) > > > [ 0.044343][ T0] epc : trace_hardirqs_on+0x56/0xe2 > > > [ 0.044601][ T0] ra : restore_all+0x12/0x6e > > > [ 0.044721][ T0] epc : ffffffff80126a5c ra : ffffffff80003b94 sp : ffffffff81403db0 > > > [ 0.044801][ T0] gp : ffffffff8163acd8 tp : ffffffff81414880 t0 : 0000000000000020 > > > [ 0.044882][ T0] t1 : 0098968000000000 t2 : 0000000000000000 s0 : ffffffff81403de0 > > > [ 0.044967][ T0] s1 : 0000000000000000 a0 : 0000000000000001 a1 : 0000000000000100 > > > [ 0.045046][ T0] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 > > > [ 0.045124][ T0] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000054494d45 > > > [ 0.045210][ T0] s2 : ffffffff80003b94 s3 : ffffffff81a8f1b0 s4 : ffffffff80e27b50 > > > [ 0.045289][ T0] s5 : ffffffff81414880 s6 : ffffffff8160fa00 s7 : 00000000800120e8 > > > [ 0.045389][ T0] s8 : 0000000080013100 s9 : 000000000000007f s10: 0000000000000000 > > > [ 0.045474][ T0] s11: 0000000000000000 t3 : 7fffffffffffffff t4 : 0000000000000000 > > > [ 0.045548][ T0] t5 : 0000000000000000 t6 : ffffffff814aa368 > > > [ 0.045620][ T0] status: 0000000200000100 badaddr: 00000000000000f8 cause: 000000000000000d > > > [ 0.046402][ T0] [] restore_all+0x12/0x6e > > > > > > > Hi Changbin, > > > > Could you please provide the reproduce steps? It looks a bit > > interesting. > > > Just enable CONFIG_IRQSOFF_TRACER and rebuild kernel with llvm. Then boot the > new kernel. Thanks for the information. I tried IRQSOFF_TRACER with gcc+binutils, can't reproduce the issue. I forget to try clang+llvm. From another side The fact that gcc+bintuils can't reproduce it means this is a clang+llvm speicial case, no? 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 D8775C433EF for ; Mon, 7 Feb 2022 16:07:17 +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=XXGz/6hN5PCFMCU0gcEfIAt1E1UbXaPVLnYrOFuKCaU=; b=RbPLO104U1Jn+j X6vSAh6Uvm7jfV7GnEXErWOaL7upOinsPVm1IVftc2gO+pfLula5ZfbcKTHNqBew69iujMFQ0llwt CxvtduJK49kZ5rCQzIYC/8rlid8Xk5V7mYUgv7J7/c1TBaan9CExopIiNgKBKLBfNuZYgPL+wMS0A ICDYqiFRoxQzkGNfPEfrcb3hsVwjMcom/DIVEGO1ErxgeLrTi1sZ3a0XTR6Oy1VVEmJvcWsLlzAkz iUkLDHqWIKCzEzQaRCwaV738r8ZC8UTq9dvWq9EGcaSnNNAdUGdutjP9A8bnt15+mBUJTCKB3F4Fu 8RNe97fSjyQ7GvD6zJRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH6Xl-00AyW8-4Q; Mon, 07 Feb 2022 16:07:09 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH66y-00Amxh-4o for linux-riscv@lists.infradead.org; Mon, 07 Feb 2022 15:39: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 C6357B815C3; Mon, 7 Feb 2022 15:39:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29087C004E1; Mon, 7 Feb 2022 15:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644248365; bh=1DQ+ee9g1kPRpknTH9hCM9jJ9V2o/CPiuwSx/K5V5x4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dIL+arbBgvnsxXrL9Zdz0tDdM0fM1KQIMILvSSA254Zf8aDJx0Ic/3o4oxVspdfVB +DuZ9T30eNoE42XnVZek54hoj/UqqFHjsm9JiqL2lbZysDpqSWNSSZJNu1B0gNgprn wxrmxR0yhc9zfv28Xi/PbzJRvfYfWIqGVR8CSZUuPrGe1Kmg1BJWyO+Rj4ezk3+zK2 Ayjr0IEywBbaluqIQqb7EXJ58AkzJGVbCZY+7eypPawZCywPq6J4zSdHn5W8T9gsrL 5ukcdahGpfqZTmkvQGYMYLpwXOJDWa4aJBST9UubwvfrMSUul7C7vru9mvfpNDJmPH lp2Aq4Xes/4eg== Date: Mon, 7 Feb 2022 23:31:41 +0800 From: Jisheng Zhang To: ChangbinCONFIG_IRQSOFF_TRACER Du Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] riscv: fix oops caused by irq on/off tracer Message-ID: References: <20220129004226.32868-1-changbin.du@gmail.com> <20220207123850.l4r5qjswaegwisbx@mail.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220207123850.l4r5qjswaegwisbx@mail.google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220207_073928_505022_D465F362 X-CRM114-Status: GOOD ( 15.75 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Feb 07, 2022 at 08:38:50PM +0800, ChangbinCONFIG_IRQSOFF_TRACER Du wrote: > On Mon, Feb 07, 2022 at 01:25:03AM +0800, Jisheng Zhang wrote: > > On Sat, Jan 29, 2022 at 08:42:26AM +0800, Changbin Du wrote: > > > The trace_hardirqs_on/off requires at least two parent call frames. > > > If not, the code generated by CALLER_ADDR1 (aka. ftrace_return_address(1)) > > > could trigger memory access fault. > > > > > > [ 0.039615][ T0] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 > > > [ 0.041925][ T0] Oops [#1] > > > [ 0.042063][ T0] Modules linked in: > > > [ 0.042864][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-rc1-00233-g9a20c48d1ed2 #29 > > > [ 0.043568][ T0] Hardware name: riscv-virtio,qemu (DT) > > > [ 0.044343][ T0] epc : trace_hardirqs_on+0x56/0xe2 > > > [ 0.044601][ T0] ra : restore_all+0x12/0x6e > > > [ 0.044721][ T0] epc : ffffffff80126a5c ra : ffffffff80003b94 sp : ffffffff81403db0 > > > [ 0.044801][ T0] gp : ffffffff8163acd8 tp : ffffffff81414880 t0 : 0000000000000020 > > > [ 0.044882][ T0] t1 : 0098968000000000 t2 : 0000000000000000 s0 : ffffffff81403de0 > > > [ 0.044967][ T0] s1 : 0000000000000000 a0 : 0000000000000001 a1 : 0000000000000100 > > > [ 0.045046][ T0] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 > > > [ 0.045124][ T0] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000054494d45 > > > [ 0.045210][ T0] s2 : ffffffff80003b94 s3 : ffffffff81a8f1b0 s4 : ffffffff80e27b50 > > > [ 0.045289][ T0] s5 : ffffffff81414880 s6 : ffffffff8160fa00 s7 : 00000000800120e8 > > > [ 0.045389][ T0] s8 : 0000000080013100 s9 : 000000000000007f s10: 0000000000000000 > > > [ 0.045474][ T0] s11: 0000000000000000 t3 : 7fffffffffffffff t4 : 0000000000000000 > > > [ 0.045548][ T0] t5 : 0000000000000000 t6 : ffffffff814aa368 > > > [ 0.045620][ T0] status: 0000000200000100 badaddr: 00000000000000f8 cause: 000000000000000d > > > [ 0.046402][ T0] [] restore_all+0x12/0x6e > > > > > > > Hi Changbin, > > > > Could you please provide the reproduce steps? It looks a bit > > interesting. > > > Just enable CONFIG_IRQSOFF_TRACER and rebuild kernel with llvm. Then boot the > new kernel. Thanks for the information. I tried IRQSOFF_TRACER with gcc+binutils, can't reproduce the issue. I forget to try clang+llvm. From another side The fact that gcc+bintuils can't reproduce it means this is a clang+llvm speicial case, no? _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv