From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1A4742940; Fri, 14 Apr 2023 13:48:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA8FE40144; Fri, 14 Apr 2023 13:48:57 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76]) by mails.dpdk.org (Postfix) with ESMTP id 7BE7F400D5 for ; Fri, 14 Apr 2023 13:48:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cbdFh827AZJcgzlNZsqbfDCu34ropqI7UPS0SWrFIWAThaB9S8+YBYbT75admrrQq7Yek6o6erpS58raVOxOphm+ElK6W9oteE7DhqxbBh8++mpqfQTeTgSmFxtY5c1BLk7GaYU6bMwE/Ysyeg2c2EnTmwIY0t48VjAGO9JEaok10PQAlduUNzoUDKuNeSD689/MfBRbd/mOWFVEklXSe+3rcMvuef9Ixb5PGHvv6KqHb9kiQwQwl9E1cKqpTp+L7pUevJqbemdB5kuRisp6WNZXj2FODwHpmfj0VcpAo+k4ZtByg+6esBuL9keJJmgIeg0tPpEf5zAmPCcG/saMsA== 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=nJQo0ndXJScyCJQY1kfl1zlaQQYTLw8dSnVLmXHe3fs=; b=JcABW0+CRgQQ75W8hMQk2cKGICQZHdNKURYmN/ifc3CjJKG4tQ4WZ/ecNDhqcq7BlxTzCJ/L+ODj9kyskfYRrkL5Sgr9xQByv1a57l5Nb37DxF1mDL7G2bQ03LE3N1dA3Ki4W7NNZ0PDKIsBkMzCW2CZfzXL8D0XrUCj5qDX/ezeldg4tP9BxB3lmJLVJXAThyxb4qmRF1M1PJymDeADotHCn5OeSnGt9A9WNOi2o6G9W5bLCFJvPKaDeP4emcHeHAHwyA7B3ewxUHrxRRZyiPrthfNt5N1S7LNtqFWjceElD6tZI9KaCTsn7xf3ml+kM4NApKMvt9rb8SrrGvLvSw== 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=nJQo0ndXJScyCJQY1kfl1zlaQQYTLw8dSnVLmXHe3fs=; b=jdVMEbVYDO7hktDyz0ItBqqifhR8bR8b2CRyhLjWkw/mKYoFHzVtQb8pkt/slqa+kDr5WBc3Gt7gdqvSecjL+801vUnTbctWBymRsW2rN5pEMGOAiRfhQtIh3uSTt6f+qxpeWmlrxNBxsRosV+TXMMXFRzXXt80BpontAeGMrTY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Fri, 14 Apr 2023 11:48:54 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::5e2c:c0ed:88a6:a4c7]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::5e2c:c0ed:88a6:a4c7%7]) with mapi id 15.20.6298.030; Fri, 14 Apr 2023 11:48:54 +0000 Message-ID: Date: Fri, 14 Apr 2023 12:48:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: David Marchand , "Tummala, Sivaprasad" , "david.hunt@intel.com" Cc: "dev@dpdk.org" , Thomas Monjalon , "Burakov, Anatoly" References: <20230413115334.43172-1-sivaprasad.tummala@amd.com> From: Ferruh Yigit Subject: Re: [PATCH v2 1/3] eal: add x86 cpuid support for monitorx In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0119.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: f0e807e5-f4f9-4308-ad8d-08db3cde38c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pgx6IIq9Yb9KjkBnVUgoLDrEqwqrcT8aO2mFQZwJ5Z+QVSniExdcKy1gSC/PM1INaQDN8JbvHVTcYvWlSWKanw3iYieJgl5RqejLnG8UlejcI6GX27TFWsnKMDmNj+6k5FZDmcg9g+gKZJKSMGTNjJgEQzE75MmrsbF6+6QEXm5W4Mhzq4v+imCHor+Va22GDWb97hR643t95S78gVxzz1rvNr9E3+1ZEnzWHLYlaJsg4VPqPe4tnUWT3uwcMSJPGMe1hRxRuVtj7TZI8lCq8p4vqnkSaFpIjm6/4pvL/VZcn0wSiI7ciscAvhuA//jgex1iOWv6cwvA3vv487YU4jlgjBYMz0cELX4cG/G2uEU21kHnmGS6PBtynb4xnuUjVfDnbaskm95gmA4hPBngYEAwAItLCEPuIccTTvjYp/VJ71iMmKYcTX6QoEHEe87J8CpV+aZdnICWqYkeXR5Zi7Vfll/+yjSgIvYTH232UndYHQQf3f6Hiy5jw+wMtmaOEw6UFQlcgzCUff4MqEqVOBCW8vhPwOUEzKX6985qzR+yX9kp9YDRZ5aechjEW5k6q/RkHoKvzwB+oUyXbYeq0EvkhsgB31uHLWPYlpt/+KZPJHj4wktTYqN7L8rJ8kTZLfzbG1B7IJklFlHBCuKS5w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(366004)(376002)(451199021)(6666004)(6486002)(66476007)(66556008)(66946007)(36756003)(4326008)(2906002)(44832011)(86362001)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(316002)(478600001)(31696002)(110136005)(54906003)(53546011)(6512007)(6506007)(26005)(31686004)(2616005)(186003)(83380400001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y29mM0tGdFpzVExROFRBUFlKVEQ5SkdoMnlFMEszR0JOd3p1VHBZS2s0M01T?= =?utf-8?B?NnVoNzRCQjNYc1AvSS9Kd0VQaXJCTHRrcUZaQ3NuVXYzU0VkTSsyWnBnTWRL?= =?utf-8?B?bEpoRDQyV2JkMy9aZ3JTazM4akRHSkpkSm1EWktQZktQNzhiS29XWG9GOUZs?= =?utf-8?B?QjZhNGIyYjY0S3Q4VlNWM2JMQWNDWXNrRW9LOFNoMDRFcUFvUVNsMUdHRFR2?= =?utf-8?B?V0FhSElHQmlWQVQzY1B4QVRjK0FtRWQ1aUxtcDZjZVhWcjhRbVgveXBwMzhV?= =?utf-8?B?ZDJPcnRKY2Fnd2dwcjVGQmVyQ2dVcG5NajF0NllwRWFxNjh2ampTWmJkQWlN?= =?utf-8?B?MFNKbVNTN09PaFFvS1RMUW9POUFvbWJUN2IwUTZDY2dZMk9Ga2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network-Message-Id: f0e807e5-f4f9-4308-ad8d-08db3cde38c4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2023 11:48:53.8580 (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: 1mjJLt03Eyw5nc26KhU3ZUQjw8NXtNdWJusqmHLzQlXzNuRu4oljIHBWEB3hdtbC X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 4/14/2023 8:05 AM, David Marchand wrote: > On Thu, Apr 13, 2023 at 7:51 PM Tummala, Sivaprasad > wrote: >> >> [AMD Official Use Only - General] >> >> Hi David, >> >>> -----Original Message----- >>> From: David Marchand >>> Sent: Thursday, April 13, 2023 5:30 PM >>> To: Tummala, Sivaprasad >>> Cc: david.hunt@intel.com; dev@dpdk.org; Thomas Monjalon >>> ; Burakov, Anatoly >>> Subject: Re: [PATCH v2 1/3] eal: add x86 cpuid support for monitorx >>> >>> Caution: This message originated from an External Source. Use proper caution >>> when opening attachments, clicking links, or responding. >>> >>> >>> On Thu, Apr 13, 2023 at 1:54 PM Sivaprasad Tummala >>> wrote: >>>> >>>> Add a new CPUID flag to indicate support for monitorx instruction on >>>> AMD Epyc processors. >>>> >>>> Signed-off-by: Sivaprasad Tummala >>>> --- >>>> lib/eal/include/generic/rte_cpuflags.h | 2 ++ >>>> lib/eal/x86/include/rte_cpuflags.h | 1 + >>>> lib/eal/x86/rte_cpuflags.c | 3 +++ >>>> 3 files changed, 6 insertions(+) >>>> >>>> diff --git a/lib/eal/include/generic/rte_cpuflags.h >>>> b/lib/eal/include/generic/rte_cpuflags.h >>>> index d35551e931..db653a8dd7 100644 >>>> --- a/lib/eal/include/generic/rte_cpuflags.h >>>> +++ b/lib/eal/include/generic/rte_cpuflags.h >>>> @@ -26,6 +26,8 @@ struct rte_cpu_intrinsics { >>>> /**< indicates support for rte_power_pause function */ >>>> uint32_t power_monitor_multi : 1; >>>> /**< indicates support for rte_power_monitor_multi function */ >>>> + uint32_t amd_power_monitorx : 1; >>>> + /**< indicates amd support for rte_power_monitor function */ >>> >>> I did not look at the patch detail, I just stopped at this part. >>> What makes the AMD monitorx stuff special that it needs to be exposed in the >>> generic API? >> >> Monitorx is different ISA /opcode (0F 01 FA) as compared to UMonitor (0F 01 C8). This need to be distinguished >> on specific x86 platforms. Hence in the current power intrinsics, for x86 we require a new flag to >> distinguish MonitorX and UMonitor and invoke the appropriate x86 ISA in the datapath. > > Requiring a new x86 cpuflag to identify this ISA presence is ok. > > > But here, I am talking about the generic power instrinsic API. > Let me phrase my comment differently... > > As described in the API: > uint32_t power_monitor : 1; > /**< indicates support for rte_power_monitor function */ > > Does AMD thing behave completely different from the x86? > Looking at patch 3, I understand this is not the case. > > So we don't need a "amd" flag in the generic flags. > The indirection for calling the right ISA should be hidden in > rte_power_* helpers implemented for x86. > > The 'rte_cpu_get_intrinsics_support()' API and "struct rte_cpu_intrinsics" struct seems intended to get power features in generic way, agree to keep it generic. But also there is a need to run architecture specific instructions, so need to know the architecture within power library, for this what do you think to check 'MONITORX' support again in 'rte_power_intrinsics_init()' function? And most of the 'amd_power_monitorx()' function is duplicate of the 'rte_power_monitor()' API, only difference is the asm calls, what do you think to extract these calls to function pointers for AMD and Intel, so that 'rte_power_monitor()' can become a x86 generic function? As architecture will be known in the 'rte_power_intrinsics_init()', we can set the function pointers properly for architecture in this init stage. Only concern is possible performance impact of pointer dereference instead of direct call, I hope @David Hunt can help us to test the performance impact of it in Intel platforms if this approach is reasonable.