Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1040325imu; Fri, 11 Jan 2019 13:54:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Lp+EjL+dsmF361HYrq2GjEM+hHJbWlY3kyWOSQ7wVzkEqh2VGKksBNIcC65PbO8y+wX7u X-Received: by 2002:a17:902:108a:: with SMTP id c10mr16531357pla.131.1547243696037; Fri, 11 Jan 2019 13:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547243696; cv=none; d=google.com; s=arc-20160816; b=CQHRsnLUK2K+gH3LeaSm1NG/PHiJ0RJd2cDPELfkqRnvx2TWVUjCq9EHT3fb1EEFnn VxpLLKc8zwywN9D+6QdLDN4ABZDpHDbuwi45QiMfiRXjPyCvVll0m5jPspKzcGGAfU8i 5TW1lX4L670udHoknBegKCtEj+5O1dgiAMcqp2lQy+CXzXUDRMWd/Zn0skYAJN08psn4 OuctqN+HI48hzhVXAI5QqySP6QfZIGWMsqHkZQFHlEUSz/mE+ObO78hNHft9IiPOlb0R 9zoKJP+m6iGDTgR4ijcmA9zfdUmLSgowJDhO6gZs5DH+aNu/2fY44Zzq8FaspYpKTCAg J7Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature; bh=Rznx8m7oF3vk7OvtYn7TIPy51bBYUCQncQQQG14BSTc=; b=FzE6lx6Xm92ly1yWOQomwi1E3+mInVJyl8/5D1fiv4v6hIWq5pV3vD6u4OLAlsSvg5 Ppa1p/IE3Nwi85WA4NZCTweHjjG+Uz5P8qwCyfpg4P9l154BF1BlkMA6vS9A3h9BJrO3 5IDAEPja+LCJTo3NhQG6bLM3+1oP6gGfJz8wymkVWEBMx4n8g+7xoGzYhXdOjDSC7eLB 9uuF1xHEmHAy/cut/ShilZNZWmM5hoKASfNF0HQW5X546DvdQALCCd6bi9+LYMZEBljM cFP6h7+9v3o+vClJRV24fhOFGeFHJsb/OECNT+wANJ9K6qWMvJLa7lopkprb+Scj4vB5 yO+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=bIJ+SWjA; 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 30si34931928pgr.396.2019.01.11.13.54.40; Fri, 11 Jan 2019 13:54:56 -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; dkim=pass header.i=@maine.edu header.s=google header.b=bIJ+SWjA; 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 S1726087AbfAKVw0 (ORCPT + 99 others); Fri, 11 Jan 2019 16:52:26 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35031 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfAKVw0 (ORCPT ); Fri, 11 Jan 2019 16:52:26 -0500 Received: by mail-qt1-f194.google.com with SMTP id v11so20526953qtc.2 for ; Fri, 11 Jan 2019 13:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Rznx8m7oF3vk7OvtYn7TIPy51bBYUCQncQQQG14BSTc=; b=bIJ+SWjADDx+zmkSDmbB+mdj7BMAUd+EwHS8D2WLJU5Gikuze5O8djfkayy4uRPsr4 EMwr4WLjpuQC3Yguw5a74sCZ2D9pqaNJ5GM5Mnc90J9VrD2uSNmzLCwG1L0Tnw+YPeS4 LeXLLOwbCY/aUE03q4QQIb664QfQxC+fCpy48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Rznx8m7oF3vk7OvtYn7TIPy51bBYUCQncQQQG14BSTc=; b=qGFOGbHc43I3coH2B1Y+8i4WMVgjvoEgA+5NL0ryrPTG2HX6PWl2n8mGE0Hx7/kVst ST/V4tdVsje9vAOFQbacgPO8FIKdnwchKehWrM4wxMM5nzJ8nAOJVYH2BdgIoZZQ0bVO 8uh3pXeQIMHplz13miya8g0VVSCcA8kzYEg837oJz2yWcezE11YMEinKY03G585RfLLS e6DRcQhuUJwLWvj74EcrikEBu6lANolS/h8t+paMXgBVDWTmHRo4HWGsokmuNmhHq2bs kl5fNQ9VRwwd8zjhIqllOab2/bisZZNdJyBYaMK6WzgD/87m9A7VEr7vo3XaI03lbrJ1 Zohw== X-Gm-Message-State: AJcUukeIjilI2etOA63cetopUROn4VJ/F1C0eBYqwwfw5kYjIm/FOM9Q EDg83qISJ893TeZFx0cCh6jkVw== X-Received: by 2002:a0c:f8cb:: with SMTP id h11mr15835493qvo.134.1547243544107; Fri, 11 Jan 2019 13:52:24 -0800 (PST) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id m81sm24161384qkl.92.2019.01.11.13.52.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 13:52:23 -0800 (PST) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 11 Jan 2019 16:52:22 -0500 (EST) X-X-Sender: vince@macbook-air To: Peter Zijlstra cc: linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: perf: rdpmc bug when viewing all procs on remote cpu In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Jan 2019, Vince Weaver wrote: > On Thu, 10 Jan 2019, Vince Weaver wrote: > > > On Thu, 10 Jan 2019, Vince Weaver wrote: > > > > > However if you create an all-process attached to CPU event: > > > perf_event_open(attr, -1, X, -1, 0); > > > the mmap event index is set as if this were a valid event and so the rdpmc > > > succeeds even though it shouldn't (we're trying to read an event value > > > on a remote cpu with a local rdpmc). so on further looking at the code, it doesn't appear that rdpmc events are explicitly marked as unavailable in the attach-cpu or attach-pid case, it's just by luck the check for PERF_EVENT_STATE_ACTIVE catches most of the cases? should an explicit check be added to zero out userpg->index in cases where the event being measured is running on a different core? Vince