lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bedcf27e-b273-075f-3d7b-eb99b07e7c91@arm.com>
Date:   Fri, 18 Aug 2023 10:39:18 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        linux-arm-kernel@...ts.infradead.org
Cc:     Mike Leach <mike.leach@...aro.org>,
        James Clark <james.clark@....com>,
        Leo Yan <leo.yan@...aro.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        coresight@...ts.linaro.org, linux-kernel@...r.kernel.org,
        Steve Clevenger <scclevenger@...amperecomputing.com>
Subject: Re: [PATCH V2] coresight: tmc: Make etr buffer mode user configurable
 from sysfs

Cc: Steve

Steve,

Are you able to test this with CATU ?


On 18/08/2023 09:21, Anshuman Khandual wrote:
> Currently TMC-ETR automatically selects the buffer mode from all available
> methods in the following sequentially fallback manner - also in that order.
> 
> 1. FLAT mode with or without IOMMU
> 2. TMC-ETR-SG (scatter gather) mode when available
> 3. CATU mode when available
> 
> But this order might not be ideal for all situations. For example if there
> is a CATU connected to ETR, it may be better to use TMC-ETR scatter gather
> method, rather than CATU. But hard coding such order changes will prevent
> us from testing or using a particular mode. This change provides following
> new sysfs tunables for the user to control TMC-ETR buffer mode explicitly,
> if required. This adds following new sysfs files for buffer mode selection
> purpose explicitly in the user space.
> 
> /sys/bus/coresight/devices/tmc_etr<N>/buf_modes_available
> /sys/bus/coresight/devices/tmc_etr<N>/buf_mode_preferred
> 
> $ cat buf_modes_available
> auto flat tmc-sg catu	------------------> Supported TMC-ETR buffer modes
> 
> $ echo catu > buf_mode_preferred   -------> Explicit buffer mode request
> 
> But explicit user request has to be within supported ETR buffer modes only.
> These sysfs interface files are exclussive to ETR, and hence these are not
> available for other TMC devices such as ETB or ETF etc.
> 
> A new auto' mode (i.e ETR_MODE_AUTO) has been added to help fallback to the
> existing default behaviour, when user provided preferred buffer mode fails.
> ETR_MODE_FLAT and ETR_MODE_AUTO are always available as preferred modes.
> 
> Cc: Suzuki K Poulose <suzuki.poulose@....com>
> Cc: Mike Leach <mike.leach@...aro.org>
> Cc: James Clark <james.clark@....com>
> Cc: Leo Yan <leo.yan@...aro.org>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: coresight@...ts.linaro.org
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
> ---
> This applies on v6.5-rc6
> 
> Changes in V2:
> 
> - Renamed sysfs file etr_buf_modes_available as buf_modes_available
> - Renamed sysfs file buf_mode_current as buf_mode_preferred
> - Renamed etr_supports_flat_mode() as etr_can_use_flat_mode()
> - Renamed coresight_tmc_groups[] as coresight_etf_groups[]
> - Reused coresight_tmc_group[] for trigger_cntr and buffer_size
> - Fallback trying ETR_MODE_AUTO when user preferred mode fails
> - Moved ETR sysfs details into coresight-tmc-etr.c
> - Dropped etr_can_use_flat_mode() check while offering ETR_MODE_FLAT in sysfs
> - Moved struct etr_buf_hw inside coresight-tmc-etr.c
> - Moved get_etr_buf_hw() and etr_can_use_flat_mode() inside coresight-tmc-etr.c
> - Updated month in Documentation/ABI/testing/sysfs-bus-coresight-devices-tmc
> 
> Changes in V1:
> 
> https://lore.kernel.org/all/20230728084837.276551-1-anshuman.khandual@arm.com/
> 
>   .../testing/sysfs-bus-coresight-devices-tmc   |  16 +++
>   .../hwtracing/coresight/coresight-tmc-core.c  |  15 ++-
>   .../hwtracing/coresight/coresight-tmc-etr.c   | 111 ++++++++++++++++--
>   drivers/hwtracing/coresight/coresight-tmc.h   |   3 +
>   4 files changed, 131 insertions(+), 14 deletions(-)


Looks good to me.

Suzuki


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ