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 1B097C433EF for ; Sun, 17 Oct 2021 12:38:08 +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 D41E861054 for ; Sun, 17 Oct 2021 12:38:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D41E861054 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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: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=lfFkbrZUrYpaZCN1QE4i+HXSsI7wZeY9mGGtvAvCqbw=; b=z1U6J56gUPWidA wMqWWsB361/trjtyoSbCJon3vXR8u2JYmrQHh954I8Uj/KzFxoCRhN9jw3drYNmJichJEl9jFgJGe oGNLAA7DRxE2cz2UqibbeHv50kZuNQWS608Y6Shj1Wdxu2XDlU/ltHk6KuYdBQwBKjW8on8YWGRjt RT5X5JX7fR/fOIM8o6iWPNcU2/xV8f56Q6mnJwxOeUE4BrNHHG1EgwHN7OxY6DMY+OOoF85Ax6uhY UJbwZfIHC/5x+4tTdN7rbw+NNoepsbsqKOUK3hpBUUYrC6WerrWADgDKP3PkWDR/yK2PZBdsr8+9Z Hj4S+/W1Rs5XucAHtK8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mc5PO-00COYj-27; Sun, 17 Oct 2021 12:36:58 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mc5PI-00COXB-Vo for linux-arm-kernel@lists.infradead.org; Sun, 17 Oct 2021 12:36:54 +0000 Received: by mail-pl1-x635.google.com with SMTP id 21so9379860plo.13 for ; Sun, 17 Oct 2021 05:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oPvgJePPPBGbk8CW4Cm7B5m1/jymObsgz0pZkmP9Ef4=; b=lp3WHIE32fPaO3XawzQCwVOWXW5PLHElCa8VcFcbpcVoQFDVeONnA2Kbrj2yevKHwP bGPzLFHE8Zs6iJ+1Ar1XM/IT+sX8mch/4stT3BrVKql4fWFc+FWXSgKLUm+fItxiyI6Y JQSocx8NHvtdy9o8JXvXvn0nKjX2bpwlygGAQVtnzzjy3Au97jwb97d2OhiphKTFw8jr Gj2Wj71i22U+563cE+Jeu4hP9M3ZZi9mBl4Ip/6kh16GRZhR7dJQnpd09t3CA8jIzc61 1nNDgkcF6FiDRkTlSlLyX2cHsXGzYnudulqt+nZSbTf2yLCuvbWlopx5E1wIjo6RTNR7 a/6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oPvgJePPPBGbk8CW4Cm7B5m1/jymObsgz0pZkmP9Ef4=; b=ydYlbmgDZDFSUWf9dI8HQ1WZX/2G1Mx9QDblI7WPuqCVZo6ouM7rR9AGTWLGJtEBkh NqS2JG4Mk6r8prUfbtcBpdcglg059vbTkrfOoa3Vfuny4bx0c0MHtLqApjtzmuXvobKO CpEghtTALJX7ZsOJuVTTE+3hLm55PFSQntykASWigVurxZENTxnfhc+xMmkAvrJtdZaa 4pStkoGQDfZF8i+oWWdcL/bBL1n4tfUM5/N96pX6toHTd8dXwIU7DmD1aDt4o6/bgKvj tVU1zOQc7x9Q3Zpma1m2njnvmY64LcJ0J+u3EWo4bZqDkMcYxyXZqUHSUYdniSaJZHiF d8SA== X-Gm-Message-State: AOAM5319SmZx+vZQctBcM6oG7MnhgQ70M7ahPUtZE9HEl78KXkyo2WgJ 5CyB7VPA9utUCjiIpf2SG5Vzyg== X-Google-Smtp-Source: ABdhPJwz2fdpS5sQkuZLqAK1HrQMi++7H83aRWHfRxdAe96fuAfHWyHJmMCI7Vmzx88o2V/ndJc8wQ== X-Received: by 2002:a17:90b:3809:: with SMTP id mq9mr26762607pjb.7.1634474212020; Sun, 17 Oct 2021 05:36:52 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([148.163.172.147]) by smtp.gmail.com with ESMTPSA id 21sm16373500pjg.57.2021.10.17.05.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Oct 2021 05:36:51 -0700 (PDT) Date: Sun, 17 Oct 2021 20:36:46 +0800 From: Leo Yan To: German Gomez Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, John Garry , Will Deacon , Mathieu Poirier , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mike Leach , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: Re: [PATCH 4/5] perf arm-spe: Implement find_snapshot callback Message-ID: <20211017123646.GC130233@leoy-ThinkPad-X240s> References: <20210916154635.1525-1-german.gomez@arm.com> <20210916154635.1525-4-german.gomez@arm.com> <20211017120546.GB130233@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211017120546.GB130233@leoy-ThinkPad-X240s> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211017_053653_079182_2C3B2F8D X-CRM114-Status: GOOD ( 18.52 ) 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 Sun, Oct 17, 2021 at 08:05:46PM +0800, Leo Yan wrote: [...] > To allow arm_spe_buffer_has_wrapped() to work properly, I think we > need to clean up the top 8 bytes of the AUX buffer in Arm SPE driver > when start the PMU event (please note, this change has an assumption > that is meantioned in another email that suggests to remove redundant > PERF_RECORD_AUX events so the function arm_spe_perf_aux_output_begin() > is invoked only once when start PMU event, so we can use the top 8 > bytes in AUX buffer to indicate trace is wrap around or not). > > > diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c > index d44bcc29d99c..eb35f85d0efb 100644 > --- a/drivers/perf/arm_spe_pmu.c > +++ b/drivers/perf/arm_spe_pmu.c > @@ -493,6 +493,16 @@ static void arm_spe_perf_aux_output_begin(struct perf_output_handle *handle, > if (limit) > limit |= BIT(SYS_PMBLIMITR_EL1_E_SHIFT); > > + /* > + * Cleanup the top 8 bytes for snapshot mode; these 8 bytes are > + * used to indicate if trace data is wrap around if they are not > + * zero. > + */ > + if (buf->snapshot) { > + void *tail = buf->base + (buf->nr_pages << PAGE_SHIFT) - 8; > + memset(tail, 0x0, 8); Here need to add below code for flushing data cache: flush_dcache_range((unsigned long)tail, (unsigned long)tail+8); Sorry for spamming. Leo > + } > + > limit += (u64)buf->base; > base = (u64)buf->base + PERF_IDX2OFF(handle->head, buf); > write_sysreg_s(base, SYS_PMBPTR_EL1); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel