From patchwork Mon Jan 31 07:24:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 12730457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E14A6C433EF for ; Mon, 31 Jan 2022 07:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244295AbiAaH0G (ORCPT ); Mon, 31 Jan 2022 02:26:06 -0500 Received: from mga03.intel.com ([134.134.136.65]:60957 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357922AbiAaHZX (ORCPT ); Mon, 31 Jan 2022 02:25:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643613923; x=1675149923; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yTXAW0y1bRr1ZhmNMLZeR5QMvjVjpbYSmMclYmfKeNw=; b=atbyxg2K8VWDS12rxbSS0tg7PRor1lMAiYXyvchSMoKudfbGuL6t/mAY wBG72DSQKkZHF8FD9lHgdsDEZvpWsw6DaJX5cWceSmTo3+qsUtcnv4oA+ dBbKan3GLjkSq/vmiuX7Mz7E5KMGO6q8RNesSK8mt21bEYvkWf3OKJSMP Th1GZ9QQxrsOX0+pN9zJG+1KsLP9zEZcyM8t3UsdF9JN62G8oaLpIpPW3 keRv3cLx5gxZz1B/WeffQUnFC1ERZC1PZj3X3O4PEFkcCXov4Gg+yJHpv AEOklj9/23i0aikzsfWTzOTezhl/XQb56uaCyj70hwSabMSRWHFf1Kqby g==; X-IronPort-AV: E=McAfee;i="6200,9189,10243"; a="247367062" X-IronPort-AV: E=Sophos;i="5.88,330,1635231600"; d="scan'208";a="247367062" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2022 23:25:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,330,1635231600"; d="scan'208";a="768515249" Received: from ahunter-desktop.fi.intel.com ([10.237.72.92]) by fmsmga006.fm.intel.com with ESMTP; 30 Jan 2022 23:25:18 -0800 From: Adrian Hunter To: Peter Zijlstra , Alexander Shishkin Cc: Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, kvm@vger.kernel.org, H Peter Anvin , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Mathieu Poirier , Suzuki K Poulose , Leo Yan Subject: [PATCH 5/5] perf/core: Allow kernel address filter when not filtering the kernel Date: Mon, 31 Jan 2022 09:24:53 +0200 Message-Id: <20220131072453.2839535-6-adrian.hunter@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220131072453.2839535-1-adrian.hunter@intel.com> References: <20220131072453.2839535-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The so-called 'kernel' address filter can also be useful for filtering fixed addresses in user space. Allow that. Signed-off-by: Adrian Hunter --- kernel/events/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index af043a1a06ca..7670b0918e46 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -10454,8 +10454,6 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr, */ if (state == IF_STATE_END) { ret = -EINVAL; - if (kernel && event->attr.exclude_kernel) - goto fail; /* * ACTION "filter" must have a non-zero length region