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: <Zy1oBfroZLBwN6Jf@google.com>
Date: Thu, 7 Nov 2024 17:23:17 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Chun-Tse Shao <ctshao@...gle.com>
Cc: linux-kernel@...r.kernel.org, Greg Thelen <gthelen@...gle.com>,
	Robin Murphy <robin.murphy@....com>,
	Tuan Phan <tuanphan@...amperecomputing.com>,
	Will Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] perf/arm-smmuv3: Fix lockdep assert in ->event_init()

On Thu, Nov 07, 2024 at 09:59:20PM +0000, Chun-Tse Shao wrote:
> Same as
> https://lore.kernel.org/all/20240514180050.182454-1-namhyung@kernel.org/,
> we should skip `for_each_sibling_event()` for group leader since it
> doesn't have the ctx yet.
> 
> Fixes: f3c0eba28704 ("perf: Add a few assertions")
> Reported-by: Greg Thelen <gthelen@...gle.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Robin Murphy <robin.murphy@....com>
> Cc: Tuan Phan <tuanphan@...amperecomputing.com>
> Signed-off-by: Chun-Tse Shao <ctshao@...gle.com>
> ---
>  drivers/perf/arm_smmuv3_pmu.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
> index d5fa92ba8373..09789599fccc 100644
> --- a/drivers/perf/arm_smmuv3_pmu.c
> +++ b/drivers/perf/arm_smmuv3_pmu.c
> @@ -431,6 +431,11 @@ static int smmu_pmu_event_init(struct perf_event *event)
>  			return -EINVAL;
>  	}
>  
> +	hwc->idx = -1;

I think you should update the event->cpu as well.

Thanks,
Namhyung

> +
> +	if (event->group_leader == event)
> +		return 0;
> +
>  	for_each_sibling_event(sibling, event->group_leader) {
>  		if (is_software_event(sibling))
>  			continue;
> @@ -442,8 +447,6 @@ static int smmu_pmu_event_init(struct perf_event *event)
>  			return -EINVAL;
>  	}
>  
> -	hwc->idx = -1;
> -
>  	/*
>  	 * Ensure all events are on the same cpu so all events are in the
>  	 * same cpu context, to avoid races on pmu_enable etc.
> -- 
> 2.47.0.277.g8800431eea-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ