Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5876981pxu; Wed, 23 Dec 2020 07:37:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwM8p4DYbjadQFQIerSVYewc9UgMhxEdGkEuBwQ1iiOrK1RBfzyGXOqIenKH/N0aDwUYCJ X-Received: by 2002:a05:6402:312c:: with SMTP id dd12mr25600482edb.327.1608737870059; Wed, 23 Dec 2020 07:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608737870; cv=none; d=google.com; s=arc-20160816; b=kPjjuu5ThsSCv1k5XJG2kaHaJ6nJA9TWEnL2Ru9jvGd6Dth/+InUH4rYqmLtpGaANJ PPEEc+qT4bl24GQkW4dtX9bO12y1eHtECh7WB7egvWsQLF+zKrcRMmYw3qVwpoXLEL2X CxAcdcwQ+E6RcKMSb/Fiott2n10Ph2sytCBDkNFHMIdycy9wLQ98eJl0iLJ4H2QRPtP/ DBtoeniDqNx+q2o6+8AO69h2qAn6sqNjQI+7ZWXMpIYGFnm9/MraQ4keuB7DxTfg8Ba2 znHpB3pLgo8o/d3tQo1dlZxb5CQ3bWphmje6BD/ecKHqBsskCrkySishqIsx5Z/p6ftA wBYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ypJKmnRHJMoPzszCEstUFvU+y+nnRqDenT5OCcekfUY=; b=DN/6G/CLhmiIAX8YWDXRo2v94708Dw38S9IDjK5y3kzHf/qInTc8VBkW6c0W55vBeR IZrVkeAPvHyDNihZ24DsmgSTXZTKJjGKcxw4a06L5WV5icdyShe3Y5vPA9v8Urt2oEXA N7jSv3Rsxtozn41dYBxgWDTyqKT0EEqYg6eESqeAjSTMC3yZttZ7rsd+9TR+KTPFik8j QiF6+AXLF7HdMo/ry+0uHqwVIhq4eINtTrYugSDvYMaLs78DLG1P7VljnyIJg095wImI ktpXhUXaMIJL5MdKGbCjMCtDZrgfz7CGOiaNLkXn3l4h4Ml3NllGp49EfAlSSQcw4ZUU AO4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nm1mJICy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si3725710ejc.100.2020.12.23.07.37.27; Wed, 23 Dec 2020 07:37:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nm1mJICy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728544AbgLWPeL (ORCPT + 99 others); Wed, 23 Dec 2020 10:34:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:44870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728350AbgLWPeE (ORCPT ); Wed, 23 Dec 2020 10:34:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B920423370; Wed, 23 Dec 2020 15:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1608737582; bh=RiEJGmvqO4OuLaNqfBxsJGXrbPh5AhWfNVWAHGOaYQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nm1mJICyoB9EwA3LWABFODpouj9JaNLUZtLkjV/yLWke/gd5X++F+wIitRyhzRvnI pCN4qMmegFeqccrBTDX8DYQXHEOrhHrmhthZNVDOiSPMR/Bk/fRlyaCSyOglohEYw4 2BbDke8OjjU7/prcRrK4VCIQntg9OWoA5K2r/QIM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Al Grant , Mike Leach , Suzuki K Poulose Subject: [PATCH 5.10 17/40] coresight: tmc-etr: Fix barrier packet insertion for perf buffer Date: Wed, 23 Dec 2020 16:33:18 +0100 Message-Id: <20201223150516.385258340@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201223150515.553836647@linuxfoundation.org> References: <20201223150515.553836647@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose commit 83be0b84fe846edf0c722fefe225482d5f0d7395 upstream. When the ETR is used in perf mode with a larger buffer (configured via sysfs or the default size of 1M) than the perf aux buffer size, we end up inserting the barrier packet at the wrong offset, while moving the offset forward. i.e, instead of the "new moved offset", we insert it at the current hardware buffer offset. These packets will not be visible as they are never copied and could lead to corruption in the trace decoding side, as the decoder is not aware that it needs to reset the decoding. Fixes: ec13c78d7b45 ("coresight: tmc-etr: Add barrier packets when moving offset forward") Cc: Mathieu Poirier Cc: stable@vger.kernel.org Reported-by: Al Grant Tested-by: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20201208182651.1597945-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1552,7 +1552,7 @@ tmc_update_etr_buffer(struct coresight_d /* Insert barrier packets at the beginning, if there was an overflow */ if (lost) - tmc_etr_buf_insert_barrier_packet(etr_buf, etr_buf->offset); + tmc_etr_buf_insert_barrier_packet(etr_buf, offset); tmc_etr_sync_perf_buffer(etr_perf, offset, size); /*