Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1857212ybi; Mon, 1 Jul 2019 01:32:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwem8gqj8zGnal1zBO+htcBRkk7q9PMT3CYOL1QoTTJfQwbGQ7ykEGfOAiBj1Ncz3y4rTO X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr26155116plp.221.1561969941325; Mon, 01 Jul 2019 01:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561969941; cv=none; d=google.com; s=arc-20160816; b=QEwQbRNT6OIOPamgC/UgQ5NVqJSie1sHmI5D4S8/sDLGDs2Dg1CARih+GS0DkJfUkr TsuAiilkATIH4UZYwyDJCENdKZGQkgkrQOoBGu8oujlzxPVybRQ9/ZC5HQYG1gDrs19A gQemdf4fx75dPqhlcTE1NS/xSHoI8hhwFTZVDjLaSpl71ZnP0qI7aq9N/s+yZhtN1IRI sm33AO9NI131Z3U//qKkHOc5dKvzQoI0FFlK+foiiPsQZEg/as4Pr9+rbjv4wrNgNE/B 10EBI8ZqawWkN1imiYUzskNlsUBPyz148S8U31ueq2PmXFJnt2jOfw+LsYI6J7isi15D 4M5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hHxh7hxf/C/2tThRjcvY3tDwP0bpGNzg5vvFRY9dbkM=; b=EFN+k9/zWPpnKT815O2GpZprf7oH9Tv8ixaOtTL0TnX/wsfpmmI0p+OT8klgcHr6zQ 0odmeuo8BZYrz9LK3Z7ktX4SPfqSrUVPZytThGc3+nQ9unQseUoPALdlltKqIp7nSnU3 /HJRMOn/WHh7FFpoMVovfbW7WG/aYIzSR2Jm5ZlPv+W35N/catiZeK6s2mMdlpw5N3r5 7cfE7+/LB+Kksg4EKWqjtf2+OPrTrReZdOwZ88szxbqEIj45NdEWLXwncrmeqT7pwLBG LH2tEmGWsTb8g6nq5iEXoERRpMFgYrk7UMp5DKaGIh0PN9UMTRkuO+s9bqHK7GJAsyiX f+dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=XTAilpBM; 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 cu6si10231417pjb.102.2019.07.01.01.32.05; Mon, 01 Jul 2019 01:32:21 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=XTAilpBM; 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 S1728015AbfGAIWb (ORCPT + 99 others); Mon, 1 Jul 2019 04:22:31 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33170 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbfGAIWb (ORCPT ); Mon, 1 Jul 2019 04:22:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hHxh7hxf/C/2tThRjcvY3tDwP0bpGNzg5vvFRY9dbkM=; b=XTAilpBMYs8Tjbgyb9pk9hVYc 2435zWi+B8kTuiJ9D2a/oqmBMwLzvZygPOJf85+xEvGgZYXQNz+9vNldxE3U+w/sxQxnBS1zUEOJH v1n4p48hiBJ0U2LQXEXnt09rhBBFYljwR0os4TDBYkcXrOK/AQzQGozg2+IXZZFLBrIWC7U5XXtgh Jru8UuojQtFyqUsJ/gPFA0ROTENRHLx+L3eAYgMPhQ8/hNqZ8xk1Ld2gt11wl9yKgv0BEmTF+htkX sKsDPW98YLq1PE4uvB8+bBKYls1ldZDN/Ki0ZTJSiF9QgzEUQaN66jxhiuIe6XxYw6/qX8Caaz2l4 oAmma9fBA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hhrZO-0004Z8-Gk; Mon, 01 Jul 2019 08:21:51 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D653F20963E24; Mon, 1 Jul 2019 10:21:48 +0200 (CEST) Date: Mon, 1 Jul 2019 10:21:48 +0200 From: Peter Zijlstra To: "Phillips, Kim" Cc: Ingo Molnar , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Martin Liska , "Suthikulpanit, Suravee" , "Natarajan, Janakarajan" , "Hook, Gary" , Pu Wen , Stephane Eranian , Vince Weaver , "x86@kernel.org" Subject: Re: [PATCH 1/2 RESEND3] perf/x86/amd/uncore: Do not set ThreadMask and SliceMask for non-L3 PMCs Message-ID: <20190701082148.GN3402@hirez.programming.kicks-ass.net> References: <20190628215906.4276-1-kim.phillips@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628215906.4276-1-kim.phillips@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 09:59:20PM +0000, Phillips, Kim wrote: > From: Kim Phillips > > Commit d7cbbe49a930 ("perf/x86/amd/uncore: Set ThreadMask and SliceMask > for L3 Cache perf events") enables L3 PMC events for all threads and > slices by writing 1s in ChL3PmcCfg (L3 PMC PERF_CTL) register fields. > > Those bitfields overlap with high order event select bits in the Data > Fabric PMC control register, however. > > So when a user requests raw Data Fabric events (-e amd_df/event=0xYYY/), > the two highest order bits get inadvertently set, changing the counter > select to events that don't exist, and for which no counts are read. > > This patch changes the logic to write the L3 masks only when dealing > with L3 PMC counters. > > AMD Family 16h and below Northbridge (NB) counters were not affected. Thanks!