Re: [PATCH] selftests: x86: skip the tests if prerequisites aren't fulfilled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/11/2024 10:02 AM, Muhammad Usama Anjum wrote:
On 3/9/24 6:06 AM, Chang S. Bae wrote:
On 3/7/2024 10:37 AM, Muhammad Usama Anjum wrote:

-static void check_cpuid_xtiledata(void)
+static int check_cpuid_xtiledata(void)
   {
       uint32_t eax, ebx, ecx, edx;
   @@ -153,12 +160,16 @@ static void check_cpuid_xtiledata(void)
        * eax: XTILEDATA state component size
        * ebx: XTILEDATA state component offset in user buffer
        */
-    if (!eax || !ebx)
-        fatal_error("xstate cpuid: invalid tile data size/offset: %d/%d",
-                eax, ebx);
+    if (!eax || !ebx) {
+        ksft_print_msg("xstate cpuid: invalid tile data size/offset:
%d/%d\n",
+                   eax, ebx);
+        return -1;
+    }
         xtiledata.size          = eax;
       xtiledata.xbuf_offset = ebx;
+
+    return 0;
   }

I don't think it is okay to silently skip the test here. If the feature is
available, the tile data size and offset should not be zero.
We are logging that data size/offset are invalid if either eax or ebx are
invalid and then we are skipping. Not sure what you are asking me to change.

You intention seems to skip the test when AMX is not available. But this function should only be invoked when AMX is actually available, not as part of the feature availability check. Therefore, I think this change is not relevant. Also, if we encounter invalid TILEDATA CPUID, it should be a reason to *fail* the test, rather than calling out a skip, right?

Thanks,
Chang




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux