Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp940337lql; Tue, 12 Mar 2024 02:39:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqGig6GLxd1CgriaJnHZO73abN4TaNIuRAPui/IWo7RduZuEEOk00yeiJMO+sn1vetnxfW1Oxe3Cpn0DcvV+4Vpcj7MDQq/m53g7KjXA== X-Google-Smtp-Source: AGHT+IH42wukj8GbmTs9+BMhArdpt6HYvZfXX5RMQRx9rfsHC3dP2v52kLPz51icltfcxuNMVINZ X-Received: by 2002:a05:6871:108:b0:220:bba1:5c92 with SMTP id y8-20020a056871010800b00220bba15c92mr10042872oab.38.1710236346000; Tue, 12 Mar 2024 02:39:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710236345; cv=pass; d=google.com; s=arc-20160816; b=bZf7N88un62Zeb2bVs9VbC/WwWcmvgV6uMnqNK2bulStIej7nX2ZV/xdJl1v3KTWaY 712HCy4/atwBgOhdT6Or2nPzrs87PlKyv8iLYGbXdD9LcxhFjmw1qGa5F2M7yXI6zgOc Ovgrk0nXswJ6VvShxvq3hHx6OrvOjnKHHChz4wuaFvOj+2jpib31sOhTumyPcsVOtLxS jetzXdze9nYLo7HNNy8asd6JNqa1H2EzpUienIL8zUDHUyp98ucVQRvVNtCb51d8WTg7 uOcUKFPxXbdpOwjX0nufU2RcufgshWDloeOKrhNGlQysRCAQGMDzcq2tfJSShVyAQ+it jjUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bA0S7M4gG0e69O4EYUrnt2iUifpIo8vw2dCmbYYcmCw=; fh=i33T/ATjvLtG4zDztiGPgbyeZ3cvkBTBWfnICw6yR8U=; b=t5IyJYb8qlGmPxcrzEZEvPDDUXLxPUgTxy5uqLlZyw6dcpFfZVXzwFj76LHuD1JMp7 nlPJ3s8r9wQuR9tAulVcWPs2/zEw22hOamwZkcQNwRGQqPFYRLrefI9d3iCf/AigtWbX Xk3pjs0uJscKYD9JZNgBG3VPyyJDnCYBdb9C/0KLkd+lpEwcf+Oibi2ok2Cnf6k4X6Zc 6wc2ooFygvNaVXfR5NngjsbZbHP+H3HipojsxKWIKQRuKe3+8zHbnFrO0RFRkVDDEvQu hDEVO+S+4ZLOxqbY5cxmqmMa+GAHSNa8bwlReO6fQGuHg6v/zt1opSIOFKGy67Bj7yvM 48Jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=anD0IdeB; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-100021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o74-20020a62cd4d000000b006e444ed29edsi6577102pfg.200.2024.03.12.02.39.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 02:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=anD0IdeB; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-100021-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3F326B21F60 for ; Tue, 12 Mar 2024 09:26:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5959C78267; Tue, 12 Mar 2024 09:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="anD0IdeB" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 4A86E77F1F; Tue, 12 Mar 2024 09:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710235567; cv=none; b=lbXOkyrNptdNZYfAHyENtJVFf1qotS1/no3qUT2e9U0bgp7Abve2vVbEynJ35lwYP5paeBbt/Mthzkj1DtGJyt2c4VxBoOAxH0pRuiRn2nZqss3CSzy45N3iWbTWdwi8dh1yFz6QHr5h8vk6m7KHgjBEb9wI2vQbcziy6piN3is= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710235567; c=relaxed/simple; bh=VOtzu6pnO41S5DBKsXuajblcmv55uls1zQ2De8lxwX0=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Ro7r5aOLVss8kC01GMnDUGnEJcnxQYes3VVQMWrBjvAtiynlCr/M8M3HbF32oWoV49XUlCqg9F2oGfKs154rjqsrneH0x998htu2w/qNzEe99e6+PukMfZOYhJyGLptOfAwCCDlCCgrW2pMHkFGpQvdlCAceVyUJOppU8vd5x0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=anD0IdeB; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1710235561; bh=VOtzu6pnO41S5DBKsXuajblcmv55uls1zQ2De8lxwX0=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=anD0IdeBLPsxG57xpu6JZ4TNAnII+7jyzSn6jWmHbUnQeReMUfAjI22pIngvwTqGy o/mSmGfeEVMt4u8k8gE4Z/HPzAJ1vhaOOqZ6A8fEONkBj7ebhf+mHJwzOzmI1GTzVk P5lC/zpJckI8YnbmAn7bRgyYDHVufx7z/xO3F0wPl4vWyw8YtVHultlWqEkQwAn7T6 gYWiWQKOcp3c5A+MCfxPwdgmvfksT1knCjWrO9gqWbWTAqFefIRVggXF78IyNt2KoV NzOWOoekI/eQIbABuPTLuWWzzfM3oqX53Q22AUgYaoft7cd7C1dVpEYL9cHF+ZfTUs j2PVZ+N7w/2Rg== Received: from [10.193.1.1] (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 1016B37813E5; Tue, 12 Mar 2024 09:25:57 +0000 (UTC) Message-ID: <21f8dbe3-9de2-41ad-a8bd-61d66cb38e90@collabora.com> Date: Tue, 12 Mar 2024 14:26:28 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: x86: skip the tests if prerequisites aren't fulfilled To: "Chang S. Bae" , Shuah Khan , Dave Hansen , "Kirill A. Shutemov" , "Peter Zijlstra (Intel)" , Weihong Zhang , Binbin Wu , angquan yu References: <20240307183730.2858264-1-usama.anjum@collabora.com> <1cacbd08-1131-4be4-b318-58c05afda2de@intel.com> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <1cacbd08-1131-4be4-b318-58c05afda2de@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/11/24 10:39 PM, Chang S. Bae wrote: > 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. Yes, > But this > function should only be invoked when AMX is actually available, not as part > of the feature availability check. How can we check if AMX is available or not? > 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? I see. But once we check if AMX is available. > > Thanks, > Chang > -- BR, Muhammad Usama Anjum