From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 993F1311959; Tue, 28 Apr 2026 06:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777358036; cv=none; b=BUXkFd1hS3fhiuin8P0fPW6p9EKEorpQQa36sMBFuQgpEtfkgRCWj5zZ4VHH7YZdKtjoze36XuFLwmJ3E1wOB+gElrEr74Xn+Mq2mIJl6CNyy3PDiDoaTD1PtnECuRuRCVhgt5GgrO9Cpvpq2+YBSeO85NipyvnFZGQFSF5TpLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777358036; c=relaxed/simple; bh=YWZkQJ9h/l4InQ9uofXyJ+ye5Z9Xuqt0qS0AfrrKrA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FU+R57A+0GFecUVn29xaKxskGtzlqx3qEA0jQFqlczTZ51vq1jjAkjoLh6n/coKT4bMNxVcK1veSz6IbKzr1YeHrAhTGtcRYm3Iy16tJXGA9QA1LpFMFO7o3/WA78MY4LuLUtWrYidU4tq3aqQ5/tTzTFz7FUp156vLpucAyukc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=S2Xn++cF; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="S2Xn++cF" 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 CE0B11684; Mon, 27 Apr 2026 23:33:46 -0700 (PDT) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DA0303F763; Mon, 27 Apr 2026 23:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1777358032; bh=YWZkQJ9h/l4InQ9uofXyJ+ye5Z9Xuqt0qS0AfrrKrA0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S2Xn++cFmmQu5248cOji44fY/eMi8BJevcEh3M2220AM7CaQvnqARY5FplvC+PS10 4iz+okyCYpf0DlRtOwQYdzny5aSVGEYjdCRYKEDiF5c70/sYXZmuYUcqlHelxcYqf1 KRe3lPH1nJVHXIoAJjsZr9rXaNM3RhkobsAhrKeY= Date: Tue, 28 Apr 2026 07:33:49 +0100 From: Leo Yan To: "Yingchao Deng (Consultant)" Cc: Yingchao Deng , Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jinlong Mao , Tingwei Zhang , Jie Gan Subject: Re: [PATCH v8 1/4] coresight: cti: Convert trigger usage fields to dynamic bitmaps and arrays Message-ID: <20260428063349.GD16537@e132581.arm.com> References: <20260426-extended-cti-v8-0-23b900a4902f@oss.qualcomm.com> <20260426-extended-cti-v8-1-23b900a4902f@oss.qualcomm.com> <20260427165913.GA16537@e132581.arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Apr 28, 2026 at 10:25:11AM +0800, Yingchao Deng (Consultant) wrote: [...] > > tg->used_mask = bitmap_zalloc(nr_filter_sigs, GFP_KERNEL); > "nr_filter_sigs" is the count of entries in the DT property array, if the DT > property is: >     arm,trig-filters = <22 23>; > Here nr_filter_sigs=2, so bitmap_zalloc(2) allocates only 1 unsigned long > (64 bits). set_bit(22/23, used_mask) still fits, but it's logically an OOB, > and any index >=64 would > write past the end. Thanks for explanation. It is correct for me.