Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8097481rwp; Wed, 19 Jul 2023 05:20:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFDIm5hN1zQYN8bPgU8ejNX/fsJCTnbI+oW3mXrAZwLpXoigF1DhrxOHwGRtfD8SbFUOy9 X-Received: by 2002:aa7:c606:0:b0:51d:b89d:9819 with SMTP id h6-20020aa7c606000000b0051db89d9819mr2739940edq.1.1689769241432; Wed, 19 Jul 2023 05:20:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689769241; cv=pass; d=google.com; s=arc-20160816; b=Z0SpadViaHaWaqlBg0sYD/gqq0OjKJy50X3oQkv2Gd+V2RIU1abVVCS9waL9znYbun +urtTyphLiZBLn+C5eAPgEssuH8mqU+QjqMBjYy6M8Ld3BzIkspFZ/U9alw2x5GT8fny k5EOndikxDd2x2L/0wDL+zE2jVQVlmTCHJ2qsXhm6+IVAmz/gztlKKMv7aKT58fG+MW2 QOiGvO94CWGjm+G7Xg5yA8/5sD1QMQldGcNniufX2fJe16a5uhjoplM7yV9bk+r0TCA4 1HJB+9rHetX2SEMnYfreyiPST012t8Op4Q1J1Tfr4cRBEHM4F6cZp3qUVQasDyTLsH4h 6mMg== 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 :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=t+aWWqpUAzaQzcj1qulMugTvDmTXZSXYL2fIsGji8j4=; fh=wtOspjvF/Uae/KxuAfFPMoN7b18siLL85WcOuEqBVoA=; b=dmq/aHqU1dJm/3npR9qI8rrmiohMh8LAdc2QHrTdMfdoNMBf/aNXHrleY525pFHHVJ lCnR5MNmBMSnfNDeI1alt/G5TX0/KQuhbadCRHGxWSjf3Q8mwKSrVmXN4hG9wGVrx35N zuginjHbkZ1GGoTJBelrXz4/ABvjjrZrggjXj8iNQ3Z+M0nHUIGtf/jeJSnIalUPOkwR pxE/Ayxs+0ChwGQRbKlEGpCopnxQqIkypwaZ7ebcS9jc7PsYRCHHBiWOe0ClQE8I7BiK taVPRQ42bstq1d0hpKP1DvvlqTktb5XedxO5AlHuq71XabC46i4jrON2DieWXyqx5lSM y/Ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QlQSDhc1; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020aa7d050000000b0051fee9567basi2848761edo.619.2023.07.19.05.20.16; Wed, 19 Jul 2023 05:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=QlQSDhc1; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbjGSMAT (ORCPT + 99 others); Wed, 19 Jul 2023 08:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjGSMAS (ORCPT ); Wed, 19 Jul 2023 08:00:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78F5C7; Wed, 19 Jul 2023 05:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XCPvLteA7Dawzg7rZeud+D07kU2CzbWTbNymjerfL1AxpYzJ/A9gvIHSTNg+bt5jRMrSnNR63+Q1kabyqCgI9jS9C1Wy3eGULmIxWHru8ATst5ZlP1rvUP/KChq9R3Ttk0CIolLpNEEwgO/lPMdXaE0UoffEJ3FLC3s7oWk4AXEN0MLbhv5guEX/A/6PP5d9imUkUCNzbxuXobEn/A47kFhHRwOR10h0YENX/c1O3XgH+miAkR8pZT6cvDjoLi+eoSRmLyHBqcjkDMrPvod7tSe8wt2Qt6ts3av6LN/F6X23Y3/ypzY293Jg+R0WEN3YaxslwXcOUhm+Bb8qbCio4Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t+aWWqpUAzaQzcj1qulMugTvDmTXZSXYL2fIsGji8j4=; b=Hbz6pHAk1Ua/jSbsRT8VlCYDZAzm3WKQHIcayxaYlR/vomT+uHTcN/dE/Iko9v4FTddfZ8QSkYzDzz1fTJFONsiDBawN0LMHn2xb00r12qYACqv8WtGYZuV4q8Ig8iovfG+hzL8qwS5eS1QSn7z9c36R8IgY6HNQPPCnGxWT+0QeZczv181tIe9WEOMcoQXNGzRDCWDXDk5gJwrKGDuF4NUPLSVXGabDsOQOi+uRz0VrprhxAnOwYG1l+kt7YnhZ2L+e4rfO2olRy70dRX5vxZ3aepvnK4jsi9KRCeJOnK80XluWUkRHYaVcv9LNODj/TuMwoFRqKgolYgok0SzK/w== 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=t+aWWqpUAzaQzcj1qulMugTvDmTXZSXYL2fIsGji8j4=; b=QlQSDhc1jA3II5fUwPZVaXnF4KMFxOR2vhHkuHxNvYMbt5D34z8wHDoWDAmsdb+EFYpDDqawya9pL4gV6nao0oVUYFGQhZEyY1uUZHlb3tHcxqkb9m1YF1pa4K3hxMZVvSu6t4vZCb/BRJTtZ9ve/WqXbCIwbNtcHSSJ6mYjnP0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5712.namprd12.prod.outlook.com (2603:10b6:510:1e3::13) by SN7PR12MB7204.namprd12.prod.outlook.com (2603:10b6:806:2ab::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Wed, 19 Jul 2023 12:00:12 +0000 Received: from PH7PR12MB5712.namprd12.prod.outlook.com ([fe80::f535:4eb5:f7a0:ebac]) by PH7PR12MB5712.namprd12.prod.outlook.com ([fe80::f535:4eb5:f7a0:ebac%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023 12:00:12 +0000 Message-ID: <3273e3fa-52a7-ab23-b64f-217cc410915f@amd.com> Date: Wed, 19 Jul 2023 17:29:55 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/6] x86/cpuid: Add smp helper To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, x86@kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, eranian@google.com, ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com References: <827723d8f506411700c68bccc5072ec8d918d2de.1689748843.git.sandipan.das@amd.com> <87v8egwe9l.ffs@tglx> <87mszsw25c.ffs@tglx> Content-Language: en-US From: Sandipan Das In-Reply-To: <87mszsw25c.ffs@tglx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN0PR01CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:4f::20) To PH7PR12MB5712.namprd12.prod.outlook.com (2603:10b6:510:1e3::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5712:EE_|SN7PR12MB7204:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c2fdae4-39af-4c3c-9916-08db884fb4c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iSitX1v4JrHevYPKoHyUV3VZS0hgKDM9VZ1lW5QE8Ig9BZSMCO+NDjcQKhgJncRjUWx+4j6T2/xW0isDSk3q0qmdKc4PzICmgSjvdNMnQbVcYQsCLn+Hx5UAdWKL+lay0f8ouCCqIcj7Ks9gM8kgL3FOrqXRU65W7oLLAB+BnDdkBIB/xsZK0KQF4tluRmQCHD/+sup0aX6qT5zE3n2IOH0K5K50iCCvvj2MZttx0loOr2UcP9ao+woihgWCyIMq6WsNXUHah7ouNWj0W8n4uQ8Ye5gBY4ALzuusr4zkX8Ecijr9DTEFIlVvUFTSg2dK7IhIzSRm/EPJhOgpvjz/5cKNGziG56Z3UmTykBopmkH5oJHLCzqvA4Cla9foncIcm399sqpSGxNAP/XCzX73YBEs/atcjJ3pIOs/P35BuInwaGDT5/1ONEkB/kCOU1KK/H0FZv24kBhS2QgPElsr1i0adhmmu7rKjjLM8TO088KOXl7RTg84yZhaHfqKMCXnOgWOlWPjmOh/apaQp5qYl7Ifko8fSqfgnFi19RkbW3VoIQljGPukFfsQdUneoEL/VLiDCYjg18P5PgQev1D0dartSnBZ73DS8sIy7rJMhn6tlh8G/F9NO11KJk/HTRz3xjcs2zhNMFTLjTCuiwmtPA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5712.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(366004)(136003)(451199021)(53546011)(6506007)(26005)(44832011)(36756003)(38100700002)(86362001)(966005)(478600001)(6512007)(31696002)(2906002)(6486002)(6666004)(31686004)(8676002)(316002)(8936002)(2616005)(5660300002)(83380400001)(66946007)(7416002)(66556008)(4326008)(6916009)(186003)(66476007)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d2E5RTRhRkZ4a0tpc3ZHeHdHd0ZVMjgrY3Q2Z3R3VVZZSHRKWDNtLzBxeUxo?= =?utf-8?B?ZTN3L2NrQTNCNktEMWprV2NFdFBEVlRZWncyb2RVc0svT01UdEdkUHR2WVJT?= =?utf-8?B?dmJwV0ZLRGdWejltN2Y1YktVRGtYR2ZXdGJ6VzNpeWFkNTJ3TzMvb1ROZXRU?= =?utf-8?B?Ti9kOFRSeEEzSzdFakgvU09XeU01UUFRdzdlcnZXNnJBUFhPdXIrT1VHMXZL?= =?utf-8?B?UGtGdXZBc09TcW9JSHRJTktwUCtCdTNmZnk3dCtBMlQwMWxlT0QybHY1bFMw?= =?utf-8?B?c25DUUwwUG1Ndjl1VGxwYzdpZ21TVWVhcXdCNndZZHF5SDhOdy8yYVdwYmR4?= =?utf-8?B?alROV0h2K3Q2Y1llUVR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S-Exchange-CrossTenant-Network-Message-Id: 8c2fdae4-39af-4c3c-9916-08db884fb4c5 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5712.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:00:12.3667 (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: TgWwTWP6kVWHWdBPB/Zj7/E7QKfm1TFNwfEWQaBbwa30kGmz4wRVG2i3oeDwRkSzYwMMb4H0uUoEhzuAIqtnBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7204 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/2023 5:20 PM, Thomas Gleixner wrote: > On Wed, Jul 19 2023 at 09:29, Thomas Gleixner wrote: >> On Wed, Jul 19 2023 at 12:25, Sandipan Das wrote: >>> Depending on which CPU the CPUID instruction is executed, some leaves >>> can report different values. There are cases where it may be required >>> to know all possible values. >>> Add a new helper that executes CPUID on a particular CPU and returns >>> the EAX, EBX, ECX and EDX values. >> >> NAK. >> >> This madness has to stop. The correct thing is to parse the information >> in CPUID at the point where the CPU comes online and store it for easy >> consumption. >> >> I'm in the process of reworking the CPUID and topology evaluation and >> that's where these things need to be stored. I'm still fighting some >> nightmares with the already existing mess. >> >> Look at the mess people created over time here: >> >> https://lore.kernel.org/lkml/20230717223049.327865981@linutronix.de >> >> No need to add more insanities to it. IOW, this has to wait for a week >> or two until I settled the remaining issues. > > Actually you can do that today already. Either make it part of the CPUID > evaluation or use the perf hotplug callback mechanism which is invoked > early on the upcoming CPU and read that CPUID leaf. > Thanks for the suggestions. I'll start with the hotplug callback mechanism. - Sandipan