Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp625039pxb; Tue, 19 Oct 2021 09:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWy6A6U3Re54hreygs+wVVzAYDmgsHk4uJkf1fkiPafnBrw/vaM4rYs8B+BTUn+9MyWpmR X-Received: by 2002:a05:6a00:2b1:b0:44d:b18:8192 with SMTP id q17-20020a056a0002b100b0044d0b188192mr785636pfs.35.1634661323770; Tue, 19 Oct 2021 09:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634661323; cv=none; d=google.com; s=arc-20160816; b=zsRi4ku/amCnFSmffKrhybPBY8BuC1VhXGABVL0olqwZ7AdfE26k7tvq7uAhLar3Ov wyPet5AiIIC/yTG6KpYmIrdQuI6CDXAKBLLtLUpal65SaeAwXEC2G34R/u99oVNpZKm6 8WO5BE+611hdzAKHQudZGRI4QXFGuAdaXyLdZQVNcy9dVyIHzEnnra+CqNEtF558O1p8 YJqCWqA/DUzDMl3+PzY+XxFe7nMYaCbCbBD0YRqIWgVe1gfAK/aPM8muP3JXzdNHe+Ow hwDClfxMsS6P6L92gTpc+LDRQNX82rQoWUZa92VoJYrVcOku6boYyhueeoMI5GYVmPLu VQRg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TCaiQAdsp/yP0ultE1ja7U5dukag8aaiWQ+V+RSNohM=; b=IvzHzq+jI5nQ36qIpsMOsBZ3fY/ig4oJ/Ma8PcAWTEo4lA/NaeV7EYyJ+o54yHlduZ fzroDkSx8DQA71z7sDx3hL0uePqiv8bUK7B8ZacnLMwjcKU9TK8XQRyUDbw/1+bN5+09 vPFDkj9smnOX3khw1/KdQIiD9Oj5moikCTvC1GSqLd/L9+NtSAdVZVVPiG2nhZZvWYaQ locQuQu748cDPEYzNrUfJ9YqKTdloAIhV3nzvr2MId2f4Od6QpJJpzNWAARnVd3Tprly x9YsSfgC4MB/znhe1ABuh24CurDXu7Lhmt1jS56JqunS6WDhg3OpiKh3VEI0LWHn6fdG WPuA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si437981pgk.359.2021.10.19.09.35.11; Tue, 19 Oct 2021 09:35:23 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234470AbhJSQfr (ORCPT + 99 others); Tue, 19 Oct 2021 12:35:47 -0400 Received: from foss.arm.com ([217.140.110.172]:51624 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234459AbhJSQff (ORCPT ); Tue, 19 Oct 2021 12:35:35 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1F3A1063; Tue, 19 Oct 2021 09:33:22 -0700 (PDT) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 668223F694; Tue, 19 Oct 2021 09:33:21 -0700 (PDT) From: Suzuki K Poulose To: will@kernel.org, mathieu.poirier@linaro.org Cc: catalin.marinas@arm.com, anshuman.khandual@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, maz@kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Suzuki K Poulose Subject: [PATCH v6 06/15] coresight: trbe: Add a helper to pad a given buffer area Date: Tue, 19 Oct 2021 17:31:44 +0100 Message-Id: <20211019163153.3692640-7-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20211019163153.3692640-1-suzuki.poulose@arm.com> References: <20211019163153.3692640-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor the helper to pad a given AUX buffer area to allow "filling" ignore packets, without moving any handle pointers. This will be useful in working around errata, where we may have to fill the buffer after a session. Cc: Mathieu Poirier Cc: Mike Leach Cc: Leo Yan Reviewed-by: Anshuman Khandual Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-trbe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 54f5d61ee9fb..e3767f21ee68 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -199,12 +199,18 @@ static void trbe_stop_and_truncate_event(struct perf_output_handle *handle) * consumed from the user space. The enabled TRBE buffer area is a moving subset of * the allocated perf auxiliary buffer. */ + +static void __trbe_pad_buf(struct trbe_buf *buf, u64 offset, int len) +{ + memset((void *)buf->trbe_base + offset, ETE_IGNORE_PACKET, len); +} + static void trbe_pad_buf(struct perf_output_handle *handle, int len) { struct trbe_buf *buf = etm_perf_sink_config(handle); u64 head = PERF_IDX2OFF(handle->head, buf); - memset((void *)buf->trbe_base + head, ETE_IGNORE_PACKET, len); + __trbe_pad_buf(buf, head, len); if (!buf->snapshot) perf_aux_output_skip(handle, len); } -- 2.25.4