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] [day] [month] [year] [list]
Date:   Sun, 1 Oct 2023 09:14:00 +0000
From:   Ofir Bitton <obitton@...ana.ai>
To:     Oded Gabbay <ogabbay@...nel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] accel/habanalabs/gaudi2: fix spmu mask creation

On 28/09/2023 16:25, Oded Gabbay wrote:
> event_types_num received from the user can be 0. In that case, the
> event_mask should be 0.
> 
> In addition, to create a correct mask we need to match the number
> of event types to the bit location such that bit 0 represents a single
> event type, bit 1 represents 2 types and so on.
> 
> Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
> ---
>   drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> index 14a855cdc96b..2423620ff358 100644
> --- a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> +++ b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c
> @@ -2500,7 +2500,8 @@ static int gaudi2_config_spmu(struct hl_device *hdev, struct hl_debug_params *pa
>   		 * set enabled events mask based on input->event_types_num
>   		 */
>   		event_mask = 0x80000000;
> -		event_mask |= GENMASK(input->event_types_num, 0);
> +		if (input->event_types_num)
> +			event_mask |= GENMASK(input->event_types_num - 1, 0);
>   
>   		WREG32(base_reg + mmSPMU_PMCNTENSET_EL0_OFFSET, event_mask);
>   	} else {

Reviewed-by: Ofir Bitton <obitton@...ana.ai>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ