Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3913022rdh; Fri, 29 Sep 2023 06:13:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyDxu+oyBjFWAk+xTQ8hmOZJZEF7QkMW36ktgQLkODyfJ1bsn4zVTht/Ha4kufQ1u9UVVv X-Received: by 2002:a17:903:32c2:b0:1c3:b0c7:38bf with SMTP id i2-20020a17090332c200b001c3b0c738bfmr6385779plr.12.1695993183002; Fri, 29 Sep 2023 06:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695993182; cv=none; d=google.com; s=arc-20160816; b=kNAzP/TCZ4XDMx4o3pHilGGpQlmFkw+JjoAEUGDIqsVa0dtq68O5BZ/B8h6oooHb8C jFyzMEFL0WAPERA/Kf8CXprq4tKGiBlWem/oSr9+MiELYM5r/1P0tAeyXKL+2C1MErd5 sg5oRSn8O6irG8aUX/aAkkY/8tvTdKOKznNq8ihX+fdKs5Avzs+xEAzoeVd5ODe8VSz6 +7+bWvhLZAUNytfBqB/+pBtLY4dKfyjiAKVPHyPJbEbLBqVfZQi9/UCgSFhirYSe/boJ u/OfX7IH3eR4GQ7mS7HhmNwRxJCDv8FTbUjvd2+i2vKdYGXUK+H9nWv7A2TXL/qmbbEZ cRTw== 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:cc:to:from:dkim-signature; bh=Wgm9RGVFkUztOkbfqcpw+pvChfBSjyew395vnCgHCjo=; fh=7ClOg7aLFyyf/VZU9CUdqZYpYyNqNRZHmghY3K5zuKU=; b=DgndQyhxcCxTtXyfpf4RhggsqRlZ97ePUb2qquZRdQr5yibG4npYhlBQ8zw8Ah1xul yaHdAPOPrz1oQkqeaFpSYzdnN4c+r7esIhvfSbYByy0fRzBdJyNOLUuoXE14o5mSPgeg DLe2ewh1xGyPuKIAjRvBOjEe3lkvAW5/R8EyrKiaMGbE/ldNxwsievSOyhbUghmzpIef P3+nHmroxLxp3Nk6stt5/VcUs+5CPbd/jo0N8c3dt2JPbFj37HyBxfeagr11kJsmiUw4 zuFXNtu09SOdDeHNJu9jmcQvPnr5dQRYhYwnghOkoMT7wGf7D4htL0Fv6TVoOORQQpNM HxjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NfOyZGW2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l9-20020a170902f68900b001bdc10170casi17390011plg.36.2023.09.29.06.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NfOyZGW2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id EAFE0812A94E; Fri, 29 Sep 2023 02:02:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232836AbjI2JCQ (ORCPT + 99 others); Fri, 29 Sep 2023 05:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbjI2JCP (ORCPT ); Fri, 29 Sep 2023 05:02:15 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450B01A5; Fri, 29 Sep 2023 02:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695978133; x=1727514133; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+7N3r11ZPTiRU3UdIEyXIXr+ZZSWSJgkPRmWmAkiOUU=; b=NfOyZGW2ceHF00MLL22uhypzotO0ZRG2qDkPaEIH6APwgdZJmRxCOCSY M2sIRRF5KQQoRa+pWnewvn5QV2wGdn5/P6x/PsBAGFssmHAaPOvNRCZVW kb6P35dVEpGZDCJ+3USDRxdOcOeZ4a12lhHs2XJR1GUXIimrJAq1m6TMC P+fPvog0Q0lA6qG7ae/cAH15soTKuCvhQHoDc/5AxQD2wlqpYucJs8mzZ b99srpZyes6DKpmOQ5PGWKu0f+qqNSI4TtvGTtdqnvm7Th/EN3F+bxtw2 C25n6KvrltkRBl6WT9oohA26L2i0S6UJ2Gu7l6PsJNq7nWcGeycS02kXM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="385078451" X-IronPort-AV: E=Sophos;i="6.03,186,1694761200"; d="scan'208";a="385078451" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 02:02:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="749904385" X-IronPort-AV: E=Sophos;i="6.03,186,1694761200"; d="scan'208";a="749904385" Received: from tzebrows-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.26.85]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 02:02:08 -0700 From: Maciej Wieczor-Retman To: fenghua.yu@intel.com, reinette.chatre@intel.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, corbet@lwn.net Cc: x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, ilpo.jarvinen@linux.intel.com Subject: [PATCH v3 0/4] x86/resctrl: Non-contiguous bitmasks in Intel CAT Date: Fri, 29 Sep 2023 11:00:24 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 02:02:31 -0700 (PDT) Until recently Intel CPUs didn't support using non-contiguous 1s in Cache Allocation Technology (CAT). Writing a bitmask with non-contiguous 1s to the resctrl schemata file would fail. Intel CPUs that support non-contiguous 1s can be identified through a CPUID leaf mentioned in the "Intel® 64 and IA-32 Architectures Software Developer’s Manual" document available at: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html Add kernel support for detecting if non-contiguous 1s in Cache Allocation Technology (CAT) are supported by the hardware. Also add a new resctrl FS file to output this information to the userspace. Keep the hardcoded value for Haswell CPUs only since they do not have CPUID enumeration support for Cache allocation. Since the selftests/resctrl files are going through many rewrites and cleanups the appropriate selftest is still a work in progress. For basic selftesting capabilities use the bash script attached below this paragraph. It checks whether various bitmasks written into resctrl FS generate output consistent with reported feature support. Changelog v3: - Add Peter's tested-by and reviewed-by tags. - Change patch order to make 4th one the 1st. - Add error checking to schema_len variable. - Update cover letter since now the feature has moved from the SDM. Changelog v2: - Change git signature from Wieczor-Retman Maciej to Maciej Wieczor-Retman. - Change bitmap naming convention to bit mask. - Add patch to change arch_has_sparce_bitmaps name to match bitmask naming convention. Fenghua Yu (2): x86/resctrl: Add sparse_masks file in info Documentation/x86: Document resctrl's new sparse_masks Maciej Wieczor-Retman (2): x86/resctrl: Rename arch_has_sparse_bitmaps x86/resctrl: Enable non-contiguous CBMs in Intel CAT Documentation/arch/x86/resctrl.rst | 16 ++++++++++++---- arch/x86/kernel/cpu/resctrl/core.c | 11 +++++++---- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 14 ++++++++------ arch/x86/kernel/cpu/resctrl/internal.h | 9 +++++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 18 ++++++++++++++++++ include/linux/resctrl.h | 4 ++-- 6 files changed, 56 insertions(+), 16 deletions(-) base-commit: 27bbf45eae9ca98877a2d52a92a188147cd61b07 -- 2.42.0