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 5724D606A327 for ; Mon, 30 Nov 2026 11:00:23 +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=bnOill3A; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=XU2XS+GT 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=T802uOvhUJiiddyWWOvCQLtPHSY3E7/pFrV3qefeez4=; b=bnOill3Am6+Q7taCHcFvuU/+C2 jki21r/u4mPKRJhIU6DxrlyviLUZ9rCIHPsASrSNjGi92HbiuDbWQY/08IcXxcXkSD1Nv0VA+vCbb YnbeEmdfF9lEbDD4qQtj3f8RiCPR0mO7UgOU+49ZR4mDk5G+ChG8q3Wl+NgSQ3XxAyt/cAjz7WcSy GCN5yjG42DCqbvB9E6dHxPTK4fLjs12E1qzJ+bQC/9ka1JyxffMnk0AzBJ04CVYzJqh433ZgR/lxX KHPmUeN5Ni1m8m6mpUt7s7ZA/MWle8AW7z8eUEUYWF1LlX0gsOc+y9CL8wVDwf/o4hBSodHys4ZD6 TIxCs05A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXz3T-00000004Dv5-466I; Mon, 30 Nov 2026 10:56:21 +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 1xXz3Q-00000004DuM-14nW for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 10:56:18 +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 4630E1570; Mon, 30 Nov 2026 02:56:12 -0800 (PST) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ABDBC3F86F; Mon, 30 Nov 2026 02:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796036175; bh=WUYUlS4AC5dQawdVfGd4+ziNIyQxnIIlY0NaxLGdOpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XU2XS+GTwQ4Nk0UjarCg6I6or9qVQEJXb6a5pu3fkqu+nT8w7nSLV1v3mfiK7UXaI c7t5Ydlpim3ndgllPjwCuGw5gCo7YqyERUMKs6sKXJoqzugFwkF2CqFHmCNPbUAoml gY4mvEQQ2rCbYLbn6jMQBxg69M0dYl0L4O2FxMJ4= Date: Mon, 30 Nov 2026 10:56:12 +0000 From: Leo Yan To: James Clark Cc: Ping Li , robh@kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, mark.rutland@arm.com Subject: Re: [PATCH v2 1/2] perf: arm_spe: Validate the inverse event filter against PMSNEVFR_EL1 Message-ID: <20261130105612.GK861809@e132581.arm.com> References: <20261130061331.90095-1-leeonion.muyu@gmail.com> <20261130061331.90095-2-leeonion.muyu@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_025616_335757_9F158768 X-CRM114-Status: GOOD ( 19.86 ) 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 10:42:48AM +0000, James Clark wrote: > On 30/11/2026 06:13, Ping Li wrote: > > config3 is validated against the mask probed from PMSEVFR_EL1, even > > though it is written verbatim to PMSNEVFR_EL1. Implementations are > > expected to use the same bit positions for the two registers, but the > > borrowed mask also lets an invalid config pass the early check when > > FEAT_INV_FILT_EVT is absent, deferring the error to the later > > PMSFCR_EL1.FnE feature check. When read v1, I thought pmsnevfr_res0 could prevent the inverse event filter from being configured when FEAT_INV_FILT_EVT is not supported. However, the current driver already prevents this in event init: if ((FIELD_GET(PMSFCR_EL1_FnE, reg)) && !(spe_pmu->features & SPE_PMU_FEAT_INV_FILT_EVT)) return -EOPNOTSUPP; > > Probe the supported filter bits of PMSNEVFR_EL1 separately and > > validate config3 against its own mask. Keep a full mask when the > > feature is not implemented so that any attempt to use the inverse > > event filter is rejected at the earliest opportunity. > > > > Fixes: 8d9190f00a975 ("perf: arm_spe: Add support for SPEv1.2 inverted event filtering") > > I don't think this actually fixes anything or is required. The ARM states > that the availability of filters are based on the existence of the same > events and features for both inverted and non inverted filters. The pseudo > code also uses a single mask variable to define both filters. > > Unless you can show some specific exception? Based on above, I agreed this patch is not quite useful. Thanks, Leo