Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3477186pxb; Mon, 25 Jan 2021 18:07:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3HEilJsoNObfsk5uPs4389uRe3f9Pm4waTz8iuacdf/ajIHupenjAPYXW+ZMb6I8m3lvd X-Received: by 2002:a17:907:6e6:: with SMTP id yh6mr2057188ejb.466.1611626851361; Mon, 25 Jan 2021 18:07:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611626851; cv=pass; d=google.com; s=arc-20160816; b=xpiLCJVFuJraaDvF//7/yOtgV7B1VeT+Sn0VK7bZzHf1yYWRCTePOMybDZPTsV2vaD MrtdlEHx1sBFt13KhypW45vD/oOzFdyxm0meFtikL/tC0odDcpJWBte5TX5DtCQkbD27 J+A7z1Ui2tYngXeU1EhpHvWQtg0OPzvKv1Qh2RbBNVlOo347lhcxqLaBNQVYx3s/HHoZ /4lM26diullB8dmcbMiWIgjh4IbTHM8/RT2/N/7Dd4ax6k5sazP0wAMnCrEEil2cEQH1 hQMr2M66gvL3qVxEOjB7RF2g7dOS9BgLkcBZ73lWSO6jF+LJnOlyjiBwoavPFJFj1MOX Bo2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=0YSt70VLiIr6JyiUMTvCebZ3Pr7yHmJM0nBy5QIEej4=; b=b+wsI1Wh52z7hiOL0iTdnK7aRRxmojLc7U2TjLspTN9XeoJ5cUXG3SW1mpJ48PProE NjBvKnxzOMZ357xSE6iZn1phdPl7Mmn6jJwu6JdGSZuRMMTcfCi4rd23LKCU+5YPV/dC xFfdRdSQ8mgldN4TPVIpjghZONbMGdBVxssgyEhxqjPZ83SkxhhUoBunWvy00TPm6RIl ejYU+OWBCHn0CG9JiiLqnQBTAkytuT6YcYc1hWXDmDaQ1hem8VpMXH9AuHM1cgZwYA0z ctHfI5CNhjqqkeVFR/Tshp31ornshB60+EaIlkXuiiz+ocpz9jQ5t1a7yGwzpEfnyDgq eQeg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tUrutyww; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si6508065eji.385.2021.01.25.18.07.07; Mon, 25 Jan 2021 18:07:31 -0800 (PST) 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=@amd.com header.s=selector1 header.b=tUrutyww; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731027AbhAYRgD (ORCPT + 99 others); Mon, 25 Jan 2021 12:36:03 -0500 Received: from mail-bn8nam11on2054.outbound.protection.outlook.com ([40.107.236.54]:22624 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731069AbhAYRfW (ORCPT ); Mon, 25 Jan 2021 12:35:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3qLPWoJBi3beINZjWLSWNYu6dCxqIG9C1l3BLoNCRyo014MPFkm9SrUe6bp/iHM7FmUl8wjzG1TE8yKffRUPcBkZlPsu6IbH2RnTax5WMD/32q6g7tiE0t9+tPyRdV4lpG1/K1zGtNUBEwOe8CjmT33dA5J4sATeNO3j3nA0uS1Mj5fP99q1O5mkIfxd9N+D333LOSQRPmP/Thig7i54J/56xjHcA0P8lJB+k1HvVOwkG37kmpJYOv6R4gLT91loC6BEKDQKPnTmamOiLhzAPFseY+V4GOwzb0SxNM6Ojoe3UHSC+tSe6lw43VaXnmMnUNtDL42XdfiMkMbeIywMQ== 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=0YSt70VLiIr6JyiUMTvCebZ3Pr7yHmJM0nBy5QIEej4=; b=WzEK6INpT/iVENso7tUKBOnGS640Ezc7kW7S0rHUM8K7KlrlJSFtJUlVO9y0e2wmgpz7+hUAZ3RGc2h4pDFrEEFIlxpfAtgMzwu7J4IXCBYKbhdLPx5RRFf2eufRzsuHS+Ot8hu0wgDrjQ0gDhegHVENsltaPi3OvXqzjJdQbpTPrT2tzeZcOKGFb64EqjvYbhRUjPR6JsyE2wjqHLIqoVlPPtrJsIL/uf1iZUlljm4M/EjMBLOSUQKOGO3EwY/lPX9B4nB8U1KGbj7gEXQUH/gXWow2H/pR9Zfl1+mykfAnk8iVCCv+7dT9IXD/y2bTdU2RigVRizmX/s4TnbncZg== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0YSt70VLiIr6JyiUMTvCebZ3Pr7yHmJM0nBy5QIEej4=; b=tUrutywwPwWcIak+n3eYqKAkgbUJy3ePpEsduWIqZSLcMlR/5ZIHSvIZn+1glBB2hdYubCLM4+paVBHnB7UHVatyhIb4wXQgUIP6v8EZMs3iKdX84dnIuE97/0MA52l5Gpx7OK4RL0kVN3I673FF377KiqzujeAS4/8Lgrct4O4= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB4720.namprd12.prod.outlook.com (2603:10b6:805:e6::31) by SN1PR12MB2576.namprd12.prod.outlook.com (2603:10b6:802:22::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Mon, 25 Jan 2021 17:34:26 +0000 Received: from SN6PR12MB4720.namprd12.prod.outlook.com ([fe80::71a3:7df5:647c:1665]) by SN6PR12MB4720.namprd12.prod.outlook.com ([fe80::71a3:7df5:647c:1665%6]) with mapi id 15.20.3784.019; Mon, 25 Jan 2021 17:34:26 +0000 Subject: [PATCH v2 0/8] cpupower: Updates and cleanup to support AMD Family 0x19 From: Nathan Fontenot To: rrichter@amd.com, shuah@kernel.org, linux-kernel@vger.kernel.org, trenn@suse.com, linux-pm@vger.kernel.org Cc: boris.ostrovsky@oracle.com, joao.m.martins@oracle.com, konrad.wilk@oracle.com Date: Mon, 25 Jan 2021 11:34:14 -0600 Message-ID: <161159600371.68367.14890273216040482793.stgit@ethanol01c7-host.amd.com> User-Agent: StGit/0.17.1-dirty Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.2] X-ClientProxiedBy: SA0PR11CA0076.namprd11.prod.outlook.com (2603:10b6:806:d2::21) To SN6PR12MB4720.namprd12.prod.outlook.com (2603:10b6:805:e6::31) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ethanol01c7-host.amd.com (165.204.78.2) by SA0PR11CA0076.namprd11.prod.outlook.com (2603:10b6:806:d2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 17:34:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52d37077-303b-409c-22da-08d8c157765c X-MS-TrafficTypeDiagnostic: SN1PR12MB2576: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bzQF8VIlFwx7F9xRLhDs/BUpW2RnbPKDPxczR9yWrm881bZiMUe5YK2cfeTPupW0VQ7HYbkVVHxHs43T1fiSmj8/4q6fmc0aq0fHgT7rLIOeGgqEURUdPG9Y4ts7iZX2qILjjzUFDui1pxjndKaUYFTHVW2cQfhluxcVS4NtgOZKBjsn1F/KmJj14N56fx939JAyLMHZZCuKyolSPGmlKYjsxbjVE5ls9uj0pxqoDXeI6gOTQHVvSXnqlfxedwHvmHH6bW1JKNMSWhcJ52sHroSrL+S5VAFw4PTmEOWotGdWk52j5yeAhJDDaLXmHrx2a38DXZM7qllX9daf578DI1GYcISRjWUvpMUeG9foN5Oscm4RiSryxEAin5DtV+8cIkZx6Mf05Y50BN1dnNF/tQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB4720.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(66476007)(66946007)(66556008)(5660300002)(7696005)(52116002)(15650500001)(316002)(8676002)(956004)(4326008)(83380400001)(44832011)(2906002)(6666004)(86362001)(8936002)(478600001)(26005)(186003)(16526019)(55016002)(103116003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?RVdZY2lycWxScnBCSVNjdzdjVW9nNFA4MHE0TGdtbUdDWFd3K09L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Rb0NEbjBnd2xkZjkwbUFvTHYwaHAr?= =?utf-8?B?UHZPSmhYR2U3RDN4c0szUTg5R2RMSVk2VW01cGhScWd0MzJHRzlDYnQzeHZn?= =?utf-8?B?Z0pVbzU3bkFDTm4ydi9QY3N6c0FMcm1zOGErTnNhTktCd04yVjlhNHduQ3hD?= =?utf-8?B?c1FpZk50MUpVNGJUeHRhMFhZYUxldmc0eHkvVFZuV2tFdEtLQ0x4SmltMWg3?= =?utf-8?B?QWhiUmlyd1p1ZXNCcm5HMTB1b25nOURXWkFWUEFTZlZSUU5ndHhWREtDOEZ2?= =?utf-8?B?SUlrZlczbjNxOURTMlFQVkpTanVvbHMrMmIvbmt0U00zUG5KZVNhRHFTV0VL?= =?utf-8?B?eUNha0EyWXoyK1p3aGtHUlkzVlpMTnlRVGFJdlJ4T3RFQ1F4eFFSMUVEcWFI?= =?utf-8?B?Q041ZjNiSlN5SG9OZm03d3R6T21IdHJadlhCcytNTHlKejdVbmczWlk1Qmk2?= =?utf-8?B?SENkN1BXbXFmWSt1SjFjd3dCYU1nTUlzZXRScmxjaytqV1l4SUxGcEh1V04x?= =?utf-8?Q?DrLoNlOe?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52d37077-303b-409c-22da-08d8c157765c X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB4720.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 17:34:26.6459 (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: VMIuEf1oTqwjOuuhfJ8eyJf0uhS96F7CixRuvGNQwiqM1FSmGMxF+mXyrgdJ2iVhalsFbqXc5Q7ZykTlDezwXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2576 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Updates to the cpupower command to add support for AMD family 0x19 and cleanup the code to remove many of the family checks to hopefully make any future family updates easier. The first couple of patches are simple updates to rename the structs in the msr_pstate union to better reflect current support and correcting the name of the CPUPOWER_CAP_AMD_CPB cpuid cap flag. Patches 3, 5, and 8 update the family checks to either replace them with a new cpuid cap flag based off of cpuid checks or check for family >= 0x17 where removing the direct family check isn't possible. The reamianing patches are cleanups to remove unneeded extra enabled bit checking, remove passing no longer used variables, and remove unused variables in decode_pstates(). --- Updates for v2: - Patch 1/8: Add links to AMD PPR and BKDG to commit message. - Patch 3/8: Update and add back removed comment. --- Nathan Fontenot (7): cpupower: Update msr_pstate union struct naming cpupower: Add CPUPOWER_CAP_AMD_HW_PSTATE cpuid caps flag cpupower: Remove unused pscur variable. cpupower: Update family checks when decoding HW pstates cpupower: Condense pstate enabled bit checks in decode_pstates() cpupower: Remove family arg to decode_pstates() cpupower: Add cpuid cap flag for MSR_AMD_HWCR support Robert Richter (1): cpupower: Correct macro name for CPB caps flag tools/power/cpupower/utils/cpufreq-info.c | 3 - tools/power/cpupower/utils/helpers/amd.c | 65 ++++++++++++-------------- tools/power/cpupower/utils/helpers/cpuid.c | 20 +++++++- tools/power/cpupower/utils/helpers/helpers.h | 14 +++--- tools/power/cpupower/utils/helpers/misc.c | 9 +--- 5 files changed, 57 insertions(+), 54 deletions(-) -- Nathan Fontenot