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 637C7C4332F for ; Fri, 19 Nov 2021 14:17:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B7E261261 for ; Fri, 19 Nov 2021 14:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235794AbhKSOUg convert rfc822-to-8bit (ORCPT ); Fri, 19 Nov 2021 09:20:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:58308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235781AbhKSOUf (ORCPT ); Fri, 19 Nov 2021 09:20:35 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF1DD619E3; Fri, 19 Nov 2021 14:17:33 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mo4hn-006Ys1-Tk; Fri, 19 Nov 2021 14:17:32 +0000 Date: Fri, 19 Nov 2021 14:17:31 +0000 Message-ID: <878rxk6xhg.wl-maz@kernel.org> From: Marc Zyngier To: Sai Prakash Ranjan Cc: Will Deacon , , Catalin Marinas , , , , , , , , Prasad Sodagudi Subject: Re: [PATCHv4 1/2] tracing: Add register read/write tracing support In-Reply-To: <6148397c-0565-d1ca-2f53-d15adcb9b6b8@quicinc.com> References: <4bd519d008cac6b319be7c5ce144e741f7210031.1636973694.git.quic_saipraka@quicinc.com> <87bl2g6z2v.wl-maz@kernel.org> <6148397c-0565-d1ca-2f53-d15adcb9b6b8@quicinc.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: quic_saipraka@quicinc.com, will@kernel.org, rostedt@goodmis.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, gregkh@linuxfoundation.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, psodagud@codeaurora.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Nov 2021 14:07:09 +0000, Sai Prakash Ranjan wrote: > > On 11/19/2021 7:13 PM, Marc Zyngier wrote: > > On Mon, 15 Nov 2021 11:33:29 +0000, > > Sai Prakash Ranjan wrote: > >> From: Prasad Sodagudi > >> [...] > >> Reason why we wouldn't need value along with mmio write log is > >> that value can be easily deduced from the caller_name+offset which is > >> printed already by the rwmmio trace events which gives the exact > >> location of mmio writes and the value is easily known from the driver. > > That's a very narrow view of what can be written in an MMIO > > registers. We write dynamic values at all times, and if we are able to > > trace MMIO writes, then the value written out must be part of the trace. > > > > I'd rather you try and get to the bottom of this issue rather than > > paper over it. > > > > Thanks, > > > > M. > > > > Sure, idea was to put it out in the open if anyone has any idea as > to what might be happening there since the version where directly > instrumenting the raw read/write accessors in arm64/asm/io.h was > working fine casting doubts if this has to do something with > inlining as Arnd mentioned before. Yup. I wouldn't be surprised if MMIO accessors were getting directly inlinedĀ at the wrong location and creating havoc. For example: writel(readl(addr1) | 1, addr2); If you're not careful about capturing the result of the read rather than the read itself, you can end-up with something really funky. No idea if that's what is happening, but a disassembly of the generated code could tell you. M. -- Without deviation from the norm, progress is not possible.