Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1026026rdb; Fri, 9 Feb 2024 08:09:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNlw8RgS8I1cUW0QC5orp2WDlDt3gGspWsedruvPETlijFh8PwcDER1N0dif54G2cV8K/RdwYtWE5jyurkfFS1S9IxEe0Oh7Vhwpft0Q== X-Google-Smtp-Source: AGHT+IFRm+VqXWedvtpxxtyASBTazpUehWr/iipIo8Kxwlp7IhwxuKZ4WyJJGrMew5dV1Ha10H5b X-Received: by 2002:aa7:d5ce:0:b0:560:c0da:43be with SMTP id d14-20020aa7d5ce000000b00560c0da43bemr1493514eds.11.1707494970954; Fri, 09 Feb 2024 08:09:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707494970; cv=pass; d=google.com; s=arc-20160816; b=RMZvnblCJ+ClELXsH536zpMar9si3w539t9MichL6JY90dH5liFGNKlcjHMWy6aJ2W U5p7i7W8FoPQcvMMMBfrNUJurRPb0a4Yr/YgrMS6w07B5FGbAvrk4uw+3DZVHb/tmLmq J3wYoZ25O4pmRqpKyq/hYQYu8lO/dUVN/OICmv5OY3QBShRVIeCJcbic0j3KOUx+Z+vD ZZFYWKSMCzj2KjyNtf3Gd0GntC8eZ4RBk0pkLuhauB3RGLhNTmEoo++MdXWXRoVFoEAp fpKdIztXKqtDMxV6gFj9G+wh8YMIK6TjQn9yA1XFUu6mNq3goUEsNjkMyUE6UCmQrE6E w/ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=dMEH7fdLOT39ymOwWr6OqZDRLKgK7Atiqo+3tfil5oc=; fh=DSp43JhwutKPCaOMNSMW+QWMJ/WkeMstRq67rqxjnPo=; b=ReLE/Eh3gO2+j0dkN3VKsfr1PlAz/Vs6XMOnNelyXpHRiI3hIpi22dzw3HFyoCRejS DZPxql1FNc7/vCg/zfrxyyBJlff8eeq5LyDKauTbqvRtij4qgnq6oRj6JO0Np4zf2uOT I1tu1CKnxviTdfPcNc08P0VKUfYYsFWZ7WTENViuSU+gH8ZOb07xHD1l4jlQL49jOmKJ MlbLL6lsN2an1dcoOkauNE6Vdmw7mbkJkvJDJ6/mwEYBenPqDKoDws4YwIEnWgBYltoJ X6CQzvZcDHy26F5Oe89eImMVv3es8fCCLmxZ1NSwRig3KJndhDUY+0rMnyw3qFL0EWin swgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uP9XrTny; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWnR2bFGnawHRxGHTullyvUipWFRotIbZte4MDVOwpTWG6hFXFQOMjpaVgszCP/feuSPFq+HWwWdDUjWycZZAPSGhVLsYOXYbwLxU6wGw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r12-20020aa7cfcc000000b005611076d015si1023027edy.47.2024.02.09.08.09.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:09:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uP9XrTny; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B1B991F228B0 for ; Fri, 9 Feb 2024 16:09:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FD7C7AE76; Fri, 9 Feb 2024 16:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uP9XrTny" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 502CD76905 for ; Fri, 9 Feb 2024 16:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707494952; cv=none; b=JunsvH1zTiPXSL5f6WQiBYo8uoDWUvp/71dgrsW9+X8dPnde4uHaF7Zq2kQ8qvGqGy8xAk/KAaXL2TLaUrGATnvLMCZGOka4BSaiaQAmY6XoLya83icKPlUvQqBdEN9vnh52EN36P7lm+xrlGOZTCO7fccyWZplwVhwiLcP1he4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707494952; c=relaxed/simple; bh=IIeM8mUDJ3PXlV91DXOkNDk6nOrCsTSkdnpyBI3x1Wk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fmSDh7P5KJOOaB9PO/aMOrOx9Hz7mA7OWT7509u6aX4TXmyz6c5+lmNxgZNDYmxsdtnbD6hNEguaG+ZDeSLHpbfb01Mcftu8iYHYUmaBVpPbzeI3xSoIoSpG86t38oh9J1J/JOPaOKUpKRQuARIsPSouvSCL0d1ebGnD/seWzOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uP9XrTny; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 606B3C43394; Fri, 9 Feb 2024 16:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707494950; bh=IIeM8mUDJ3PXlV91DXOkNDk6nOrCsTSkdnpyBI3x1Wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uP9XrTnyr9qUDII1Mg3xLEN2Oj5dAMy7n5EQjxWepL0lf7fp7+cflG4Lr5+OTLBHX j7m3sd6nVmHFx2gTbgvllQfhXDKkpmMENr2gHzNj1mLWwlpRIDVG7CfnUbnlxllgkF 2Z3P/oe0gAKOh4usYMxJPXmLNspwMTxaxIP/aCHV7e6cGRLgL+hhvY8St+tnWOnO8C /I9Xe8QfELQKiz9c8xpBfqNEWPRK+n3J5D7+eJkMfHwDhxZC9hrB28mlHTThzr+j7i iZZp/fDrKW/Ov44NOi6dv7xRKlGPBb3t8fIVwbrBPN73PVgORrT0tkvsw55sWghEhL O7ftIXFjyq/0g== Date: Fri, 9 Feb 2024 16:09:06 +0000 From: Will Deacon To: "JiaLong.Yang" Cc: Mark Rutland , shenghui.qu@shingroup.cn, ke.zhao@shingroup.cn, zhijie.ren@shingroup.cn, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf/arm_smmuv3: Omit the two judgements which done in framework Message-ID: <20240209160905.GA24565@willie-the-truck> References: <20231221093802.20612-1-jialong.yang@shingroup.cn> 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=us-ascii Content-Disposition: inline In-Reply-To: <20231221093802.20612-1-jialong.yang@shingroup.cn> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Dec 21, 2023 at 05:38:01PM +0800, JiaLong.Yang wrote: > 'event->attr.type != event->pmu->type' has been done in > core.c::perf_init_event() ,core.c::perf_event_modify_attr(), etc. > > This PMU is an uncore one. The core framework has disallowed > uncore-task events. So the judgement to event->cpu < 0 is no mean. It would be great to refer to the changes which added those checks to the perf core code. From reading the code myself, I can't convince myself that perf_try_init_event() won't call into the driver. > > The two judgements have been done in kernel/events/core.c > > Signed-off-by: JiaLong.Yang > --- > drivers/perf/arm_smmuv3_pmu.c | 8 -------- > 1 file changed, 8 deletions(-) It looks like _many_ perf drivers have these checks, so if they really aren't needed, we can clean this up bveyond SMMU. However, as I said above, I'm not quite convinced we can drop them. Will