From patchwork Tue Jul 2 20:49:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 809217 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B5331E531 for ; Tue, 2 Jul 2024 20:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719953360; cv=none; b=fgI68V0UtfB4HtdsAX+4P0ukLvMR8JX4gFfC+wj3BxPAL0YwmPBmxevpbg3jM13nHhxqdaw9GmUmOsqNoDMbVuUj1tkI9L7EHSNDrUyRlcqDzoVeOjnx5jJ+aXOcj8CbqvijKxNXzUWrn0BdZJjISCyQtEOeHBlrUEA05FvCnqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719953360; c=relaxed/simple; bh=MgR0RZP1WxJDF9dnlMLkpmneg2DO1jzVQiIEhyW6oas=; h=Content-Type:Message-ID:Date:MIME-Version:To:Cc:From:Subject; b=g7m1/m5HUCkXT4/dqIxlrGXZNywukl6g/69wXQALQr1jR7qWB5zdbpH8A3BpCwZezj8MUC0etqLiCFT5+XGV1nh1etD7Xj/xfoLzQdhlvhxIpAqHFFU4ZQWkC4DAY+P91janFDe/kKVnkF8/h7v6lNq3aP+SF/VrkGe4TquH5Zk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WoAbay4A; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WoAbay4A" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7f3d395dcf9so13029039f.0 for ; Tue, 02 Jul 2024 13:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1719953357; x=1720558157; darn=vger.kernel.org; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=iLLKSn27p2evVRjhLNa5UY8CKY/YLlnkCm8VanWlXPM=; b=WoAbay4AkwFQnzsAYW/5xcmLN/fljL4a1Wn/VP9rabI/YOAeye7LI84Jtaf1T5mxnP rW6FXB40rj+qHRk95bICc5qH+H0fZwBvmSGrIUoB2jbgU52SlK2xm8NGQIiK8e/yI/Vo E9zn6dcILcX8W00QihlP3doZqFMshs3kSdShA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719953357; x=1720558157; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iLLKSn27p2evVRjhLNa5UY8CKY/YLlnkCm8VanWlXPM=; b=JwBhtYQaNpRSm7qarSkgxn7a5v1rmp7nTpKCfeg4ot7aqccyETjP3YzzyUVsnZ6yeU B16kJ9xid9S8tNxzBh88eIopdFtXuzzGAC2fTeGmdwTncFABl1LIacOv8wbhsTpMbIIC nNqulFT/VXM7l4tfMImy7aUpFBER2TG+tsXLJhq2/oESxYXleSLPACRYQ3fbiBOZoOIU DGnrObmvQswr4eHvG3LtTnCHjKxd8NrnF7L43sAcYZYJqLyiC95j90SYBzFKCsoTbenx rjET+cweThWrQ8+TLtOiY+cXaS64Er+/zOYXM6Cdd5Xf52W2w9UItBVph5mzSNgXE5Tz PSPg== X-Forwarded-Encrypted: i=1; AJvYcCWeFmRV22WUC+i/u6NpEmkz6ws8OY3CkdcBLbD15rnnotpuCXd1MVAyuxyiIux4AVIt6R6BsyBzNDB0PSDMhiJWO4j0dTDRnBQYdO8Ramvz X-Gm-Message-State: AOJu0Yz9WBQq6X7GNlGC3FCn0zTvDh3bzCWYBQPJ0tB5u9llSDgi9KGZ a+kxKskappnlU6l2ni7eX8ZkGIBUaBKfj1XRbgIGniypd7TZeRS+CSTvqV0Agz0= X-Google-Smtp-Source: AGHT+IGoamVC7yUj/wm+rd9r+5CC1jn1ABv+VOHDyGmteGriIkIhYfOPUvW5NbRU+eJF7FeAaEUPJg== X-Received: by 2002:a05:6602:42c5:b0:7eb:69ec:43f2 with SMTP id ca18e2360f4ac-7f62ee5deaemr910660839f.1.1719953357391; Tue, 02 Jul 2024 13:49:17 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4bb73bbdafdsm3040707173.24.2024.07.02.13.49.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jul 2024 13:49:17 -0700 (PDT) Message-ID: <457af485-777d-4675-aea5-e3b77ccb8246@linuxfoundation.org> Date: Tue, 2 Jul 2024 14:49:16 -0600 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Linus Torvalds Cc: shuah , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] Kselftest fixes for Linux 6.10-rc7 Hi Linus, Please pull this kselftest fixes update for Linux 6.10-rc7. This kselftest fixes update for Linux 6.10-rc7 consists of one single patch to fix the non-contiguous CBM resctrl: - AMD supports non-contiguous CBM but does not report it via CPUID. This test should not use CPUID on AMD to detect non-contiguous CBM support. Fix the problem so the test uses CPUID to discover non-contiguous CBM support only on Intel. diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit ed3994ac847e0d6605f248e7f6776b1d4f445f4b: selftests/fchmodat2: fix clang build failure due to -static-libasan (2024-06-11 15:05:05 -0600) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-fixes-6.10-rc7 for you to fetch changes up to 48236960c06d32370bfa6f2cc408e786873262c8: selftests/resctrl: Fix non-contiguous CBM for AMD (2024-06-26 13:22:34 -0600) ---------------------------------------------------------------- linux_kselftest-fixes-6.10-rc7 This kselftest fixes update for Linux 6.10-rc7 consists of one single patch to fix the non-contiguous CBM resctrl: - AMD supports non-contiguous CBM but does not report it via CPUID. This test should not use CPUID on AMD to detect non-contiguous CBM support. Fix the problem so the test uses CPUID to discover non-contiguous CBM support only on Intel. ---------------------------------------------------------------- Babu Moger (1): selftests/resctrl: Fix non-contiguous CBM for AMD 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 c7686fb6641a..55315ed695f4 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -291,11 +291,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]; @@ -304,15 +323,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; }