From patchwork Wed Oct 7 16:14:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 11820953 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCCBF14D5 for ; Wed, 7 Oct 2020 16:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6E2421941 for ; Wed, 7 Oct 2020 16:16:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="4WqttiwP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726400AbgJGQQi (ORCPT ); Wed, 7 Oct 2020 12:16:38 -0400 Received: from mail-bn7nam10on2074.outbound.protection.outlook.com ([40.107.92.74]:58706 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729157AbgJGQQh (ORCPT ); Wed, 7 Oct 2020 12:16:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VaPzv1XUWGg1/hm4Ep2/7GpUoa+Or1qGKjJGHc9xtPcQ6q+uiN/Gy0WhalK8s6q02Egv089DBCU+NvPaXnvBIcPcA9FjeT8ifJNTp4IN5Q3DiCBACdKpthJQd+7H5aokjuu6L+DkCR65V8h/HV7PHltwCqgSzzva6577JKd6N6RUJq1/U4mu+LA+z7R5p4mBgMdNDoaGnO/tdV2+qwueguFY55JkoE1OJh1CeSdCGw1vo+Wodk9qYucnkWiHPa/rbYJ1y6xPGdu97c35QpGUbQBh0bStQm0ojE488U0ptgKjdWg1RvcNax2Tbw5OCw2GciRNPFH+oAgoen2k02XHZA== 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=btFMeEr/9Ss4NPCDB+i+z2zZ2GJmJwW9JL/gY//Y1BY=; b=O2F8VGhM6cZ8kRTCH9R4L6421MRKL0PW43pinegNjYVngMBW0ERx8p8kolUBhTJtBV3OpODo+2dEKi61vQlHJIl506Jo2pS6CbBXbMQUW1S7zguhBGBcmlcOl0coD8DxcQZtu7hIM7L5u7Zo4hFaCHmGDHSpCbr+9NzchGJgmUcKSmFj91O3ipAk4jvgV/4CPr7nvaW6ZV0LKnR04NowjAzVu1/hB9eIZXiBQGOZsLzXiqr2CyIFoqDKJVK9WtP/DYOBhCj2+oim6xmUChlEqO3KCaqrBAHgjiH9mFDK3dDqDXmh5qWpbpQSoy1SGN88W9Rbz8lpNzq9Q60XgPM2Eg== 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=btFMeEr/9Ss4NPCDB+i+z2zZ2GJmJwW9JL/gY//Y1BY=; b=4WqttiwPdmBwWEKBNhat2H8GXQA7xUgyX/KhEmuJe26eZ4uBrYARoNd1HyuK+3bxMlKv3LnNATghtSYKcCgmw6k6CGKngdIGVZLvPKFErWZ9qlw3bFwddYTyrDorOgT4MRzLF5YFxP9Kgy8F4zl9fRNbGUWxj9lo0WJSR6M97/U= 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:32 +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:32 +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 1/4] x86/msr-index: sort AMD RAPL MSRs by address Date: Wed, 7 Oct 2020 11:14:36 -0500 Message-Id: <20201007161439.312534-2-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: SN6PR08CA0009.namprd08.prod.outlook.com (2603:10b6:805:66::22) 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 SN6PR08CA0009.namprd08.prod.outlook.com (2603:10b6:805:66::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22 via Frontend Transport; Wed, 7 Oct 2020 16:16:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ebff4f98-1e0b-4f99-eac1-08d86adc5b12 X-MS-TrafficTypeDiagnostic: BN8PR12MB3106: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u2r6DJcS5c46QUCRDgI81zWoAJqctIukEgZQqpAP2HJiIfpUeqywjsQzjrny3CORLEoPJFAiZHTyOavyKV0urEt/bobWUAoLbhk+ndI0giYuWPB//uxocg01CQ0N5ZlH3rEiSLZ7JZY6JWWtVpXRgwjlxnXchYXwqLMXu8kztjOn2cGPCJ8U6D3UzHJ8ZRgJWFNPCBGlfjx18Qvytt1d1MLcrMz0GDGlW5o3uipLnw7TUxeJ/daubly2pE963H+2/q26vulU7D/duOaCv73gXchnHHEEGZY0oq8oKprpKI6Wv1mIPJZrwV7cD1DOaYa8lKNp3tsUJI1XtKoBUzSbGGXSgeGrMGxmnWnIR/UEhAHdgbjfmjE2lB+w2cOzoVhDVBVfah49FyOuFXfShRoJAGZ54wZH93kedQ5aSK4WLvj+Kr7KrUH0xG29vkTR9xLulL45azjpiNUgdavVxlk96w== 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)(4326008)(44832011)(52116002)(5660300002)(6486002)(478600001)(966005)(66476007)(7416002)(66556008)(66946007)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DnUoYLMwNW3ADr4oUA7Q318ULiKW0JT3coCiO46OY4f5fbZmaeLuRx6OHamWNUccfJej0N3at0QemchMZ2FCuCBMYI2aae8mNrujHFdsUsMb24YWoZ0nqAjPLTAl/0IP7ihn+/6c6lHfXAG+Ty/TZCSXDcrIQJWTk8GvVVd/a4ilp5IM6Y02rvys67A58ZP4Cvjj3eEmcUbjcF/HOQoTFP5eivYsN6e1//pR7OI9Dht2gVBmZpYhaHnSvOMKId5VNDFaaptCCmGYUBhyi7tSLlxnzVAVthFTQcZnBJf9ljLtSHk6Qr/JwY1iFtbbJubHlYH5OFmzKYwDIT9PXAEdsDzPq/tIvSMjePeoLeQBsNoxjOAqzyBruIOqFKBUHXuEv8lYR5EA/TvuXYaTnM/dd/FoaDkbLSpI7X2J879ovCLOd8VqJoeVB19lXKznZYjspqXrZDSf5HOb/y3Goed136su6eYJMIovjeR9SPMWMPt45I/rRTlGxKo9ktnPFCFC7myzFgGGsQrkA8jf7REPd89aPdmgmTkubF8V1k396mtQoiHwCH9k5CbW0eOKN/j1cWd0hgYyH2W3+2TGct7XyWqi9jdu818RrWOOsvJJzwB9ZJXF2eMFzqs+lGD/Lw3tK4EKb84r5Fd0HMBTISimGg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebff4f98-1e0b-4f99-eac1-08d86adc5b12 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:32.7570 (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: Yu5f0y9pE/gGDTv6yqBDDntOj5Wk+QDxZSatGLcw0MN/CDnRP/pnTHNfqHbysmsGMptI2zv34KiJUf9luaXrUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3106 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Victor Ding MSRs in the rest of this file are sorted by their addresses; fixing the two outliers. 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.1.I8556c0b9b6f75bf3121989f5641c33e694fff8d9@changeid/ - Added my Acked-by. - Added Daniel Lezcano to Cc. arch/x86/include/asm/msr-index.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 2859ee4f39a8..f1b24f1b774d 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -323,8 +323,8 @@ #define MSR_PP1_ENERGY_STATUS 0x00000641 #define MSR_PP1_POLICY 0x00000642 -#define MSR_AMD_PKG_ENERGY_STATUS 0xc001029b #define MSR_AMD_RAPL_POWER_UNIT 0xc0010299 +#define MSR_AMD_PKG_ENERGY_STATUS 0xc001029b /* Config TDP MSRs */ #define MSR_CONFIG_TDP_NOMINAL 0x00000648 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: 11820957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1927014D5 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 E1D842173E 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:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 11820959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 665BE1580 for ; Wed, 7 Oct 2020 16:17:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E72E2173E for ; Wed, 7 Oct 2020 16:17:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="fjqeXc3o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728599AbgJGQRC (ORCPT ); Wed, 7 Oct 2020 12:17:02 -0400 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:61856 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727152AbgJGQRC (ORCPT ); Wed, 7 Oct 2020 12:17:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DIkzDK/3xB5pIdWh01Q3SPeEV+WMNd6v0sw0xd7BVI+SyitjJtBXzMDx46WW6V6ZJyv2Rs1PobjCEHzEUVXV4klhFKzCJmuckDo5huODXewGGDrQ3nHJfQn4pfzIZ6h7Ur1VFvLYviVdsL0qoupf1pXNOWO7twWDOL+l4ZAG7tYCNIO0pQu8trE1hr4OZQKq8FfT79lJsB9/VLQEx8HdCJmBrm18c/DNYT9mgHsL//b8bkrPqBj+eSOn8WbJWLUkToiT3y0JnHYkc8AF+COWzqQea8UMmlycvVfY8ZmDPI68k57nLuwbNIo9AXbxDpcg3eT7zCOLlM/XHDHTRAldGw== 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=mkTwbv/DDDxRuCnLAMSgOwJo6omE51WScq9zVlw0cmU=; b=FcPWKnnBiYSaFFfskcr+HboL/TaNEnqZKuglvyL8dPgPdQsIP5E8oJVWTPD1d7aoaOMwcm8IB+zqWeLKexTJdc1zT6w8drg6r89SJ7thkCR9mhUVGnl2aa0DGvta7niudONYuzWUkRngDgto2e0fxhYYLZPliVceYijHSE5/sTlQlC3at078yU0GuL+JnnxY/r9KeqSxRZ/E/o1tF/GIP8DlIJxlG59+aSVp07xlrhViwIGwQu0Sr70d0Uf7yZlGNW/MTNtzUQExQyg5fyk/f1A6IST5/++d8GFRghy9huu+UgZsVi3QsHcPsnRF3Sb+suq99wiiQG8KqRgPI/1rDQ== 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=mkTwbv/DDDxRuCnLAMSgOwJo6omE51WScq9zVlw0cmU=; b=fjqeXc3oElrx4emlchTVCZ5nFbLxtu0Y1FcX1qrXFa4SHpoJFMZHxUaEyA3PNjsp4XlPp+rsTKZI67kxIkqGkJrqGNw3gZx4VlyGkRcCuNufbmq24NFL9/AuKv2F3zNSZp+JUYprpiuAWm9vNj/cJD942957taldrELDgs35Pw0= 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:16:58 +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:58 +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 3/4] powercap: Add AMD Fam17h RAPL support Date: Wed, 7 Oct 2020 11:14:38 -0500 Message-Id: <20201007161439.312534-4-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: SN4PR0601CA0016.namprd06.prod.outlook.com (2603:10b6:803:2f::26) 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 SN4PR0601CA0016.namprd06.prod.outlook.com (2603:10b6:803:2f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Wed, 7 Oct 2020 16:16:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c0864b21-4635-4d60-096e-08d86adc6a66 X-MS-TrafficTypeDiagnostic: BN6PR12MB1315: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X+HqpP3MmyMTcGxrpY8Vo3Xy+8XTiUjE5MvCRsn87zBGNyL34rOW7N1E15ChhASPIqnTovLadi4IGrdLQCGTTmx2meWGW1yFQirlY1a+cx8RMGPmhn6WlclCa2V3RIZbaFp0l58rz5KkpDViDZ2ypwL8oNIQdCkfWRFYxPAPB4K/bDuIjfzZuRSaeBdQEToiqU2jAjgeFYEaOOwgLMpoMeZdwIxrWjAzGwgSh+lh0na+4pTKlaeE5UtuY07C2lQP1IxknziYVyIyPFCL2zp6Kit1fst7pEPfxsqc8xuzMLPt+GdLS+9A3ybjPpk0HWXLe9c6nPBjy15C0e2YkWDEpDtKr8bV1iSa+pk+inYBKUn8hDjHjxanmBREM0nIc7MxOagg5miGg/SqGeXAoYOU1HK+6sOWNVu21Z0SyTSWhZOVMAMb8HwUyxYv57L8kJVGAed/+MyXovASlQDyKgxRLg== 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)(83380400001)(966005)(4326008)(83080400001)(8676002)(478600001)(6486002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: KlzX8i52ImT0nz/9Cy6eEEjkYgPpXWDmfRqARuTyYLyoS32Os2RxyYQHsHAv8lL/3DplR2DmdpqFN9iIoWpQWI5gB3ncjDyVfD5qSU+1R+dnfr8FaimnQ9UTWun3UjJVodpBxmDa6jxNB1bWerfs4VKFxq9Jlq+8OoLEMyxEe7r68V8f7zY5PqZk2Ngel6uENL8GK7FcITmJRCSNtEykZW5ik9XsPzjSd+hIf5gMlFNlX8e4z2jmXYiwMg+rcJVt3TDkbOfgsj54zUzMh+obb/ZZlCQy1yqRm9rct/jI+WStFfCxUGXph3O/5qTAxPwgCx0irYhnVaJnfrd5y0GCLBml6E41VrzUZSnITMkPqcwo0LN8jxx82noWklu84bJxmJeqd/u6ZKLzWv9koFLvzuAEIdrRD+zrA84qG/cjvoggh12nOjR+G3xuq/oLCG9UqVJWWYjJg0Ups/rwJWhYKSk8oEpsaKOaEld89OcJSfxusMkImTMHDplbTbVnUlEHvsFUMRINsgVXMQ1DhZzsmgS/GvoZo6RE7Vpv2Nu9a3jD/nzsNoKC8BEsQnyq2AJlz0robNXwOb9RbYtiMLyAAkttF1nG5R4qychfPV35Bynw/pkQs0loSLz3tfHSmNxckO22GDq21sgkzo9YJdfdCw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0864b21-4635-4d60-096e-08d86adc6a66 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:58.4575 (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: L+qksoKnpGgtOZmDLARbfDVOpKrA5/wJbCx/X9e+DKMBwBHNh7HLH+DLjvVpxxfRXGTFol2yhcwZeef7Cpp/lQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1315 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Victor Ding This patch enables AMD Fam17h RAPL support for the power capping framework. The support is as per AMD Fam17h Model31h (Zen2) and model 00-ffh (Zen1) PPR. Tested by comparing the results of following two sysfs entries and the values directly read from corresponding MSRs via /dev/cpu/[x]/msr: /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj 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.3.I01b89fb23d7498521c84cfdf417450cbbfca46bb@changeid/ - Added my Acked-by. - Added Daniel Lezcano to Cc. arch/x86/include/asm/msr-index.h | 1 + drivers/powercap/intel_rapl_common.c | 2 ++ drivers/powercap/intel_rapl_msr.c | 27 ++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index f1b24f1b774d..c0646f69d2a5 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -324,6 +324,7 @@ #define MSR_PP1_POLICY 0x00000642 #define MSR_AMD_RAPL_POWER_UNIT 0xc0010299 +#define MSR_AMD_CORE_ENERGY_STATUS 0xc001029a #define MSR_AMD_PKG_ENERGY_STATUS 0xc001029b /* Config TDP MSRs */ diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 983d75bd5bd1..6905ccffcec3 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1054,6 +1054,8 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNL, &rapl_defaults_hsw_server), X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNM, &rapl_defaults_hsw_server), + + X86_MATCH_VENDOR_FAM(AMD, 0x17, &rapl_defaults_core), {} }; MODULE_DEVICE_TABLE(x86cpu, rapl_ids); diff --git a/drivers/powercap/intel_rapl_msr.c b/drivers/powercap/intel_rapl_msr.c index c68ef5e4e1c4..dcaef917f79d 100644 --- a/drivers/powercap/intel_rapl_msr.c +++ b/drivers/powercap/intel_rapl_msr.c @@ -48,6 +48,21 @@ static struct rapl_if_priv rapl_msr_priv_intel = { .limits[RAPL_DOMAIN_PACKAGE] = 2, }; +static struct rapl_if_priv rapl_msr_priv_amd = { + .reg_unit = MSR_AMD_RAPL_POWER_UNIT, + .regs[RAPL_DOMAIN_PACKAGE] = { + 0, MSR_AMD_PKG_ENERGY_STATUS, 0, 0, 0 }, + .regs[RAPL_DOMAIN_PP0] = { + 0, MSR_AMD_CORE_ENERGY_STATUS, 0, 0, 0 }, + .regs[RAPL_DOMAIN_PP1] = { + 0, 0, 0, 0, 0 }, + .regs[RAPL_DOMAIN_DRAM] = { + 0, 0, 0, 0, 0 }, + .regs[RAPL_DOMAIN_PLATFORM] = { + 0, 0, 0, 0, 0}, + .limits[RAPL_DOMAIN_PACKAGE] = 1, +}; + /* Handles CPU hotplug on multi-socket systems. * If a CPU goes online as the first CPU of the physical package * we add the RAPL package to the system. Similarly, when the last @@ -137,7 +152,17 @@ 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 = &rapl_msr_priv_intel; + switch (boot_cpu_data.x86_vendor) { + case X86_VENDOR_INTEL: + rapl_msr_priv = &rapl_msr_priv_intel; + break; + case X86_VENDOR_AMD: + rapl_msr_priv = &rapl_msr_priv_amd; + break; + default: + pr_err("intel-rapl does not support CPU vendor %d\n", boot_cpu_data.x86_vendor); + return -ENODEV; + } rapl_msr_priv->read_raw = rapl_msr_read_raw; rapl_msr_priv->write_raw = rapl_msr_write_raw; 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: 11820961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3FA914D5 for ; Wed, 7 Oct 2020 16:17:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3A022173E 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);