Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp695251lqt; Thu, 6 Jun 2024 16:09:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZARcZcQ910dG/4TVkM4cAIpm6WqbBocAEW36aqudYbAUANFrGuHGjt6hpvWAT3ikdUUWkpuP/0ZJ9EJyDIA+gFzQLOddHgEBArCjhyw== X-Google-Smtp-Source: AGHT+IEBMRZUotP7OVO8SFsJW45TlUMeWnwxDXMwKb0eznXo4/ZU7YVfFCTtCd7s7nHKRb6y65HS X-Received: by 2002:a05:6358:430e:b0:19c:3d29:c47 with SMTP id e5c5f4694b2df-19f1fef9c1amr136330455d.19.1717715380310; Thu, 06 Jun 2024 16:09:40 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2073c5b4si1455611a12.122.2024.06.06.16.09.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 16:09:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205136-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="fp11/p7W"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-205136-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205136-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B9E08289F8F for ; Thu, 6 Jun 2024 23:09:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 408D513DBBE; Thu, 6 Jun 2024 23:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="fp11/p7W" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2051.outbound.protection.outlook.com [40.107.223.51]) (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 3D658535C8; Thu, 6 Jun 2024 23:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.51 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717715373; cv=fail; b=SgqRrw55frL+aaVsga1fN6vt77cl8IpW/FZdcYuLqiQW6offJBsuCn2kYQO5O3CZzoBh1g4+ZBTszWocE+SRo9yfIv5sAtqR/8kk5COGHlt1mEXMTRPV1YXbxktRA3ELJ0hu/AfEt425kXmGJmjcoqcjhTb0EjIl67O08miqylA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717715373; c=relaxed/simple; bh=nm7FuYU+qKRzUbBO1XdWqx+3VW3BiCey1raQc5ijE8o=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=HcLPBH8iwykZomFokXgJyUK2g5hDNVB9usx52jlfOveT50AoOrrie4CKfSSje/RaaFFNaUR+gHXJzcZsnXi1TEFoRJOvURnxScDKXGAxo+4hofrmUtAdvzYtkSg3RMin/bw3Zpicapqn8OsZ8IvUDLv0ScnqlYn0NvDSDYb63ww= 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=fp11/p7W; arc=fail smtp.client-ip=40.107.223.51 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=eZPO7MXOghqh+5f4MmPviPhbCNcfTLlreE4ZF604zgUqrXwW2U9dFuubjYPN7/W7As1KsUNwBhP4kBt+vylK5zK3U/w0nCo42YmtXLyIAwyk8LBn94YhxQ94DadLXSm9KqZyBdDcduJF17vCuwTUDRJNp0tgLDM9uhg/n+jVFQyI2f2FRLxZNEcdSCRX5wSYxgKXltU7pPpJEpAo/zHJ5+6Npi+smmOmI/m2rCl4vDkVv7yOa0ZywksxqSWm/LsbFKR5lE3v/NkHiYN5rtX8lWtpRBpuiYxlm//b8IOfpup8DIjDsiJ+mgSv9BMe1ppoQimeii7+IuZNR2ft9SD0RQ== 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=FnVszpHuOKbtVj4tLYmGAk3tx1qd+mZrYDZ/+ZMfMvE=; b=JregTz2732C40s6AIjeaggkXd6e4g4148WB2laYv8KU2dQ6O76GZwQtmaj6qnRLwZ+SS7WacD0rKjKoZYWHvo2j/OWaQsSdH42zwulCTCabIbKdY3GvMORqAIY0DN+k7rBGdMGuHTg7ImHYlQmKy62khh9oeh/5Ampy6Kpa70BOATv3E/8NpoFiH+L2l8BELk2KnPor1MQCSvivvo46X4c+z2mb4+avhpXbrWa2okYv69EHupbDVxHhu9nQBHtY/z0VsuZIw0s+nawUvCQgd8zTJw8WtTopUkz+5FJa41LYCvwoxM3sBDPgc/x7p83vhno0a43cX8Kn45QGBFw/VWw== 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=FnVszpHuOKbtVj4tLYmGAk3tx1qd+mZrYDZ/+ZMfMvE=; b=fp11/p7WqL2JxhfZyOU4p3wQgw1hPDFGa3gBqHrdrHYAxFZqNjndQ2gfcPBMgUvEuV8iT/o2XiyZMjcWMxu7h8WNcIQ0Uug63018vf8C7BSRsx0K+L1ALFaBPsVsStwDCpor9Vo3tEp4DwRsqyrxj8Nn9lLNJGsfYtwkLavFdT4= 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 SJ2PR12MB7895.namprd12.prod.outlook.com (2603:10b6:a03:4c6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 6 Jun 2024 23:09:27 +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; Thu, 6 Jun 2024 23:09:27 +0000 Message-ID: <3bd755d7-e5c7-3dc3-9875-4884c857e325@amd.com> Date: Thu, 6 Jun 2024 18:09:24 -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 , 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> From: "Moger, Babu" In-Reply-To: <9a7213d2-a782-4342-93f2-acf191c745fd@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DM6PR02CA0058.namprd02.prod.outlook.com (2603:10b6:5:177::35) 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_|SJ2PR12MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: 700478c7-2765-471b-c8b2-08dc867db67f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEJjUFFCcG5DYVlVUmpwbVBoaC9Ga2EyL1ZSZ1B5WFdsb0lhaE5scnlhTHY1?= =?utf-8?B?VWsrNHB5ZEhTaXBKRUtUYUM5ODJKM3FiU3IzRjdRYk56V2tEczB1RCtYa1Y1?= =?utf-8?B?eVNIYXJCV2hoY3FON1dhTGwwTko2bnBpTHBzR2Jaa2lCaTREODZQVnRpNDk3?= =?utf-8?B?enF0M2hFRmNuSWhWV1ZWSlgwR25zZS9KV0JycmVRdHVpeGorcFhYMjBURzdC?= =?utf-8?B?Qmo5b3RxYlJya1I2NXJhNHp1UVU2MDdCMVVKNEUxNHlBUlFYd1hFNVpkQ2Fn?= =?utf-8?B?Z1JoQXJIQzUrUTdLSGpZSVNGVis1QVV1NXZnQktGU0NmamtDQ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Oa0hMNVMwRWhlS1EwYnFQU3dTL2Fp?= =?utf-8?B?aDJlclozbnlGSGU2ZGFiZjZSQU5nLzBKRkJQYVZ2Z3puOFJ1Yzl5NzIzK20r?= =?utf-8?B?bm92WERmU0M4Sk5jRERIeGc4RTE2SHVRUU85T1BudUhvcDR0TGdRNjlNcFlj?= =?utf-8?B?NE40YjRXZXFHL2JiMDlFVHJibXZYdk5XY3UrMFFsVmMwdmMzdlZxMU5hZFI4?= =?utf-8?B?MDhCa1dVOHBvT2hpekI2VHk5MnJ3MXdHMXByNTVEbVFta2hNUWk2SHp4U2Fq?= =?utf-8?B?VjBiZ0IwU2E4K3J3MUxpTGFpNGFTRjI3anZOQmJ3SC9UOUVjcy9hYmUzQ3p1?= =?utf-8?B?RlByL2tTOWdvSHZMM0s4KzQrZzlZMURSdm1qbGJ4UXV5eW1ZMVYxSXNDVkl6?= =?utf-8?B?eG55UE1uKzEvM3ZuMEFJaDE5YlU2NW1KcUUwWVFTK3J4L3ZhY2UrUERhSS8v?= =?utf-8?B?YUZzMlpFTTFBQkhGRFFxRGxTLzlCWlllTTM2OHJWTUo3WHljTWcyaUhYOUox?= =?utf-8?Q?uCEJrr8dqpidHmZWi0BleOKz9ycbLdkQYzWcoMf?= 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)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MmJvN3ByeW9LcnF5SkxtUjBJR29aeUtFSEpvSGxZOVlkM3I2ajFobEkzZjQ3?= =?utf-8?B?SDZmVmN5OUJxbkFta1dXMndSVklvdUZsVnYvZU8zY3Vqa2NlUzBIbHVkYS9B?= =?utf-8?B?L2RXaEZBbVBPcHlwYUhmd3ZkQ0t1R3d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ZFF6djZkUTN6clNzbzJCQWNlVzdXR2x3NzlHa21Ka1dYZnArL1ArWHA5OFFi?= =?utf-8?B?Yjgvby9kM3RNMDRCeE9BVzFLR2xJNlRlc0kyZ0ZsQTBGMExZWXhCVk00NU9U?= =?utf-8?B?YXBEVnJZVEh4a043YmlUYU0zM21OU2kzRXdoZk96Q1dsTDZrWU0reWVjbW1Z?= =?utf-8?Q?imxs=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 700478c7-2765-471b-c8b2-08dc867db67f X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 23:09:27.3141 (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: ySZTfxAAv25F7VpU/IaLRIdk9Xu4hzB90sv2aEhwccixV+JiGZ2W183u6xvk4NXO X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7895 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 { + 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"); return 1; } -- - Babu Moger