From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A3D3606A333 for ; Mon, 30 Nov 2026 14:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=WKDUTGaw; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=Jb9x0Wdd DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=NZfXNr2iXLf2yIyx5BMUuDijn/nbqf8ei8jo472r2DU=; b=WKDUTGawU0ebU3rIfmzqbJ4yiR qEqxlQszkhenjjUktuvR7PgDX676aookLobat969wzQmd3CpkzbAq3oWAAbjbgcUsv2vuUjGh9l0F LhBDpsWw3fCPkpxlFXTAniJ1oTF2+qDVwZj62NbcqiwUJYxBFUXkI4eDhiygOXc6M4sZOg0D1s8gK 0EA6sawRu/IPfY/wv7HtnQ+/sxY4DU60d3J/AZ+WY0bRr5J0wgdTHOwpl/9mSWrYD6byK3N8QQIUO qmkIT6AjAw6HgDHcLvRobMXI4q0N+ALZUBtzRV5JZXm7nKpiE1z7LzA5VHEk3PuycsbAlyFGtOkNu OLPF3nCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY2iE-00000004xFd-2jz5; Mon, 30 Nov 2026 14:50:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY2hl-00000004x16-2XqN for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 14:50:10 +0000 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130131748.1487948-1-leeonion.muyu@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_065009_695676_95E8FDE3 X-CRM114-Status: GOOD ( 13.13 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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