Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2571741ybk; Mon, 18 May 2020 02:28:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydnEwa2OLoHkWvoJtAMKddIRHOfO8zSHTXiiIZ9m+p1gaSg0gwD5GTkt+4RuE2tAwhbFlq X-Received: by 2002:a17:906:415b:: with SMTP id l27mr14289748ejk.240.1589794093467; Mon, 18 May 2020 02:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589794093; cv=none; d=google.com; s=arc-20160816; b=h6L6F4CmxnwtHY/ltXqbkmipQ7uX9vmBJlatvlU7+tKrq0J0ww6Ul7e6BApltimZQl sjps1TX4OYBn7Nps6HrZ+j4htMYAzl4IgcXBzOfntkPMnL1pIOpnQTUZO9Ihxbw/Fb98 +sQdPoWUoVv7dTTkBW89WJkO9DVtTcAOyPlfcuwt32//s9uADmJO83vjW25aP7Dz+zbV sL+PYp+KLUZhouxKLF1PC9dU8MrSpOwv+iiXKhMgCmBLNAyhwq8pLioRemIwRQyak8Pf xKLF6fqLdXwOEt6MP/5Ngy8CUNozUNeX+TA79dEPB0ezLnViJvVlzvguC1rBePfnKajr Kdqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AsG25wGsLo5dva63MFW7ZBhcsdfBRHY+JLf9PmDQZPU=; b=seRmKjYpSnweC9KTic3veuUUw95aoPCaMMpNMfJW4FtvNB8m3tbFhwhgohY8C8L0ve 88lfLICDbRekIYeK5ebE5CMUBhxrDVyl+4wvZ580yXaCHrv2ofP9m21OkjP/PJAGU+mC k6YfDcIVwVMCqz0lhrmqdfeA2CCG2KtkJ949VtjpLacfSq0YcNfoJ0qbmoyL8ndSsmsm aSWbD4xWu21jYml0k6nZorohe7GzSUFhoWLQvHZFb5v4yGAVFmYvhOHrLEDh8wJ6Rrgr l7WwQLilG15gfPDNfNBdncDwfqO8ssjxKZvsZSvnV/t16vB2S2lkdzDGZGELBoM6poNZ vv6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=T+jd73SG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si5376446ejc.411.2020.05.18.02.27.49; Mon, 18 May 2020 02:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=T+jd73SG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgERJZp (ORCPT + 99 others); Mon, 18 May 2020 05:25:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33106 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgERJZo (ORCPT ); Mon, 18 May 2020 05:25:44 -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; bh=AsG25wGsLo5dva63MFW7ZBhcsdfBRHY+JLf9PmDQZPU=; b=T+jd73SGAnN/iUVYvQhlFjUREr gU7clEBE7FwvQwYJv+ptRhy1MxwWC+6dGethKvAPM9K+e7aSyzxN6f5QuFhRKhp8kBacyfB8cZ0as nut9xtAA3UoV+DhX/7q+x+k1ETWwbtYtEw3C2fN/Iu1EjIyCOKQ15WQI2Zz5XnBYpQt70P0ELh7A0 p300PEQOHHQJWBINYAN26qJ0kSn1kiXWVxRdamC3E7asrKXlTzKWGgJz8qLYcC+xSMCWvqbHJKYto tNS0dJfjpHvswvwkDqhg+nJKTpeOTGYad2j3ljfINB5vz9Izt8G5QD1TNymqNbcquq5sNr2GcM9iq 0mzhGCrA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jabzU-0005B2-28; Mon, 18 May 2020 09:23:20 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D409D3011E8; Mon, 18 May 2020 11:23:18 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 730872B3CFEE6; Mon, 18 May 2020 11:23:18 +0200 (CEST) Date: Mon, 18 May 2020 11:23:18 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, irogers@google.com, kim.phillips@amd.com, jolsa@redhat.com Subject: Re: [PATCH 2/3] perf/x86/rapl: refactor code for Intel/AMD sharing Message-ID: <20200518092318.GA277222@hirez.programming.kicks-ass.net> References: <20200515215733.20647-1-eranian@google.com> <20200515215733.20647-3-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515215733.20647-3-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 02:57:32PM -0700, Stephane Eranian wrote: > This patch modifies the rapl_model struct to include architecture specific > knowledge to Intel specific structure, and in particular the MSR for > POWER_UNIT and the rapl_msrs array. > > No functional changes. > > Signed-off-by: Stephane Eranian > --- > arch/x86/events/rapl.c | 29 +++++++++++++++++++++++------ > 1 file changed, 23 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c > index ece043fb7b494..e98f627a13fa8 100644 > --- a/arch/x86/events/rapl.c > +++ b/arch/x86/events/rapl.c > @@ -131,7 +131,9 @@ struct rapl_pmus { > }; > > struct rapl_model { > + struct perf_msr *rapl_msrs; > unsigned long events; > + int msr_power_unit; MSR addresses go negative these days?