Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp89139lqh; Mon, 6 May 2024 12:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvE3wS7I685R9EmSJhHC8zXGTiBvTJ4pQJzO6u41oyxdc69BpD55elX1TszsEbHm3GNDr/eW3fCZ0Q/KgVI125v9tA7dj0Ce5KKhE7lQ== X-Google-Smtp-Source: AGHT+IE62gy/c64IaymqUbryrQaWRICcojd5SbMeB5curvL6pc7Zxx9pm06VnJkkKdGlA5t1WdM7 X-Received: by 2002:a2e:914d:0:b0:2de:75de:5b0b with SMTP id q13-20020a2e914d000000b002de75de5b0bmr10166326ljg.18.1715022598931; Mon, 06 May 2024 12:09:58 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sa33-20020a1709076d2100b00a59cf80bdffsi1224657ejc.978.2024.05.06.12.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=myOF2MKf; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-170324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B4AB1F22320 for ; Mon, 6 May 2024 19:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA7EC158DDB; Mon, 6 May 2024 19:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="myOF2MKf" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D36A4AECA; Mon, 6 May 2024 19:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.50 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715022589; cv=fail; b=kvVXPtX8m5wI5X3UR9ZEP2ofYN9dcBadTc9yvnNu2ZzuLegGzbli9+QPthjw7QjUHnql6+qA5NxKuAb4m0zSqby4wHdu2ixi1HA6DCLdxU2mEfEXYNM3CrRPTatm9CLvza8CX+rqm/ZhY56mLhvmKVNSjukjcB55gTlwbPZNGJQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715022589; c=relaxed/simple; bh=XD5ocvELCx/RlxYRhRLZx3pzTjdHHzUXupDAKUjISg8=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=AlHOYDpYpLpsf8u68Me+73135BYTd00bzwdBx8fvL3yWOMH3r1hV6aBc70viW/FU7rvUfZuhbSxwX6dBnDDvIMq1FaZOR3bvzo1a951o1KLZfyOMN1hzjrf13DxqGUYB8U9T4YtKrbujofExQR/uitGf0//mvXgJ9ZglIWY0oLk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=myOF2MKf; arc=fail smtp.client-ip=40.107.243.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KnjFNeV0vjl82xNXUL1bFNqMVHqfn0ZJfrMaXKoiPm9LxdjJf+ibO1iFtJFkAHtb8A/HbcCoP38zyysWM4txWVg0Hs6nmqrVdK+BO7xEyAqmwEM863KmbCf7itZKHRSN9JflNP2NRz9GKEYrf2pmEcdWLs1Iub3ctes2yBuT/bRhM1f9k9YfGgpO/G9AoAoZbABOkZRwgpDwsa5Phk+E0DuFabqw/Q3hGw/5fyBPp6B1j2ZkKCum9J7Z1LLzG3NQhrtwHs5w6UhTAqEUFlz4oFV/HwPVhFzAWBYJgRlfQ9pWc/+nVuaP6eXNpTN8xWC5+SGFgOIVThpkVzQGvRCz0w== 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=EFVcikOYIpb75opAWJW+qSQGk/YXp2AVAPBYETmYC5Y=; b=TZeM0xl7nL32zQUAANGX4F7Qua+WNjYOkYMRz7RCcLQDa/NBNdztvv5UdGRTntKKXzSFQ0cQzsxOuSs3LfJ27V5YE4+qKFhiy6ozPmJfv8VUpv9kMy6dgxTxwYlG7LqD2KiKYRRQ2InmQ2NyXfezwP7kWLqx2/cXa432DguqZJoST4ZBrffSk+j00vNH2HR7Pb5h0lgJErD6PgPy6vZgpMURuQyhOgscuFniwIQO+uWtbBOWPxW8QrrziYHR9r8kGiRJG7Uz+CDkFzJmLjXuLSHfOgzestcDastXLIrC88fbfCJ6nhOucM8HKj06gjWZTDIcqIISzoSuGzIr50W6fQ== 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=EFVcikOYIpb75opAWJW+qSQGk/YXp2AVAPBYETmYC5Y=; b=myOF2MKfJxWTHwTM74QK2CcGTN3u9ZftfLUuQkGBxMVbT4nPEV01UVQ/ebmNSUHcdBK6ZYDaoDk6VSvZd6fp+OUDtSdcOhvX+7fVafh09jJymmI8+y2m9PWk+FY+qcALmgE2mbExnAmMjRUVz9N9R8KM5AdgAZ+QJgbcMGWxWT4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by PH7PR12MB8428.namprd12.prod.outlook.com (2603:10b6:510:243::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Mon, 6 May 2024 19:09:42 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87%4]) with mapi id 15.20.7544.041; Mon, 6 May 2024 19:09:42 +0000 Message-ID: <80b33bc6-7b70-4853-92a0-718c2d8728d3@amd.com> Date: Mon, 6 May 2024 14:09:38 -0500 User-Agent: Mozilla Thunderbird Reply-To: babu.moger@amd.com Subject: Re: [RFC PATCH v3 03/17] x86/resctrl: Detect Assignable Bandwidth Monitoring feature details To: Reinette Chatre , corbet@lwn.net, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, paulmck@kernel.org, rdunlap@infradead.org, tj@kernel.org, peterz@infradead.org, yanjiewtw@gmail.com, kim.phillips@amd.com, lukas.bulwahn@gmail.com, seanjc@google.com, jmattson@google.com, leitao@debian.org, jpoimboe@kernel.org, rick.p.edgecombe@intel.com, kirill.shutemov@linux.intel.com, jithu.joseph@intel.com, kai.huang@intel.com, kan.liang@linux.intel.com, daniel.sneddon@linux.intel.com, pbonzini@redhat.com, sandipan.das@amd.com, ilpo.jarvinen@linux.intel.com, peternewman@google.com, maciej.wieczor-retman@intel.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, james.morse@arm.com References: <63134ddf18208bbd11bcec0ec75c33ef6e5635b2.1711674410.git.babu.moger@amd.com> Content-Language: en-US From: "Moger, Babu" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR11CA0021.namprd11.prod.outlook.com (2603:10b6:806:6e::26) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|PH7PR12MB8428:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a3595e5-aec9-4d17-5d47-08dc6e00159d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MnIvQ2xOUHRzU1FhUHJhVEhIdDl3Nytzb3NlRm91WjFLUWE1T3gxQUFDTXMw?= =?utf-8?B?Rm1lckx0V2dJeGF3amF5T3BWdS90OGl0MkxiWjBKWjB5QVUxZ1pUS2h0UlJq?= =?utf-8?B?Y0V3Rm9DVWtSRm90ZGJCMGllY1E2ZFBwbVpkVS82aGFldX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CVExYSiswTU1WcjVwSDcvR0JlaG1H?= =?utf-8?B?VEZWalVSeTRTUWRMaWJPMEswOXFzRjFlQWxoR3dZWFNBaXpCb2NZb3A3aU9P?= =?utf-8?B?TndKUlVIMXdDNWxodXo4MDZnM0JoTDJNVEZhb1k3VWcwWU95V2JjL1ZVVFla?= =?utf-8?B?dEJDVmhRVXpoS2FjS1EzL1ZXV2F0S3ZjV1lxY0Jodnh0QU9mdENXSFk5S1Zm?= =?utf-8?B?RDdlTkpwa01XN3A3RXk4ZTBIcERTcS9EdjJ5QSsrT3FmaHlOWFRTK2dtdUJu?= =?utf-8?B?cm1xRlc5Y0lkVkd6QTRQOWpzR3hHeEcwSkx2cm1ZODVaN0pTQ3hiSU5rUFBE?= =?utf-8?B?SkRxVlZlVUcxMXV6N3RWMXhoWDVWeVdsQU5wOGtkUG5DTllnbStmaEljM2Rv?= =?utf-8?B?bC90aU45aVljS2EyNVhjWi8xQ2QzNEVXcGpjK3RVRStwdGZ0NVI0RThkM1Iz?= =?utf-8?B?M3FTYXl1bTJ6WEFrYzllME9uZVBJT1BuY0ovWWNFN0N1TXE4UFVlSGNyREc4?= =?utf-8?B?ZFZBNXpWZlQwNXM5ZmNmRGdvRElVcFM0NVorQmlxNXhabVZHbU5zRU4vZ011?= =?utf-8?Q?WD2gl2jKN5W0S6rLei/sSK0sXc9C1ipQ0Xk3cWlx8eEQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SkpqQm5xQi9pclJwVkdYeWtmQkhheUhLa3dSZXFNNURnbGs1eUQzVWFOcnRq?= =?utf-8?B?Qnh1UlZsN3FhMkdnS1FV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YWlk3S08rbEx1ZTM3QUExR0RzMGtS?= =?utf-8?B?c3JYSTRkUXZSRy84Yk9oTWd2WkU1RVVGL2p0NWVQOC9KUWZnWStlaUN6THBL?= =?utf-8?B?SlN6RVptUHYrbm9LNmNUS3FkamZrQkpEOTcySjJkNjVzZW55aEtyRWo2ZTJH?= =?utf-8?B?REg0RlhLU3RBRE1vaWVDdTdISFBZUnA1WXNPTSs5RktiRzNZc0o2blNMQ0xl?= =?utf-8?B?aFA2dWJWdWN6cmpSZGFIdmFVVjVGbXAwWDVCU1FFS1BlT05rR3V0VCsrK3Az?= =?utf-8?Q?Akjw=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a3595e5-aec9-4d17-5d47-08dc6e00159d X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 19:09:42.2674 (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: dnkd9+EbqWE1hDHyATm5ovPwcDz1p5jFM6Y/h5bAOM9dacD5IUQwFDqEru9/9eiT X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8428 Hi Reinette, On 5/3/24 18:26, Reinette Chatre wrote: > Hi Babu, > > On 3/28/2024 6:06 PM, Babu Moger wrote: >> ABMC feature details are reported via CPUID Fn8000_0020_EBX_x5. >> Bits Description >> 15:0 MAX_ABMC Maximum Supported Assignable Bandwidth >> Monitoring Counter ID + 1 >> >> The feature details are documented in APM listed below [1]. >> [1] AMD64 Architecture Programmer's Manual Volume 2: System Programming >> Publication # 24593 Revision 3.41 section 19.3.3.3 Assignable Bandwidth >> Monitoring (ABMC). >> >> Signed-off-by: Babu Moger >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 >> --- >> v3: Removed changes related to mon_features. >> Moved rdt_cpu_has to core.c and added new function resctrl_arch_has_abmc. >> Also moved the fields mbm_assign_capable and mbm_assign_cntrs to >> rdt_resource. (James) >> >> v2: Changed the field name to mbm_assign_capable from abmc_capable. >> --- >> arch/x86/kernel/cpu/resctrl/core.c | 17 +++++++++++++++++ >> arch/x86/kernel/cpu/resctrl/internal.h | 1 + >> arch/x86/kernel/cpu/resctrl/monitor.c | 3 +++ >> include/linux/resctrl.h | 12 ++++++++++++ >> 4 files changed, 33 insertions(+) >> >> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c >> index 57a8c6f30dd6..bb82b392cf5d 100644 >> --- a/arch/x86/kernel/cpu/resctrl/core.c >> +++ b/arch/x86/kernel/cpu/resctrl/core.c >> @@ -740,6 +740,23 @@ bool __init rdt_cpu_has(int flag) >> return ret; >> } >> >> +inline bool __init resctrl_arch_has_abmc(struct rdt_resource *r) >> +{ >> + bool ret = rdt_cpu_has(X86_FEATURE_ABMC); >> + u32 eax, ebx, ecx, edx; >> + >> + if (ret) { >> + /* >> + * Query CPUID_Fn80000020_EBX_x05 for number of >> + * ABMC counters >> + */ >> + cpuid_count(0x80000020, 5, &eax, &ebx, &ecx, &edx); >> + r->mbm_assign_cntrs = (ebx & 0xFFFF) + 1; >> + } >> + >> + return ret; >> +} > > It is not clear to me why this function is needed. I went back to > read James' comment and it sounds to me as though he expected it > to be called from non-arch code ... but this is only called > from rdt_get_mon_l3_config() which is very much architecture specific > and will remain in arch/x86 where rdt_cpu_has() will be accessible. Yes. That is correct. I will revert it and move it to rdt_get_mon_l3_config. > >> + >> static __init bool get_mem_config(void) >> { >> struct rdt_hw_resource *hw_res = &rdt_resources_all[RDT_RESOURCE_MBA]; >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h >> index c99f26ebe7a6..c4ae6f3993aa 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -584,6 +584,7 @@ void free_rmid(u32 closid, u32 rmid); >> int rdt_get_mon_l3_config(struct rdt_resource *r); >> void __exit rdt_put_mon_l3_config(void); >> bool __init rdt_cpu_has(int flag); >> +bool __init resctrl_arch_has_abmc(struct rdt_resource *r); >> void mon_event_count(void *info); >> int rdtgroup_mondata_show(struct seq_file *m, void *arg); >> void mon_event_read(struct rmid_read *rr, struct rdt_resource *r, >> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c >> index c34a35ec0f03..e5938bf53d5a 100644 >> --- a/arch/x86/kernel/cpu/resctrl/monitor.c >> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c >> @@ -1055,6 +1055,9 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r) >> mbm_local_event.configurable = true; >> mbm_config_rftype_init("mbm_local_bytes_config"); >> } >> + >> + if (resctrl_arch_has_abmc(r)) >> + r->mbm_assign_capable = ABMC_ASSIGN; >> } > > This is confusing to me in two ways: > (a) why need different layers of abstraction to initialize r->mbm_assign_capable > and r->mbm_assign_cntrs? Can they not just be assigned at the same time? Yes. we can. > (b) r->mbm_assign_capable is a bool ... but it is assigned an enum? Why is > this enum needed for this? Enum is really not required. Will correct it. > >> >> l3_mon_evt_init(r); >> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h >> index a365f67131ec..a1ee9afabff3 100644 >> --- a/include/linux/resctrl.h >> +++ b/include/linux/resctrl.h >> @@ -150,6 +150,14 @@ struct resctrl_membw { >> struct rdt_parse_data; >> struct resctrl_schema; >> >> +/** >> + * enum mbm_assign_type - The type of assignable monitoring. >> + * @ABMC_ASSIGN: Assignable Bandwidth Monitoring Counters. >> + */ >> +enum mbm_assign_type { >> + ABMC_ASSIGN = 0x01, >> +}; >> + > > Either the resource is mbm_assign_capable or not ... it is not clear > to me why an enum is needed. This is not required. > >> /** >> * struct rdt_resource - attributes of a resctrl resource >> * @rid: The index of the resource >> @@ -168,6 +176,8 @@ struct resctrl_schema; >> * @evt_list: List of monitoring events >> * @fflags: flags to choose base and info files >> * @cdp_capable: Is the CDP feature available on this resource >> + * @mbm_assign_capable: Does system capable of supporting monitor assignment? > > "Does system capable" -> "Is system capable"? Sure. > >> + * @mbm_assign_cntrs: Maximum number of assignable counters >> */ >> struct rdt_resource { >> int rid; >> @@ -188,6 +198,8 @@ struct rdt_resource { >> struct list_head evt_list; >> unsigned long fflags; >> bool cdp_capable; >> + bool mbm_assign_capable; >> + u32 mbm_assign_cntrs; >> }; > > Please check tabs vs spaces (in this whole series please). Sure. Will do. > > I'm thinking that a new "MBM specific" struct within > struct rdt_resource will be helpful to clearly separate the MBM related > data. This will be similar to struct resctrl_cache for > cache allocation and struct resctrl_membw for memory bandwidth > allocation. Did you mean to move all the fields for monitoring to move to new struct? Struct resctrl_mbm { int num_rmid; bool mbm_assign_capable; u32 mbm_assign_cntrs; }: -- Thanks Babu Moger