From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796050209; b=BrkZnuQmVZnOPZNVy8dbPFgLdayHuFBey4vjVP+H/gQVBsTAsZ4vY0Stbagif6jKPEBD GHVyvdI+zHHfkzZiO7BDcCTXpm6OGNd1gx90XlMhMK6e8WITHnHpp5oCIwUMsBOv8DM5g sSEBT77kraPsrcBusSvdbh1Ol407AHNnco5V1mWU9MPrMpgckEPo2x0Tg87AHfKxoOem5 AerNloXuhlunNUVlWTRtwMBSekPkRWp6nn0svvl3ETpLnnz/nGRIY3Z8vRJ9C1BGIPjde rvZm3UIfsDAC9yCxDF8b8auRdoXGGl6MBtl45iRnnbHeTpdGMqsNpzUe8dZUCnNs2Bw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796050209; h=DMARC-Filter:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=NZfXNr2iXLf2yIyx5BMUuDijn/nbqf8ei8jo472r2DU=; b=aO2NZdnReBlJFDQKQUVX+tP+e8BFJ3mYslRFlJbB30sYYWrqkFLZHZwt8GLgS7tjdogW 1fBlONphANJrODmRURBBXDiZzt73yOlFEMKBKPFqLjiNQe33KXNvMM+Aj3PIk6foPWbtD hntncpoQmf2pP/8IskwKIOzdyMNQiVDX66Sel2EdrAegdz1qq32aOQLYS/slazESZ/38g TTsQD6Y+r2mEQLrZscVSSKyv6OcRFWlovfEXygur/hI4hZYAmIWj9Ynq5FxGOHNa0aJY2 wOeYF4ON9ssrBcOd4Bq/za3PDJFbWMViaD+ihy3cf+P9rTASwfJRYl0zNuBnbQ+lxlg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=Jb9x0Wdd; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82E0F606A33A; Mon, 30 Nov 2026 14:50:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 82E0F606A33A 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.a=rsa-sha256 header.s=foss header.b=Jb9x0Wdd 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 21809152B; Mon, 30 Nov 2026 06:50:06 -0800 (PST) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 79F4B3F7D8; Mon, 30 Nov 2026 06:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796050208; bh=tRN7H3EabcTLjPfDyEEecNLCIM9eLIWPOmHvJ8sXeRU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jb9x0Wdd4ZacQb9gEHcIC0fKsac/dV3HTfCmV1TjE826waaDifEqxCdGOBh70d99T Nj7x6RheSJCnG4G7s+j70LmENtbGOUaqjMc4kG530G+F0oK/6kwoZChGULx5TtJ9Of NintQ7fztGlpK66d+pE8zNU/DBpwNwUXq0El3fN4= Date: Mon, 30 Nov 2026 14:50:06 +0000 From: Leo Yan To: Ping Li Cc: will@kernel.org, mark.rutland@arm.com, robh@kernel.org, james.clark@linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] perf: arm_spe: Validate the data source filter per-bit Message-ID: <20261130145006.GL861809@e132581.arm.com> References: <"20261130104035.GJ861809@e132581.arm.com"> <20261130131748.1487948-1-leeonion.muyu@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130131748.1487948-1-leeonion.muyu@gmail.com> On Mon, Nov 30, 2026 at 09:17:48PM +0800, Ping Li wrote: [...] > Example: inv_data_src_filter=0x8 (exclude source 3, keep the rest) > > config4 = 0x0000000000000008 > written to PMSDSFR_EL1 = ~config4 = 0xfffffffffffffff7 > > reg & pmsdsfr_res0 = 0xfffffffffffffff7 & 0xffffffffffffff00 > = 0xffffffffffffff00 != 0 > -> current check rejects: perf_event_open() fails with > -EOPNOTSUPP > > ~reg & pmsdsfr_res0 = 0x0000000000000008 & 0xffffffffffffff00 > = 0x0000000000000000 == 0 > -> proposed check passes: the session runs, source 3 is > excluded as requested, but sources 8-63 are silently > missing although the config asked to include them > > The crux is the bits the user never explicitly set: with the > inverted ABI, a cleared bit asks for the source to be included, so > inv_data_src_filter=0x8 also asks for sources 8-63 to be included, > and their bits are not implemented. I have different understanding for "inv_data_src_filter=0x8 also asks for sources 8-63 to be included". With 0x8, userspace asks only to exclude data source 3. A clear bit leaves the corresponding source eligible where supported, so I'd validate only the set bits in config4. Thanks, Leo