From patchwork Wed Oct 7 16:14:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 268365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 490BDC47095 for ; Wed, 7 Oct 2020 16:16:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E16F4216C4 for ; Wed, 7 Oct 2020 16:16:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="XR8210bq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727550AbgJGQQy (ORCPT ); Wed, 7 Oct 2020 12:16:54 -0400 Received: from mail-bn7nam10on2053.outbound.protection.outlook.com ([40.107.92.53]:53761 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727152AbgJGQQx (ORCPT ); Wed, 7 Oct 2020 12:16:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jk3Gu+I6Czh71qhmpjAjkv8N9xCfXpCVSfCLOvO20ks9mCaerwl2M04wFPYI81grproIaP957gn9gmg2qmJTiIcU2a5ieOO0d6Tw8EBmNNvazXlczPuItPjhDlB7gjvatuvF1iJiZsvnE//9FdT/vrX+fmrtlhV5gS1y48MMiQJCav58oq/gfkgBV4IngjqiI1nVNrzfwA/YdBUdMKTQCMaiYcLyrEK5EU4SetNthgCmgJ25NwfO91IeAB7kBLLpua9vtIoXATH6EpTgnnhZN1GDbqHtXGYkpnMNnWZH3O47LGNJKjk1WOUFhxlMbM15+wBLSHzQGPN0MJpdF1Bi+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CmlQG/NA+a+j3TsLHpF6FlD3tj0KaoiiM/QOBD1ckUA=; b=PAXZA6BLyBKh7OI9n8gk1b4cTxV2pofhiPI86Bw/8Vtz9YIWYcGXIygkEDFDOzCiAsrXWcQP+p6ZOm/cbqmN4Qf5opx7oNwJcf9t+h7Mum6l7uac3cJzAuv4kTApfVDJUdh+tBLxwG7F6MIZbhki5z1yPlT4taqHIV3D31pcqFx/R5WbgBMzGiY4DdJHVpOnK0ZbTHcGMVF46rZFiFQ6ZXl6x8G1Ezx4FWMH31BFR+YvenVygpDtwwaFputa01Bm6QBdEtzuDlWnq3TZHqUm2QCaNRNtg+NQuh+kh962/bAzFhE8SruK6hrGxk/c6ytODt5YluNmwXee68VZkPWjnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CmlQG/NA+a+j3TsLHpF6FlD3tj0KaoiiM/QOBD1ckUA=; b=XR8210bqkYoriFBoij+2x5lV10SZBNzX0tuauRZd9p+w133yvZM7VdLkTWfEWDAkCSeEG+/5gTonjeJD5c+oe0AQyQI+MvzUBN1qyWy3mkTaGijBybzUD7tj+TyTMm9CG99B/qh9Eo6OZQAaRGgdUpSg/7Kkta650QDjyOh7XmQ= Authentication-Results: rjwysocki.net; dkim=none (message not signed) header.d=none; rjwysocki.net; dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB2946.namprd12.prod.outlook.com (2603:10b6:408:9d::13) by BN8PR12MB3106.namprd12.prod.outlook.com (2603:10b6:408:45::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.37; Wed, 7 Oct 2020 16:16:45 +0000 Received: from BN8PR12MB2946.namprd12.prod.outlook.com ([fe80::3054:612a:b2d7:f46d]) by BN8PR12MB2946.namprd12.prod.outlook.com ([fe80::3054:612a:b2d7:f46d%6]) with mapi id 15.20.3433.046; Wed, 7 Oct 2020 16:16:45 +0000 From: Kim Phillips To: "Rafael J . Wysocki" , Victor Ding , linux-pm@vger.kernel.org Cc: Kim Phillips , Alexander Shishkin , Borislav Petkov , Daniel Lezcano , "H. Peter Anvin" , Ingo Molnar , Josh Poimboeuf , Pawan Gupta , "Peter Zijlstra (Intel)" , Sean Christopherson , Thomas Gleixner , Tony Luck , Vineela Tummalapalli , LKML , x86@kernel.org Subject: [PATCH v2 2/4] powercap/intel_rapl_msr: Convert rapl_msr_priv into pointer Date: Wed, 7 Oct 2020 11:14:37 -0500 Message-Id: <20201007161439.312534-3-kim.phillips@amd.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201007161439.312534-1-kim.phillips@amd.com> References: <20201007161439.312534-1-kim.phillips@amd.com> X-Originating-IP: [70.114.200.6] X-ClientProxiedBy: SA9PR11CA0006.namprd11.prod.outlook.com (2603:10b6:806:6e::11) To BN8PR12MB2946.namprd12.prod.outlook.com (2603:10b6:408:9d::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (70.114.200.6) by SA9PR11CA0006.namprd11.prod.outlook.com (2603:10b6:806:6e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.39 via Frontend Transport; Wed, 7 Oct 2020 16:16:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1011f38b-9ff3-4cba-06ae-08d86adc62c4 X-MS-TrafficTypeDiagnostic: BN8PR12MB3106: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lRqt88MeMTvhve3ZnUvOr24oLS34n8krlaiOukjVPQXRtjSiEzIQ50/y5svJMsMcdsTf0Fs4js4KGPXqF4+HulxSUW0kQYed0Qw4peVupfeWuYf06wWtEvufHmE4ARsWr6JZzF2jOEd1/xQWUrkzA0UCfM9+d/9x7spqfqM52vfsjdcFdiVWSmm4Xl0PcJfmi6W8JDOCJe/6/tU91oZytSf8r7VV724VMn9XUgnpe+rels6TeeWouQq8jdBD3REda3Km2nIkwCKfuk1Se7SmyI/lP9VVi9CUHjhaX4zwS+YMmYvvTHgWDPjUaIXEb6YWETVsVuqUaGZFimilf8QnMf448SKIjJVVsk/Btxd7McyhrgeNjzpLp4aHHCjApbjnG4P7ruy8hihJy3oHupQ/dGH7aJ2rRfoCJDoGmvj/B9uF81aCab/4vkH40sUYeKlelAqss+xCEEosZc32ti2IXw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR12MB2946.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39850400004)(376002)(346002)(396003)(136003)(26005)(8936002)(83380400001)(16526019)(186003)(83080400001)(86362001)(316002)(8676002)(36756003)(2616005)(956004)(110136005)(54906003)(69590400008)(2906002)(1076003)(6666004)(4326008)(44832011)(52116002)(5660300002)(6486002)(478600001)(966005)(66476007)(7416002)(66556008)(66946007)(6512007)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: btOZH9xrqg/yhxqupVe79BKIWQW1vIYmnepbQARyBCvSgkHGalz5QJj20IY2VmxtGXJ0Qrb7mrna1bKZSmiGtaby3g+jYyuhbLOxVYX5Unm4SKSbzpXtJ3nQlKgwl+mVABQCyMRKQXDF3lTtcLkGwgAX2R0S2WuH4RmGdGXMDlnkecQNtJJef+FBL9zqXfgC6ouzarqxnMFLaiiwhv6pvkqTq77O7OSLP/awQhtHCFlTs7J4IJxcsdLKStgGOfjJf/zeokkL9qgqy83JfB2cFS4qVJ/93qukkYf+EXi6WMiIAvOlx2Ti/6pSh88gpQBD7gnUhuZyULnl7geohRaJItSi1wOutncZ7QR/hL6Yt3BS1CANDQFDU4Sh9VGjga3QnjBsKSvyqq4vc0kJp7TzsyIQ8SHVJXBKiM4GMbvB0UatA9UMJBTZzh7Up5wc+NKfGcU9+SA7VXnK++FaqtQhBfgbVyBYWQPEH6J3UqbHAXxh/p1ZEIN7uvzRbARD+C9qm79qxZ8hqoID2LNdvNVFpojlx5ApREr9HpZbM903blkuw3sgW+w2MqsLsJ/O4/ngS1vBmOz7bQq8kMnsD8ln8h5vWqPqsVpSxKwRpNnyvkkbaQRvPcUTMySajhrIMY+XgM7BWfeOQlJFRvWMwCGdeA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1011f38b-9ff3-4cba-06ae-08d86adc62c4 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB2946.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 16:16:45.6877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ChryvCTaqSwGpxSvPVZTzVLDZk3M6lwY+YTXvc0wOWWmWXSRKT+VLR4Rfh+lnfBQV0Cxu9PAJRS/KCzURN+FAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3106 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Victor Ding This patch changes the static struct rapl_msr_priv to a pointer to allow using a different set of of RAPL MSR interface, preparing for supporting AMD's RAPL MSR interface. No functional changes. Signed-off-by: Victor Ding Acked-by: Kim Phillips Cc: Victor Ding Cc: Alexander Shishkin Cc: Borislav Petkov Cc: Daniel Lezcano Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Josh Poimboeuf Cc: Pawan Gupta Cc: "Peter Zijlstra (Intel)" Cc: "Rafael J. Wysocki" Cc: Sean Christopherson Cc: Thomas Gleixner Cc: Tony Luck Cc: Vineela Tummalapalli Cc: LKML Cc: linux-pm@vger.kernel.org Cc: x86@kernel.org --- Kim's changes from Victor's original submission: https://lore.kernel.org/lkml/20200729205144.2.I4cb96a95365506b77761c1416258672a7556b595@changeid/ - Added my Acked-by. - Added Daniel Lezcano to Cc. drivers/powercap/intel_rapl_msr.c | 37 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/powercap/intel_rapl_msr.c b/drivers/powercap/intel_rapl_msr.c index d2a2627507a9..c68ef5e4e1c4 100644 --- a/drivers/powercap/intel_rapl_msr.c +++ b/drivers/powercap/intel_rapl_msr.c @@ -31,7 +31,9 @@ #define MSR_VR_CURRENT_CONFIG 0x00000601 /* private data for RAPL MSR Interface */ -static struct rapl_if_priv rapl_msr_priv = { +static struct rapl_if_priv *rapl_msr_priv; + +static struct rapl_if_priv rapl_msr_priv_intel = { .reg_unit = MSR_RAPL_POWER_UNIT, .regs[RAPL_DOMAIN_PACKAGE] = { MSR_PKG_POWER_LIMIT, MSR_PKG_ENERGY_STATUS, MSR_PKG_PERF_STATUS, 0, MSR_PKG_POWER_INFO }, @@ -57,9 +59,9 @@ static int rapl_cpu_online(unsigned int cpu) { struct rapl_package *rp; - rp = rapl_find_package_domain(cpu, &rapl_msr_priv); + rp = rapl_find_package_domain(cpu, rapl_msr_priv); if (!rp) { - rp = rapl_add_package(cpu, &rapl_msr_priv); + rp = rapl_add_package(cpu, rapl_msr_priv); if (IS_ERR(rp)) return PTR_ERR(rp); } @@ -72,7 +74,7 @@ static int rapl_cpu_down_prep(unsigned int cpu) struct rapl_package *rp; int lead_cpu; - rp = rapl_find_package_domain(cpu, &rapl_msr_priv); + rp = rapl_find_package_domain(cpu, rapl_msr_priv); if (!rp) return 0; @@ -135,44 +137,45 @@ static int rapl_msr_probe(struct platform_device *pdev) const struct x86_cpu_id *id = x86_match_cpu(pl4_support_ids); int ret; - rapl_msr_priv.read_raw = rapl_msr_read_raw; - rapl_msr_priv.write_raw = rapl_msr_write_raw; + rapl_msr_priv = &rapl_msr_priv_intel; + rapl_msr_priv->read_raw = rapl_msr_read_raw; + rapl_msr_priv->write_raw = rapl_msr_write_raw; if (id) { - rapl_msr_priv.limits[RAPL_DOMAIN_PACKAGE] = 3; - rapl_msr_priv.regs[RAPL_DOMAIN_PACKAGE][RAPL_DOMAIN_REG_PL4] = + rapl_msr_priv->limits[RAPL_DOMAIN_PACKAGE] = 3; + rapl_msr_priv->regs[RAPL_DOMAIN_PACKAGE][RAPL_DOMAIN_REG_PL4] = MSR_VR_CURRENT_CONFIG; pr_info("PL4 support detected.\n"); } - rapl_msr_priv.control_type = powercap_register_control_type(NULL, "intel-rapl", NULL); - if (IS_ERR(rapl_msr_priv.control_type)) { + rapl_msr_priv->control_type = powercap_register_control_type(NULL, "intel-rapl", NULL); + if (IS_ERR(rapl_msr_priv->control_type)) { pr_debug("failed to register powercap control_type.\n"); - return PTR_ERR(rapl_msr_priv.control_type); + return PTR_ERR(rapl_msr_priv->control_type); } ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powercap/rapl:online", rapl_cpu_online, rapl_cpu_down_prep); if (ret < 0) goto out; - rapl_msr_priv.pcap_rapl_online = ret; + rapl_msr_priv->pcap_rapl_online = ret; /* Don't bail out if PSys is not supported */ - rapl_add_platform_domain(&rapl_msr_priv); + rapl_add_platform_domain(rapl_msr_priv); return 0; out: if (ret) - powercap_unregister_control_type(rapl_msr_priv.control_type); + powercap_unregister_control_type(rapl_msr_priv->control_type); return ret; } static int rapl_msr_remove(struct platform_device *pdev) { - cpuhp_remove_state(rapl_msr_priv.pcap_rapl_online); - rapl_remove_platform_domain(&rapl_msr_priv); - powercap_unregister_control_type(rapl_msr_priv.control_type); + cpuhp_remove_state(rapl_msr_priv->pcap_rapl_online); + rapl_remove_platform_domain(rapl_msr_priv); + powercap_unregister_control_type(rapl_msr_priv->control_type); return 0; } From patchwork Wed Oct 7 16:14:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 268364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EE68C41604 for ; Wed, 7 Oct 2020 16:17:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B62CB2176B for ; Wed, 7 Oct 2020 16:17:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="QXMB3pe7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729142AbgJGQRO (ORCPT ); Wed, 7 Oct 2020 12:17:14 -0400 Received: from mail-co1nam11on2052.outbound.protection.outlook.com ([40.107.220.52]:18785 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726348AbgJGQRO (ORCPT ); Wed, 7 Oct 2020 12:17:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QlTaxag7gaxI+2Fjb/azuDNL2QfHoKLgDNWljslxbpzttlunG3SpkM0YOGuqNX38VZy/fVYd6+gjChiCoQ+4oNlJ9yLEU7WYlhnL2hgwGKsPeKvZPZpO+MeKdH2Aj5fr/cHgjnosw99b4eJ6pfezeIjK+CVhFpzdfP7dkQeAQjC5JXNmt9vTvF7/Pp3mT+AvoSL5hiFELsxmiUmZnt90z388AMRKxYtzVjSJejGYI/WQCVFsGkKWILrRvGUUI6Yix5pXDKmlnbWYaUuWL5bqs2PBLC8yjlcP70uF6HVnAWe5h/ireyq3kU2zsEpwrypw/1/J/ZWAIE8EVMlVnYF/AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1ZwF1030X/pLsYnm95TrRmgyQ5l1UkZFdwNkE7SzkpE=; b=F2MHGgmZ8uD+c8UcVo/y006ijg/FOlfuC1TTKTYuUCbENvPSfdQdd1mS+SD2oEhqUauLmKOhBkDjn98zv1ngs5g1gsLATCIeCH+oZPTUpoVVWDJCSBreXIvHcyxnIl+zNiiGp2+B7DAxFhYwfni/9GBDhCgmY2XFLLc7ULmZryc4dxKP4kRYMK8TYztl+1DZvum8fTKqsBgpljXqIhG0QtrXEOyP+8JlpgAVll55R53wkPj/U4YWrBCGso3VK3PpkRDInlOtEa7N9hOleBUaZjV//jNQEHj1/rjjY/0r39cSmUrE07F6svmU3e0TPIjkHr5iuq/llvZuWsG5Nwjpug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1ZwF1030X/pLsYnm95TrRmgyQ5l1UkZFdwNkE7SzkpE=; b=QXMB3pe79L4qLeew357h5tdt0Gjh4fJbbqaYAxjgHNYcxPxD69xjeSSw0MqtWPmXTMX9xwhiE3Iwm0ojp9bF0qtCpOCKAHbDLTBRb3z15uPBd7LdN78ocha/bjYPcsA4mLKqZJaHdt9wk3k/QHows1PUthr9+cI/+PrnNGQDG2E= Authentication-Results: rjwysocki.net; dkim=none (message not signed) header.d=none; rjwysocki.net; dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB2946.namprd12.prod.outlook.com (2603:10b6:408:9d::13) by BN6PR12MB1315.namprd12.prod.outlook.com (2603:10b6:404:1f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 16:17:12 +0000 Received: from BN8PR12MB2946.namprd12.prod.outlook.com ([fe80::3054:612a:b2d7:f46d]) by BN8PR12MB2946.namprd12.prod.outlook.com ([fe80::3054:612a:b2d7:f46d%6]) with mapi id 15.20.3433.046; Wed, 7 Oct 2020 16:17:12 +0000 From: Kim Phillips To: "Rafael J . Wysocki" , Victor Ding , linux-pm@vger.kernel.org Cc: Kim Phillips , Alexander Shishkin , Borislav Petkov , Daniel Lezcano , "H. Peter Anvin" , Ingo Molnar , Josh Poimboeuf , Pawan Gupta , "Peter Zijlstra (Intel)" , Sean Christopherson , Thomas Gleixner , Tony Luck , Vineela Tummalapalli , LKML , x86@kernel.org Subject: [PATCH v2 4/4] powercap: Add AMD Fam19h RAPL support Date: Wed, 7 Oct 2020 11:14:39 -0500 Message-Id: <20201007161439.312534-5-kim.phillips@amd.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201007161439.312534-1-kim.phillips@amd.com> References: <20201007161439.312534-1-kim.phillips@amd.com> X-Originating-IP: [70.114.200.6] X-ClientProxiedBy: SN6PR2101CA0023.namprd21.prod.outlook.com (2603:10b6:805:106::33) To BN8PR12MB2946.namprd12.prod.outlook.com (2603:10b6:408:9d::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (70.114.200.6) by SN6PR2101CA0023.namprd21.prod.outlook.com (2603:10b6:805:106::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.10 via Frontend Transport; Wed, 7 Oct 2020 16:17:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 51809740-7ed3-410f-da3e-08d86adc7226 X-MS-TrafficTypeDiagnostic: BN6PR12MB1315: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:843; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2GA3MoouEcc2kb0QXLjAmiLX0CvoLEW20xy3Z2retpaM2knBj9dMPM85VjnuRl9hSzkCBFOfRuq0yZ9uefW2x+/1eMwXBW7n8d5WcRo8OOl6uroIvWkk+2FcHPWdKc752CBc9vaRZhgFK47Kjn0ncbqpVVaKMxUZSxvUgdYLW3bhyu1z3sqHX2XPDog1w6K+lPLG2MmBIj2LST5UlIOK64xzel1rX0O03hR1wjRL+WiOCRbxlZQicWUb9b7L2bH8KvSzbx9j3A0w1EAFu3567uIAY00XuV0zuHEueIUsu9p12OE0OFZp9vYZIO2S39BjOyOlBU5TY/ibDI/kCYw4CTjePYHj7ORZtNSYWTFhSE/wq5km3+rw153iJ4XLazA1wHcTILTpbOSAevCQgBxzHvchQUmLV66aA6crU6XzRSUjDUEkHB1xDqtiNDYAwm2mmnoP5q19MAyuSAIxwS3GWQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR12MB2946.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(366004)(346002)(136003)(376002)(8936002)(66556008)(66476007)(66946007)(44832011)(52116002)(110136005)(1076003)(6666004)(5660300002)(26005)(6506007)(54906003)(69590400008)(2616005)(36756003)(186003)(16526019)(956004)(316002)(6512007)(2906002)(7416002)(966005)(4326008)(83080400001)(8676002)(478600001)(6486002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 50mH2Tww0DusURHv/8pWmsORxBUUa8HGxY4h9WhTTRlKsKR4f9x6JJprIrvTnFVY692Umq9l3SNdS1cCFjpvIjd3ddmEljiREFF40Vh+dydhaQetpMrgC7s8Xcw1JaXX6D4V171w9jjxlXkTzAArZdUSZX62tiexMm4nRRaHPprXz50TXyRh5KKO0LUi6FCruC3qsreHEmomUbjYqO8YsM1iroVME5Yv5yWiZUxk2IynCe1mvSMrw0GqXygcbj2rpmR+DLj9LwdbldNrtdGn7ZT2QfnYnHUwOdTaQnRA6Yge8ZhXYUIDuDg5mu+LGMZ0bJkqbGsjISLZEGoc1SipAF8mUDVkM5xm402p3um+TqkvK57WuKQNFyOpEBXIa93EC7zkWBPSH625gwTC8Vm5i2TmNl0ntIgjE6CU4543NXElpYIacUuG1ELXuTxEO+fcHBTW6/l+ywEMXnCwzNKQ1Z6Q/RKG4rBEcU1RmtuusLC9aaCnIOO673Wc4t6iwJ9PTFBL8fjeazlIrlPC8fxQxGKoo0/+UHo4hUtKydTfcOhcnZr9KPjyduD41vb655pXG/LZxKV71Wf9925e4qWH2GSo7U7AII3eiC3iQiWXDwsBeLDlRLrAPeuo49MT9uJAByTpL2ivmkZVI1EIugY8+w== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51809740-7ed3-410f-da3e-08d86adc7226 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB2946.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 16:17:11.9739 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d+pAuGLCKETiYKMR95/bwRmVQ+5fNGJLM9XHmZ5sMnlaP3PS2pTSxRB/KtAvmn8cTU69RgMqr5L0/zeY/wOlIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1315 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org AMD Family 19h's RAPL MSRs are identical to Family 17h's. Extend Family 17h's support to Family 19h. Signed-off-by: Kim Phillips Cc: Victor Ding Cc: Alexander Shishkin Cc: Borislav Petkov Cc: Daniel Lezcano Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Josh Poimboeuf Cc: Pawan Gupta Cc: "Peter Zijlstra (Intel)" Cc: "Rafael J. Wysocki" Cc: Sean Christopherson Cc: Thomas Gleixner Cc: Tony Luck Cc: Vineela Tummalapalli Cc: LKML Cc: linux-pm@vger.kernel.org Cc: x86@kernel.org --- Change from the original submission: https://lore.kernel.org/patchwork/patch/1289843/ - Added Daniel Lezcano to Cc. drivers/powercap/intel_rapl_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 6905ccffcec3..56894f4cd394 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1056,6 +1056,7 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNM, &rapl_defaults_hsw_server), X86_MATCH_VENDOR_FAM(AMD, 0x17, &rapl_defaults_core), + X86_MATCH_VENDOR_FAM(AMD, 0x19, &rapl_defaults_core), {} }; MODULE_DEVICE_TABLE(x86cpu, rapl_ids);