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=1796036176; b=S4dZ30xybpIVah7g37YF0aiSBklmUZon7RpsSxm/nx3ilaihURfooNG4IxEmjL2yUb+5 hzc/2SlLCKnNwL6tIWiggN2StoAnSKL9B152Pf4sO/3H47QQidqn9RoTTtD7qN7DYnCig SlOLElqbVcv0EIMuFRAQvBAEU7UYxECm4z0zrBJ+qAlN1VaecnYbmItDwcKqDaxm5cWEg iiOKs7owMMJWpt6rxJksihVtmChernESI0Zcnk49J+Dt2iPrCt9q/hqYovL1FVJTWsy+9 MbmZl2mWNNWsA/q6viTnNljP1zAyzjJ2zGo4EV3wL/2RrcPUA9i5WiwoZyTQAhnIkkA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036176; 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=T802uOvhUJiiddyWWOvCQLtPHSY3E7/pFrV3qefeez4=; b=Nd9cJE3+YVahJV0VLIUj53M25QKBayN3g3Qc2qk0LJAEHEZOqAqg+1qcPBTDwbDKEN0c SfaTTyvFSdNQeyxn51mJo3IK7Ly8alTVj0tmyElzBj8MaEiiwMMz+TxcU27k0ludFaBvJ 8ttCNbRMjpWQ/uc6Zwm/tnIOC2GHHnZcUr29g1Xe3FYQNELXJcYQe+ua8MEWYh1ZRCSBL IhW2ZJuZ2eX9m61cGT0S2wmIH1/42VHGUX9nK+JNrXyiNETkMApoMUZaze3cMWUxF3w4T DLsAu6vZha1WrXOXa/T66lOsb/ixsyx6kp5NUtMt4RLawTK4+jXw06khtH5TU2rPCBA== 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=XU2XS+GT; 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 A7FF7606A33A; Mon, 30 Nov 2026 10:56:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A7FF7606A33A 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=XU2XS+GT 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-Mailing-List: linux-perf-users@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: 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