Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3633385rdg; Wed, 18 Oct 2023 00:56:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTpdbfY7eIlkVV6zfVKCfrsc+0gcf9Bz85Cg8ejzWkyaLwAtc5H4QvyrU52P+6eqpQ9V1T X-Received: by 2002:a05:6a21:3812:b0:161:2cf2:75ec with SMTP id yi18-20020a056a21381200b001612cf275ecmr3572688pzb.49.1697615777652; Wed, 18 Oct 2023 00:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697615777; cv=none; d=google.com; s=arc-20160816; b=Irg8/N4WNlzJe1KorFqGQ0eetRNMY++4YKBKzGozXoj8qTirGssWqUapkZMKi798q0 CtJ92+HulbRAbfu2ujZlvJl5ebzc3C8C+xQhxdgiCr4ZjT9m1OdiYSpMUpBCcZsT98w8 dgYMbzRBXcazJv0Jhb0kiq8IUX0BRoxZUIBhuL8zMVpNfhXQfD7ShIw33Ft8mgXsMb09 R618G8HzqGxL+SoIz082KYp0tptl8cF6k23DAktXTYnUn4z27p1ZUKvXOcDFqLZNDoYE 2DDp7nahVrumLTxWugDJnahLk2YBMkiFTOFV5yFpKybekbIVxA0WpXWFlx2JqGI/3U33 J6VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=/fLsTZEh+GH2fmNdpekWj+O/z8fEL0a0UxDGH+xC0Bw=; fh=M9ocEYFn8yrZ266S4+clsyb25gK7oCq66+Q1PeHBTAw=; b=jI2OChT+0YBLhRn/dB90lgg+z7ZfMomiBrfV51m2LHZmnGEg56G3Ag9IkhAariQncs CcsbCyYWlo5DwzNtLfwfH1d82U63Zbtqf8/9njrnUdkpeamtS+cwpJ6BSPCvhpoP+jZo 6mSzOIhp/WiSHB7w3IZsqf26/nwOhxKOmf8Ee4BTCBBrFO6VD9e3fX0w0y1Fdy4IXc6y Y8yTrUEkVWzy7n/h4ewagM8M+cpOVFuV4qEyewiGhYrnlt/brkI96rcgtb0PmeUZC5VX bLtYImi+Nsz0rK3In6bSCWKIXzVQl1KsVQZWylamZgaLOwIE9LoTQJqHPoutPqv+OzPj wjDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CpffZcq8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id nv17-20020a17090b1b5100b0027b123fbe9dsi1060051pjb.156.2023.10.18.00.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 00:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CpffZcq8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7915680BB1C1; Wed, 18 Oct 2023 00:56:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344545AbjJRHzr (ORCPT + 99 others); Wed, 18 Oct 2023 03:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbjJRHzq (ORCPT ); Wed, 18 Oct 2023 03:55:46 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39AAFC6; Wed, 18 Oct 2023 00:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697615744; x=1729151744; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=v9WPbSLAJSd1nBR3aP50+jggvvGNsUWZe+tO6/XexwM=; b=CpffZcq8sNN3QGmzwfYGxLH+lBkrsBU+9MqfW3YLnzPXXHlG3j5oduM0 Y2z1hU7bUTzglUg5Dc9LWYfFymeJGH6xeZ+H6Nm6jCn2j3Mvcr3spzYZw SVTWLiMvWfvxDoJJACE3fAcVRDqnPQZGC6Z/NNTzaww1++wIRjwZZ1Mir GKy9UlyJbx6RSmDRfRWRV5wSBc67hWGk1je/bfZ05Jm18hhms9A5OJh7Z SrbQxEPA3mPl+C7fHvgqViq/Rp89atDwUCimKarLjBqEk6bKHF25oUiau kzi0kzvAOK2R0x1IVxCxobBy19aK0WfG7hHN/6AKB7Kz2iDvjOLvIDtNm w==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="389837086" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="389837086" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 00:55:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="900235401" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="900235401" Received: from suguccin-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.44.63]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 00:53:36 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Fenghua Yu , Reinette Chatre , Shuah Khan , Maciej Wieczor-Retman , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable Date: Wed, 18 Oct 2023 10:55:26 +0300 Message-Id: <20231018075526.2251-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 00:56:00 -0700 (PDT) Commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") exposed a problem in feature detection logic in MBM selftest. If schemata does not support MB:x=x entries, the schemata write to initialize 100% memory bandwidth allocation in mbm_setup() will now fail with -EINVAL due to the error handling corrected by the commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check"). That commit just uncovers the failed write, it is not wrong itself. If MB:x=x is not supported by schemata, it is safe to assume 100% memory bandwidth is always set. Therefore, the previously ignored error does not make the MBM test itself wrong. Restore the previous behavior of MBM test by checking MB support before attempting to write it into schemata which results in behavior equivalent to ignoring the write error. Fixes: 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/mbm_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c index d3c0d30c676a..741533f2b075 100644 --- a/tools/testing/selftests/resctrl/mbm_test.c +++ b/tools/testing/selftests/resctrl/mbm_test.c @@ -95,7 +95,7 @@ static int mbm_setup(struct resctrl_val_param *p) return END_OF_TESTS; /* Set up shemata with 100% allocation on the first run. */ - if (p->num_of_runs == 0) + if (p->num_of_runs == 0 && validate_resctrl_feature_request("MB", NULL)) ret = write_schemata(p->ctrlgrp, "100", p->cpu_no, p->resctrl_val); -- 2.30.2