Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp281223imu; Fri, 16 Nov 2018 02:26:41 -0800 (PST) X-Google-Smtp-Source: AJdET5fXZxWMvPwSWQ483SQDZO6i8SCM6AUdtRF6UWZ9VaKE6Q+ywtkjFhS6hOjooxTAiNDPYbps X-Received: by 2002:a65:5a4c:: with SMTP id z12mr9431019pgs.188.1542364001788; Fri, 16 Nov 2018 02:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542364001; cv=none; d=google.com; s=arc-20160816; b=0HNqs0mCL75L5/pcV5JRMkTg4Br66QZI5ARMRZeaCejevZXOVweeVUnCsPYvk0r80T p4t4gJ90TZSWorE1Z4j+vKg66BEM8fpW5YdnjTCe140QUfz/QIgNsCIms3r998rCPtgd EmaBvEfke2pvFQ5XLbzyFxjxtIYX+nbOKuZBCJxMiGOrOJ0+CMlmGjuIEiTDmJ4WIhqN h0sQxgTsJm+s+1joEXg7YlpuKfx2yCRuXChLIFdQfsRl6bn21I2lGTdrg4ETUaCnIBR4 Y3xdUhmuNXDjnc2Hg0Y3ICXoNtIU1jHxYVebHLrYLv7389CzivIPTkW6LoGW5yz7Uij6 eTKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=rI+Iyi09qtVhd6YSiXdwXGLKZoVI8yjtaib7YEevy2A=; b=Bi48c3xrG/YCQJzblVGUZp7rRZFyLQZi7DRpC9r4LoU1KKlQcZ50DfRJrBiIgzTwT+ bG7WDHmej/ZcHep7vglWxveP0KLMlsNkDF26rTCNXeAWwF66EJUC9gAweFyAzcam48Ne MqK9+EY3s4d8D8FEeRabfbNM3g+fFs2c6ehrn70vw9yHGR/MMa27Q1ku+pS8GfJyhejL iRSOwnO/uB6DEJR4ERrr9biiOZlZzVsnRaG6dpWdi2pMbKvuWYZKQ6y9VpBGqbjhpsM2 i+00FyBIWjC2V8RvnfsWFWv0iqikitDoGFryojkwZ2IivVplggJlXJu13I4iQeJf4EeC TMlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22-v6si40042053pfr.18.2018.11.16.02.26.27; Fri, 16 Nov 2018 02:26:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389568AbeKPUgQ (ORCPT + 99 others); Fri, 16 Nov 2018 15:36:16 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389518AbeKPUgP (ORCPT ); Fri, 16 Nov 2018 15:36:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C3BB15BF; Fri, 16 Nov 2018 02:24:33 -0800 (PST) Received: from e119886-lin.cambridge.arm.com (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 851C23F5BD; Fri, 16 Nov 2018 02:24:30 -0800 (PST) From: Andrew Murray To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shawn Guo , Sascha Hauer , Will Deacon , Mark Rutland , Benjamin Herrenschmidt , Thomas Gleixner , Borislav Petkov , x86@kernel.org Cc: linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/10] arm: perf: add additional validation to set_event_filter Date: Fri, 16 Nov 2018 10:24:06 +0000 Message-Id: <1542363853-13849-4-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> References: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The armv7pmu driver doesn't support host/guest mode exclusion so let's report this when set_event_filter is called with these exclusion flags set. Signed-off-by: Andrew Murray --- arch/arm/kernel/perf_event_v7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index a4fb0f8..c4c9fbb 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c @@ -1074,6 +1074,8 @@ static int armv7pmu_set_event_filter(struct hw_perf_event *event, if (attr->exclude_idle) return -EPERM; + if (attr->exclude_host || attr->exclude_guest) + return -EPERM; if (attr->exclude_user) config_base |= ARMV7_EXCLUDE_USER; if (attr->exclude_kernel) -- 2.7.4