Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp81415lqm; Mon, 10 Jun 2024 13:23:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDwzQZRd1m2K4TlvgiKHaAj8iiaTRZ7MAvFB6Th0jDkTvXugpWB7Ou1C5Sgaxy/2bznyZn5LQ+kAtCMix5CNhmRDCD4C9cBKg1S6XMZA== X-Google-Smtp-Source: AGHT+IHmzeNFmtIMPHTYF9Ql1P1X7ixTEa7AdeDbOxiGFSJmPRmsxy0qJP57HyBOZVa5Qy/xLA6R X-Received: by 2002:a05:6a20:a124:b0:1b5:d10a:1b70 with SMTP id adf61e73a8af0-1b5d10a1f56mr8178416637.11.1718051015551; Mon, 10 Jun 2024 13:23:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718051015; cv=pass; d=google.com; s=arc-20160816; b=xsT9e24I0WCS30wFw/F3cYR9moY3RnuKD7fsUNuEBNMk4hTusmK6ZBwyDkczs9Ir94 fef7CnR5e9k24Ugnu3og/VWZP0MtBRgNFvnCpuML+HaXr4kyvuPdY3ORCLcp3gUjlkWq kpFk/Lk3OmR3xIczJRR6N18kVmBcOTBTkC4ZtgAWNoD1QGz0cnlynfprtR9DvrMtPZNk qsMzTZCv5wup4wexqFJwXyUzpnNhuHW84urHBh7MO+7RhbYFwpTJxaVdAJP1zr9hTy9A 1Z1ZiALMIh5QuEmMrjApBvDjcK73xsXAAyDoko2MwCtb/m3MvA95FtvVzX/13EdRmsMq 2nJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:message-id:in-reply-to:subject:cc:to:date :from:dkim-signature; bh=pTbtAk8T2NEumhaKuyyJGPv4vp8CvWZm/Z+TkYV+lq8=; fh=GvUo/5QrV/I6dW9IVkjPZ5a0eFtt/yOteJMA/K4kyfw=; b=Vt0Xv8GzenqzzeKMT2orU2QWZvVvTKmIpfesjzpYUYbZpW+ssqr+RKixYnncXtAuyZ DPCiGTPEPWIB9LjapVpPTNdJe4HfWZTk1DrMKFK+L2zM0P2PuEJQvbN1y6g8nEqXXyqL h4PqdIXl4nfxqvMMLJFEkglCv7VE1TNrjBE8IgyDeAnOO5CPKs/KUQAOWhFPEFaFiqGZ kA7e+k78Zu274r3Fk7e8s5shUSq0Fwc06Jd2HyGh3bJoSTDUK9sb8D8RWyncSGPjcTPJ akRcuYS0K+5wa073u4/ew4fhVKYsfhEV5lUC5BV1fQFLFtTR3ezVPY9+GwQ+BUUXInh5 L5Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XnlQn7cc; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208544-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de275faa79si6619118a12.439.2024.06.10.13.23.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 13:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208544-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=@intel.com header.s=Intel header.b=XnlQn7cc; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208544-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 689FE28B107 for ; Mon, 10 Jun 2024 16:21:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00C13142E9F; Mon, 10 Jun 2024 16:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XnlQn7cc" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 984CB43146; Mon, 10 Jun 2024 16:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718036465; cv=none; b=OQkE0rca4bWq49ISH8GcxHQiFq7N5QLni1zR2MCy78LhFgM/SKo5iVcxtgju7Wpzv7RZdYQtL9vXKAy5FZ5fmgk7l64Enj/c7h9cPjdU6usDiXsdML2oumzYMyzfqmAiY4DTzIb+nXWXZ43zBxyOdmQfGhx7+Tc8j3AzXG78w2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718036465; c=relaxed/simple; bh=25JnKzM0oSveF/yU7V7v0D6gw5AxNyK/vndNnfQoSrU=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Zh4PxSCGdmUy9qNAZysqnOcCYLh75KXFfAtTqLekkfmt3T3q2LAeYXouN8qpzVYKroaqOvXJVaQ8rLhyLbNbL6n2zzndewoR/Cpl4A29FlkzeOBDm7wXxT21q7zjLKsouIrwu7d11W/tLY8k3qpqFLYxxSR+9x0ISDhYj7AbHmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XnlQn7cc; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718036463; x=1749572463; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=25JnKzM0oSveF/yU7V7v0D6gw5AxNyK/vndNnfQoSrU=; b=XnlQn7ccB54t/oSEA5JGo/6LiKG3dyaTLoz1SWkF0ga1XQwbV77MC8od CY+EX0RN/Lvmny5jm2AUXqoR81dJJ0hhAv+VM8x3geq+mufKNygtwm+Ii Kuz+Co0z8Xd7B4x6aAoor5M9CSkpIoJQrf0Jfc3JW8f6Jl43Fuk18RRY9 SNp14vmBsbVy3j6ZAC5+L5YB+z2jvRrtnHXGASgh3G/1sPPsX5BBgvNKf SgeIdLkma7QNoip/FcnnBPBcNBG/wUHSDawq6OUPV2I7qBJyIfz/4BcWf pGVkIRwkId8E2vWj+w/nHhdwBytk94ByYsAGSK10ssGoytVFLqBfoEM4p Q==; X-CSE-ConnectionGUID: AnObiPa7SBm2+07YT3aV0A== X-CSE-MsgGUID: 3yg7AYAyQXy+U37OR09pYA== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="12001676" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="12001676" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 09:21:03 -0700 X-CSE-ConnectionGUID: VQzS7yZASHyNN6S6cncpoQ== X-CSE-MsgGUID: F8rUVy+KQdCCIr86/WK5nQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="39672367" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.194]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 09:20:59 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Mon, 10 Jun 2024 19:20:55 +0300 (EEST) To: Babu Moger cc: fenghua.yu@intel.com, Reinette Chatre , shuah@kernel.org, LKML , linux-kselftest@vger.kernel.org, =?ISO-8859-15?Q?Maciej_Wiecz=F3r-Retman?= , peternewman@google.com, eranian@google.com Subject: Re: [PATCH v2] selftests/resctrl: Fix noncont_cat_run_test for AMD In-Reply-To: <7679d70a0ea939db13ae9dac20de56644460d6df.1718035091.git.babu.moger@amd.com> Message-ID: <91052cec-071b-7cc7-5f85-4fa29ec2aea4@linux.intel.com> References: <3a6c9dd9dc6bda6e2582db049bfe853cd836139f.1717622080.git.babu.moger@amd.com> <7679d70a0ea939db13ae9dac20de56644460d6df.1718035091.git.babu.moger@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-ID: <048478a2-4626-4610-9ef9-7e66f358abf2@linux.intel.com> On Mon, 10 Jun 2024, Babu Moger wrote: > The selftest noncont_cat_run_test fails on AMD with the warnings. Reason noncont_cat_run_test() (In general, use () when refering to a function, same thing in the shortlog). "the warnings" sounds like I should know about what warning it fails with but there's no previous context which tells that information. I suggest you either use "a warning" or quote the warning it fails with into the commit message. > is, AMD supports non contiguous CBM masks but does not report it via CPUID. non-contiguous > 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 > --- > v2: Moved the non contiguous verification to a new function > arch_supports_noncont_cat. > > v1: > 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 | 32 +++++++++++++++------- > 1 file changed, 22 insertions(+), 10 deletions(-) > > diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c > index d4dffc934bc3..742782438ca3 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; > + > + /* Intel support for non-contiguous CBM needs to be discovered. */ > + 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 and kernel differ on non-contiguous CBM support!\n"); > return 1; This looks better than the previous version, thanks. -- i.