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: <5c811875-aeab-183c-858f-298013741c60@linux.intel.com>
Date:   Fri, 1 Sep 2023 13:37:00 +0300 (EEST)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Shravan Kumar Ramani <shravankr@...dia.com>
cc:     Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        Vadim Pasternak <vadimp@...dia.com>,
        David Thompson <davthompson@...dia.com>,
        platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/3] platform/mellanox: mlxbf-pmc: Add support for
 BlueField-3

On Fri, 1 Sep 2023, Shravan Kumar Ramani wrote:

> Add new access mechanism and list of supported events to program
> and read the counters in BlueField-3.
> Performance counter blocks being added for BlueField-3 include:
>   - Memory Sub-system (mss) which has counters for monitoring
> various DRAM and related skylib events
>   - Last level Tile, which has 2 sets of counters (llt, llt_miss)
> for monitoring Tile and cache metrics
> 
> Signed-off-by: Shravan Kumar Ramani <shravankr@...dia.com>
> Reviewed-by: Vadim Pasternak <vadimp@...dia.com>
> Reviewed-by: David Thompson <davthompson@...dia.com>
> ---
>  drivers/platform/mellanox/mlxbf-pmc.c | 685 ++++++++++++++++++++++++--
>  1 file changed, 653 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c
> index 2d4bbe99959e..ddd91f298721 100644
> --- a/drivers/platform/mellanox/mlxbf-pmc.c
> +++ b/drivers/platform/mellanox/mlxbf-pmc.c

> @@ -712,6 +1160,42 @@ static int mlxbf_pmc_program_l3_counter(int blk_num, uint32_t cnt_num,
>  	return mlxbf_pmc_write(pmcaddr, MLXBF_PMC_WRITE_REG_32, *wordaddr);
>  }
>  
> +/* Method to handle crspace counter programming */
> +static int mlxbf_pmc_program_crspace_counter(int blk_num, uint32_t cnt_num,
> +					     uint32_t evt)
> +{
> +	uint32_t word;
> +	void *addr;
> +	int ret;
> +
> +	addr = pmc->block[blk_num].mmio_base + (rounddown(cnt_num, 2) * 4);


> +	addr = pmc->block[blk_num].mmio_base +
> +		MLXBF_PMC_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) +
> +		(cnt_num * 4);


> +	status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base +
> +		MLXBF_PMC_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) +
> +		(cnt_num * 4), &value);


> +	addr = pmc->block[blk_num].mmio_base + (rounddown(cnt_num, 2) * 4);

Should those * 4 be sizeof(something) or defined?


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ