Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1020916ybg; Wed, 29 Jul 2020 03:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybrLk0ClSkpg6Lxab4Z7VWVjskNJHx1ivf3WvFkLd/h5L373DrhxqG5EYPAzYCw2fFV4b7 X-Received: by 2002:a17:906:6dd1:: with SMTP id j17mr15889798ejt.272.1596019984211; Wed, 29 Jul 2020 03:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596019984; cv=none; d=google.com; s=arc-20160816; b=b7dHuXGOQPuW/jSFj4rD4M4msQ/9RXdFciw6+KH34bDi1BuTbCgTi8LL47X0EJO5J0 NnSckz34mERWHZif2ZvcwtoTmoxnpCxOa9uDvVrrn3wQVFkJRmChc9XREczBDoZb9c6l Bti7oCSL3U66kbFQuAvCx458dYS8QhqObkJhlGbNHdQ9V8T7Y0XYSHCmbYvq0mhUk8Xj Hc4DifIfzESEUZhRhYnCwSAcGhIb3jmozBQuZrq5GsMvZLKV1jzVncib1javmpUxjSZc PI7QWoODCCyCuYU9N4wKScrOH5y6qExuDEd4YTca9+nde3tZf4YG2a8HIhyEHUDPsHeW P2+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=vSliGyBZQKvlS0+61F1LBEoXAn3W7oNlUuyzH64gKZ4=; b=kVqqTOmJ1Ztug/4tJcsCh6TLhroKHpNAbEgjP1mdI5LhZRImSP/gGqWDK2BI2mhrT9 Kh4FSY6kIhj9JjYbD298k6HwtKNdNW6eGo/S62KmDTDTM+aPHzAioGoEEA/HJB3d7xEi CpKRhW0rkNvINUWzIwWKtYPLePh76ojO3y5wulixU2csRSB048hUjLx53se1Dpc7DARR cMTrtPdMtw9BzdPTym49P/ZhCTV3O17Egob1kiJ7w3GZ3uzwTbrXD98Jt2oiFl/6bLce fCg6GTfUIP8gNMbyIx+fvUgJVIRA/L9syEnhFDBuY9gCGKtqaVCikJtdJqYhjxchLZvc +VnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="s6Br/iSu"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si1037639edr.586.2020.07.29.03.52.42; Wed, 29 Jul 2020 03:53:04 -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=pass header.i=@google.com header.s=20161025 header.b="s6Br/iSu"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbgG2KwR (ORCPT + 99 others); Wed, 29 Jul 2020 06:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726800AbgG2KwR (ORCPT ); Wed, 29 Jul 2020 06:52:17 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055F4C0619D2 for ; Wed, 29 Jul 2020 03:52:17 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id x10so10365273ybj.19 for ; Wed, 29 Jul 2020 03:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=vSliGyBZQKvlS0+61F1LBEoXAn3W7oNlUuyzH64gKZ4=; b=s6Br/iSuLIwOpryZlHRvpGvDbfddkW4PyoYgVr62dENEn+ac9CFU44qiia+IbgSEVW Nnl2wQRXJsTqxLwAfcFWiLOu/yWLP+ryfzxB/x6ztWI2jsOZ2w70YbEfNh/6A6d4PhZ/ iMa2jkRQI8v9AfXr4C4y+07e1kKSuqHiyyRipNRzRNbeFAHK125rhYPIgBjRIyHWksfL /3T7oqq34vijYmj83jeDTWOhwBWPvdFdrUsUvLosJNgnfy84Sh0fLDpjnMAZowz70BGS fNni7Bnbk4PhkrdtAGdDO3uEUcN5KkA1icjYpeJh4rtHh86E6BobzTJydAOJUiwR86wo WMIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=vSliGyBZQKvlS0+61F1LBEoXAn3W7oNlUuyzH64gKZ4=; b=BChOk+9++Od3AfZc+H1CJb8lExxFjxsg/FrnFym95jO7ZHB+R2J9Tif+DOuX6M40Vq ljwIMTNEu9wwujG4k35RVgdco5xge7r51mAu2BpkeLtYAvrItTQzdVgN3jsZJQsExYX+ 3YMmetJPEw25jSOfEYHXaEPIxP5AhGJHS0tr6keES4ZUP4piKKyERElmLwTQa+vp0qxd 4mddtdlC9Zh+Z/889imP9mDcJLqSp/VmavOfmoHCS0WExGVLzlUhm07GV4+Sudzq78/r qfGP05pbqfmlAJA7+qFhhTWEpa6yx/t4IE4aAj2PsWEgI3TbO2Y2F7irOJLwxWRUnpzL utbA== X-Gm-Message-State: AOAM531w8WVGKHe22cLhNkv0A/91+bFA3qsKHshiAnHCuNGqrZbvlbyT 17j2JhM1V5dUl0pmXoskVYVB+q4nbEMjbF7hyXABYixUGj4SImKotVEESaMthY4YJklxPBYLZbn UiOSE2P4mH7C3+WM98pR7DtgJeHL845uHeVpa0MF+Pam6QJtwb8WImnh26VITyNfNEoaM0LJSE2 HhVkTG X-Received: by 2002:a25:4945:: with SMTP id w66mr50685406yba.285.1596019935958; Wed, 29 Jul 2020 03:52:15 -0700 (PDT) Date: Wed, 29 Jul 2020 20:52:03 +1000 Message-Id: <20200729105206.2991064-1-victording@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.rc0.142.g3c755180ce-goog Subject: [PATCH 0/3] powercap: Enable RAPL for AMD Fam17h From: Victor Ding To: LKML Cc: Victor Ding , Alexander Shishkin , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Jan Beulich , Josh Poimboeuf , Kim Phillips , Pawan Gupta , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Sean Christopherson , Thomas Gleixner , Tony Luck , Vineela Tummalapalli , linux-pm@vger.kernel.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds support for AMD Fam17h RAPL counters. As per AMD PPR, Fam17h support RAPL counters to monitor power usage. The RAPL counter operates as with Intel RAPL. Therefore, it is beneficial to re-use existing framework for Intel, especially to allow existing tools to seamlessly run on AMD. From the user's point view, this series enables the following two sysfs entry on AMD Fam17h: /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj Victor Ding (3): x86/msr-index: sort AMD RAPL MSRs by address powercap/intel_rapl_msr: Convert rapl_msr_priv into pointer powercap: Add AMD Fam17h RAPL support arch/x86/include/asm/msr-index.h | 3 +- drivers/powercap/intel_rapl_common.c | 2 + drivers/powercap/intel_rapl_msr.c | 58 +++++++++++++++++++++------- 3 files changed, 47 insertions(+), 16 deletions(-) -- 2.28.0.rc0.142.g3c755180ce-goog