lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2491e8da-8664-428f-87bd-40595af7af47@intel.com>
Date: Fri, 7 Jun 2024 14:47:48 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: <babu.moger@....com>, <fenghua.yu@...el.com>, <shuah@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>,
	<ilpo.jarvinen@...ux.intel.com>, <maciej.wieczor-retman@...el.com>,
	<peternewman@...gle.com>, <eranian@...gle.com>
Subject: Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD

Hi Babu,

On 6/7/24 11:16 AM, Moger, Babu wrote:
> On 6/6/2024 6:58 PM, Reinette Chatre wrote:
>> On 6/6/24 4:09 PM, Moger, Babu wrote:

>>> @@ -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;

The above changes whether support for non-contiguous CBM is treated as an error but the
test should still proceed since the test goes on to write different CBM to the system
and verifies results are as expected based on what hardware supports.

>           } 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;

I can see how this will work for AMD for the scenario being checked but not for
the different Intel variants.

I think this can all be simplified with something like:
	if (arch_supports_noncont_cat(test) != sparse_masks)) {
		ksft_print_msg("Hardware and kernel differ on non-contiguous CBM support!\n");
		return 1;
	}

I modified the message slightly since non-contiguous CBM does not actually require kernel
support.

What do you think?

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ