Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1220154lqt; Fri, 7 Jun 2024 11:16:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxJgTPLczcJv2t8pP+OBWYm0ps0HK7KThHb8NyOqbMP1dIKsnnt0X64QLTIvjroTXFMenj2pV6YBPqryj/9ZK4iC4L5VA8FEE68VLBWg== X-Google-Smtp-Source: AGHT+IEMZlKP0SvvcXbbmZgDRY8F3A8Cc2CjW0H7ngTdlWinjIxL7mXgLDDpHrUizO+GwGKVssuq X-Received: by 2002:a50:9f2f:0:b0:57c:5f70:36d2 with SMTP id 4fb4d7f45d1cf-57c600f6230mr1111563a12.15.1717784198867; Fri, 07 Jun 2024 11:16:38 -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 4fb4d7f45d1cf-57aae28e101si2001087a12.665.2024.06.07.11.16.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:16:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206591-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=QkENxxOC; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-206591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206591-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 4023F1F22174 for ; Fri, 7 Jun 2024 18:16:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 918F61384B0; Fri, 7 Jun 2024 18:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="QkENxxOC" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2053.outbound.protection.outlook.com [40.107.93.53]) (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 4763720328; Fri, 7 Jun 2024 18:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.53 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717784191; cv=fail; b=DYaaGuCL1AmodJk+QAPdwoEW85yyJAcPh+yWKqN85XZzB5kgQFDyF/N7PLWr3vvvydN9kK+ENCtV6DNOnVNgwayLKoawcYf/sVnhWtAYmqZMzu0i8k+LtGhX4Bd96C9r+f1fMO/6dq5+W9n1B2kwwxPjleiJGN6Z2wnPt1lHnGI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717784191; c=relaxed/simple; bh=T5lhnNvOrFPfmAMsXy80BC2J5vC9JxMVmB9SEbrczmg=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=IPGfPVGND+xT2tDXyFNjx67uLfp871SYzdU20rohMU3MpNKHsxw8C4jLXKNKwmU7jgbyJHpdi5dSPWABYxdezOq+WtMGEyWXpFqcBD6/6DEyUWQMEVYwRa2mt1zkM4Ex/R1leCUrdk6LhX3biYOWG2Mcoz9xnkAs3kQ7QNMp2oE= 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=QkENxxOC; arc=fail smtp.client-ip=40.107.93.53 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=O8WfoI0EKQmX8oWPxMkzkVXq7IaZEUsr5MFugQ9/8oyvp8JeHu6kTLNKkYUUMKbcVsXRgV69oJR/rl9ncz773oivXfpEmarZ43/yyp8+A5MS9W1qZKGE9FQNd2p2gAs3rKm7rygjSirbnasT3CF+tEpEE1FE/n8gU6Ci7UX532Tx0bkwNXi2Yke9qGv06BZvIdEwq2EuwEXvOh3jZNfWkSJ5tC2kItWe8l6di2bBeWZcnRFeQrEEGXrEA1cZCp3ag7G2FE64E29cgxCoHpXFptbTBtnA4u01E/0T4pRYjyV3MZ6vyddOWODbU7nrVnk+edcsO/zCadVz5oawEEqqbA== 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=kOOE6HdnQBLhTZpa3Vk7TnC/Gp3iJOqiPVpEylBg724=; b=PV4kyJPFiEMG2QUrJftVzjBMFp3BMotm6trZDPM1k7G8lzzln15Ubp6jTYqY0NMzK698+O/l4GtTHx/SfFCRfxh+YVTXJRDUJzDFYqMjepsxeJEulytrKWdgg/beS813Bbci0Ik2ksrXZzadsWVbRrHMlORi1BNxpBzj5NoFBvBLxSAkqCBH7FPvftGTuO8eBiOBZaGyxAdGs2Kimbem44qu4kS9QIuu7OV+agYQSA3llHSfeaD55BKzrTFt4s6YpoWfJ9VpmMnWGCqWloZBYEcosluwdd36EbhKrWu7WfPrlahwTW5vBl06CNSE5CdngtmN2Czoy9B7ShItGaKXhQ== 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=kOOE6HdnQBLhTZpa3Vk7TnC/Gp3iJOqiPVpEylBg724=; b=QkENxxOCN+ALSQNhAJcQxsxPTM3OsAMuDvPlR/HlxNrPIXfIy/X1KrjE6X2PYquRaSThQ9eRhHIuEexpr6DFuBq2mwMC6YNBp6yU3luFyN4kxzz+EoxkR8qco2lL9SVqSFRGUjrtJ+VCnkGh62/FPPeNC+qqSqMxbTQPoCxf0LE= 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 IA1PR12MB6530.namprd12.prod.outlook.com (2603:10b6:208:3a5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.34; Fri, 7 Jun 2024 18:16:25 +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.7633.033; Fri, 7 Jun 2024 18:16:25 +0000 Message-ID: Date: Fri, 7 Jun 2024 13:16:22 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Reply-To: babu.moger@amd.com Subject: Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD Content-Language: en-US To: Reinette Chatre , babu.moger@amd.com, fenghua.yu@intel.com, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, ilpo.jarvinen@linux.intel.com, maciej.wieczor-retman@intel.com, peternewman@google.com, eranian@google.com References: <3a6c9dd9dc6bda6e2582db049bfe853cd836139f.1717622080.git.babu.moger@amd.com> <9a7213d2-a782-4342-93f2-acf191c745fd@intel.com> <3bd755d7-e5c7-3dc3-9875-4884c857e325@amd.com> <8553ddc2-ee0f-447d-8fe4-5a7dd84375f2@intel.com> From: "Moger, Babu" In-Reply-To: <8553ddc2-ee0f-447d-8fe4-5a7dd84375f2@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA1P222CA0122.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c5::17) 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_|IA1PR12MB6530:EE_ X-MS-Office365-Filtering-Correlation-Id: 4098a2e6-ced5-4bc9-c9e7-08dc871df11f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VldvTGQ3cmdrMEdvZlV4b21QYnFHbEtkNkNtM3pLK2xuMlA1ZGc1RDVubk1t?= =?utf-8?B?RytVMXJtQlh5M3dpTzU4K0VzSGNBOC9odWdVUUZnbFpIaVViaDVuZDRSOFlI?= =?utf-8?B?ck52OEVDOWJMckt0QmMzZnROUzhESHpWODAvR2hSMjFDZk5zZjJiYW5yNVB6?= =?utf-8?B?elBVRG9PMjNWeDBVWVhSTUpzcE83cWU2YjJscjR6OVY5cCs5a3dqaXhVNWF0?= =?utf-8?B?bllZM09CVGx5OElIVlRUMWFCcnJ3cnBNWEFXcHd1ckxZKzF3Y0FuZ1RqUm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1dxM2FzME4rRGM1?= =?utf-8?B?NGJCbEJNVDNjQU9NNDNHd3hGaGdnMTVjWFU2UXQ5MnhwMnBwVXVBL2Q3eER6?= =?utf-8?B?aE9MYUFaaHZHSkNpcmNMUG04WUdDRExUV1EwWnoyZ0JSMkY3M1ZlTUlCeVZR?= =?utf-8?B?RTUrMkxwQnBweXROaFVyRUtRQU1ZRHpvYTkyTER3QUFJOVRDRFhvbDV6VGpI?= =?utf-8?B?WEdBYmxKc2pveFV2V2ZDdFhVSnRoS29BSnlPc3hZa2tNeXhjdHRqY2xCWVM3?= =?utf-8?B?U3VZUUwxZDZPOFUxdFdjSk41YndOWU5OTTBsZzk0bWxLQ01SbVdOZlgxdytr?= =?utf-8?B?d2tYT20zN0FaZ3FHUXJhcno2dlV5cmZNQklvTG5FRW9jUlgzYWpjSlN3NG5T?= =?utf-8?B?a0JYbnk1aFVKUUxSa1NZSlJtOStBWmNzQUxMNVkrTUx6K3BDQjNHbk1ubVZL?= =?utf-8?B?VFB2V3JrS2kzdDg4aXdCK25xTUdwQjdnNHNRUEk0RTZRSnVlSHkxSnc5OSsr?= =?utf-8?B?TWZwQ2F4TDdLL0xUaGlYRkZiVjhJSWYzMDJ4SkJlaDZDUmJmOWF3ckNid0do?= =?utf-8?Q?+oKBDhgPynd8I9oPzB8gi7tEj1ngf+xiDV2l0d/?= 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)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d3lqdElwM0pYSlJMTFJPRit5WlhqNzNHVlltUUs5ckJ6NDZJcHpvTklmWUQ1?= =?utf-8?B?cStzN1Z1UTdiRDBiZmdVN3l3emt3WnJuSnpXOStUS2Jya1lxTitr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QakI5bUFjb09JbytVeHlsbGhUS2FSbHNlRnYrOHE1anpt?= =?utf-8?B?L0pUN3pzbFhPZkp2WHU3UEsxc2VKaGFuMUhPN1BrdW4ydUl4bDZpSENnWElV?= =?utf-8?B?TW1tMXU3WkV1S3RXVlRoRDJldENSOUxqakVlUDNjT0VWUHBTaC9paStIc2FO?= =?utf-8?B?VDdPWXVqQ0lRS0dJWUFOQkRGOEtpREU5aHlqZjVOVGI1c2RnejZqVGhwSzlI?= =?utf-8?Q?Ljqw=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4098a2e6-ced5-4bc9-c9e7-08dc871df11f X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:16:25.0189 (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: xF9WYZdSCXvHDalecCfJskXa3MpyG841W3YiRg/nCgOKl/XZzkYQpcXd4F7RJvjN X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6530 Hi Reinette, On 6/6/2024 6:58 PM, Reinette Chatre wrote: > Hi Babu, > > On 6/6/24 4:09 PM, Moger, Babu wrote: >> Hi Reinette, >> >> >> On 6/6/2024 3:33 PM, Reinette Chatre wrote: >>> Hi Babu, >>> >>> On 6/5/24 2:36 PM, Babu Moger wrote: >>>> The selftest noncont_cat_run_test fails on AMD with the warnings. >>>> Reason >>>> is, AMD supports non contiguous CBM masks but does not report it via >>>> CPUID. >>>> >>>> Update noncont_cat_run_test to check for the vendor when verifying >>>> CPUID. >>>> >>>> Fixes: ae638551ab64 ("selftests/resctrl: Add non-contiguous CBMs CAT >>>> test") >>>> Signed-off-by: Babu Moger >>>> --- >>>> This was part of the series >>>> https://lore.kernel.org/lkml/cover.1708637563.git.babu.moger@amd.com/ >>>> Sending this as a separate fix per review comments. >>>> --- >>>>   tools/testing/selftests/resctrl/cat_test.c | 2 +- >>>>   1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/tools/testing/selftests/resctrl/cat_test.c >>>> b/tools/testing/selftests/resctrl/cat_test.c >>>> index d4dffc934bc3..b2988888786e 100644 >>>> --- a/tools/testing/selftests/resctrl/cat_test.c >>>> +++ b/tools/testing/selftests/resctrl/cat_test.c >>>> @@ -308,7 +308,7 @@ static int noncont_cat_run_test(const struct >>>> resctrl_test *test, >>>>       else >>>>           return -EINVAL; >>>> -    if (sparse_masks != ((ecx >> 3) & 1)) { >>>> +    if ((get_vendor() == ARCH_INTEL) && sparse_masks != ((ecx >> 3) >>>> & 1)) { >>>>           ksft_print_msg("CPUID output doesn't match 'sparse_masks' >>>> file content!\n"); >>>>           return 1; >>>>       } >>> >>> Since AMD does not report this support via CPUID it does not seem >>> appropriate to use CPUID at all on AMD when doing the hardware check. >>> I think the above check makes it difficult to understand what is >>> different >>> on AMD. >>> >>> What if instead there is a new function, for example, >>> "static bool arch_supports_noncont_cat(const struct resctrl_test *test)" >>> that returns true if the hardware supports non-contiguous CBM? >> >> Sure. >> >>> >>> The vendor check can be in there to make it obvious what is going on: >>> >>>      /* AMD always supports non-contiguous CBM. */ >>>      if (get_vendor() == AMD) >>>          return true; >>> >>>      /* CPUID check for Intel here. */ >>> >>> The "sparse_masks" from kernel can then be checked against >>> hardware support with an appropriate (no mention of CPUID) >>> error message if this fails. >>> >> >> Something like this? >> >> >> diff --git a/tools/testing/selftests/resctrl/cat_test.c >> b/tools/testing/selftests/resctrl/cat_test.c >> index d4dffc934bc3..b75d220f29f6 100644 >> --- a/tools/testing/selftests/resctrl/cat_test.c >> +++ b/tools/testing/selftests/resctrl/cat_test.c >> @@ -288,11 +288,30 @@ static int cat_run_test(const struct >> resctrl_test *test, const struct user_param >>          return ret; >>   } >> >> +static bool arch_supports_noncont_cat(const struct resctrl_test *test) >> +{ >> +       unsigned int eax, ebx, ecx, edx; >> + >> +       /* AMD always supports non-contiguous CBM. */ >> +       if (get_vendor() == ARCH_AMD) { >> +               return true; >> +       } else { > > The else can be dropped since it follows a return. Sure > The rest of the code can be prefixed with a matching > comment like: >     /* Intel support for non-contiguous CBM needs to be discovered. */ Sure > > (please feel free to improve) > >> +               if (!strcmp(test->resource, "L3")) >> +                       __cpuid_count(0x10, 1, eax, ebx, ecx, edx); >> +               else if (!strcmp(test->resource, "L2")) >> +                       __cpuid_count(0x10, 2, eax, ebx, ecx, edx); >> +               else >> +                       return false; >> + >> +               return ((ecx >> 3) & 1); >> +       } >> +} >> + >>   static int noncont_cat_run_test(const struct resctrl_test *test, >>                                  const struct user_params *uparams) >>   { >>          unsigned long full_cache_mask, cont_mask, noncont_mask; >> -       unsigned int eax, ebx, ecx, edx, sparse_masks; >> +       unsigned int sparse_masks; >>          int bit_center, ret; >>          char schemata[64]; >> >> @@ -301,15 +320,8 @@ static int noncont_cat_run_test(const struct >> resctrl_test *test, >>          if (ret) >>                  return ret; >> >> -       if (!strcmp(test->resource, "L3")) >> -               __cpuid_count(0x10, 1, eax, ebx, ecx, edx); >> -       else if (!strcmp(test->resource, "L2")) >> -               __cpuid_count(0x10, 2, eax, ebx, ecx, edx); >> -       else >> -               return -EINVAL; >> - >> -       if (sparse_masks != ((ecx >> 3) & 1)) { >> -               ksft_print_msg("CPUID output doesn't match >> 'sparse_masks' file content!\n"); >> +       if (!(arch_supports_noncont_cat(test) && sparse_masks)) { >> +               ksft_print_msg("Hardware does not support >> non-contiguous CBM!\n"); > > Please fix the test as well as the message. It is not an error if > hardware does > not support non-contiguous CBM. It is an error if the hardware and > kernel disagrees whether > non-contiguous CBM is supported. Not sure about this comment. Did you mean? if (!arch_supports_noncont_cat(test)) { ksft_print_msg("Hardware does not support non-contiguous CBM!\n"); return 0; } else if (arch_supports_noncont_cat(test) && !sparse_masks)) { ksft_print_msg("Hardware and kernel support for non-contiguous CBM does not match!\n"); return 1; } -- - Babu Moger