Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1665203ybd; Wed, 26 Jun 2019 22:56:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmDRAYGTBpK+c9oEjsXBj8teRPR/FA79jlyWuag4uunfSMw+qjHZb4MaYGFEK1SSZRaFge X-Received: by 2002:a63:1c09:: with SMTP id c9mr2062433pgc.63.1561614983968; Wed, 26 Jun 2019 22:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561614983; cv=none; d=google.com; s=arc-20160816; b=FRfBm2fJYhKnfb6wr4o7b/kZ7AN27PXRflSRdNiN+wbP1gFH2+LcE9pjp07ZyPuvsE qhzALIkt15TSInufpTspJnTvXqEgBc/lp9MrScdXVVx8psdK5a32e1lM9Fx4ORoEzxGu 1tXGbzbq11JQ1wsc2WNfl+wQbfDHyqHPaCARFRacYB9Xtd5vpRgySLUIaEffidrdu8HV jww6g8qRBRRMz7EP8m0CH0F6ftOC+PCkFtIl4aNFPuxndVpwdI49y4o4IggSYxzrAW4F JnQFpqFjoY6P7q+IznguHAoeplo9vEIBttJdJZiNHSI+o8s28U14SMrvFHRZMXXmlj9k euRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=UkgYZ5GGq7vziM41d1TpdONoYMmINR7z/JzuKXRFGEg=; b=y5Zcr3/3+kSehGpY89SMDtsA9l9ORslQsHGThXCAcTcijbPbUDip8JrEn1VL7kZavH xKhS4BVNbrxoZ+5ebFB3PBn/Qs4uJYI+FVJDXvRlJ8oCdZbvFyVzPVQit4Nr5Z5mIuk+ DjVp0UfidkwuhpcltBIHpLe6I/AQc+ojrDcRlaOUcd0QgOJxC+XT+iFjZk98zcHSwVCF ZmscmhnbTunGRvNhHbJ4ZDsLTeJIBNznIsjRX+oVHzEqtiNsa/IkkrJ4Z5GLWffqhgDX cP469TS/6tvIXDP9mHXHqkdB/QX0snIGPpj1r+Rb8P/Xj0CJUCIFYxgUmqfdMaSu8abd OlCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si4034462pjs.3.2019.06.26.22.55.55; Wed, 26 Jun 2019 22:56:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726375AbfF0Fzw (ORCPT + 99 others); Thu, 27 Jun 2019 01:55:52 -0400 Received: from ozlabs.org ([203.11.71.1]:47165 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfF0Fzw (ORCPT ); Thu, 27 Jun 2019 01:55:52 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 45Z8Jh17Szz9s4Y; Thu, 27 Jun 2019 15:55:48 +1000 (AEST) From: Michael Ellerman To: "Naveen N. Rao" , Steven Rostedt , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] recordmcount: Fix spurious mcount entries on powerpc In-Reply-To: <20190626183801.31247-1-naveen.n.rao@linux.vnet.ibm.com> References: <20190626183801.31247-1-naveen.n.rao@linux.vnet.ibm.com> Date: Thu, 27 Jun 2019 15:55:47 +1000 Message-ID: <8736jvtvvg.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Naveen N. Rao" writes: > The recent change enabling HAVE_C_RECORDMCOUNT on powerpc started > showing the following issue: > > # modprobe kprobe_example > ftrace-powerpc: Not expected bl: opcode is 3c4c0001 > WARNING: CPU: 0 PID: 227 at kernel/trace/ftrace.c:2001 ftrace_bug+0x90/0x318 > Modules linked in: > CPU: 0 PID: 227 Comm: modprobe Not tainted 5.2.0-rc6-00678-g1c329100b942 #2 > NIP: c000000000264318 LR: c00000000025d694 CTR: c000000000f5cd30 > REGS: c000000001f2b7b0 TRAP: 0700 Not tainted (5.2.0-rc6-00678-g1c329100b942) > MSR: 900000010282b033 CR: 28228222 XER: 00000000 > CFAR: c0000000002642fc IRQMASK: 0 > > NIP [c000000000264318] ftrace_bug+0x90/0x318 > LR [c00000000025d694] ftrace_process_locs+0x4f4/0x5e0 > Call Trace: > [c000000001f2ba40] [0000000000000004] 0x4 (unreliable) > [c000000001f2bad0] [c00000000025d694] ftrace_process_locs+0x4f4/0x5e0 > [c000000001f2bb90] [c00000000020ff10] load_module+0x25b0/0x30c0 > [c000000001f2bd00] [c000000000210cb0] sys_finit_module+0xc0/0x130 > [c000000001f2be20] [c00000000000bda4] system_call+0x5c/0x70 > Instruction dump: > 419e0018 2f83ffff 419e00bc 2f83ffea 409e00cc 4800001c 0fe00000 3c62ff96 > 39000001 39400000 386386d0 480000c4 <0fe00000> 3ce20003 39000001 3c62ff96 > ---[ end trace 4c438d5cebf78381 ]--- > ftrace failed to modify > [] 0xc0080000012a0008 > actual: 01:00:4c:3c > Initializing ftrace call sites > ftrace record flags: 2000000 > (0) > expected tramp: c00000000006af4c Aha, thanks. I saw that on one of my text boxes but hadn't pinned it down to this commit. > Fixes: c7d64b560ce80 ("powerpc/ftrace: Enable C Version of recordmcount") That commit is the tip of my next, so I'll drop it for now and merge them in the other order so there's breakage. Steve are you OK if I merge this via the powerpc tree? I'll reword the commit message so that it makes sense coming prior to the commit mentioned above. cheers > Signed-off-by: Naveen N. Rao > --- > scripts/recordmcount.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h > index 13c5e6c8829c..47fca2c69a73 100644 > --- a/scripts/recordmcount.h > +++ b/scripts/recordmcount.h > @@ -325,7 +325,8 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, > if (!mcountsym) > mcountsym = get_mcountsym(sym0, relp, str0); > > - if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) { > + if (mcountsym && mcountsym == Elf_r_sym(relp) && > + !is_fake_mcount(relp)) { > uint_t const addend = > _w(_w(relp->r_offset) - recval + mcount_adjust); > mrelp->r_offset = _w(offbase > -- > 2.22.0