From nobody Sat Feb 7 17:55:23 2026 Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012015.outbound.protection.outlook.com [40.107.209.15]) (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 35992357708; Wed, 21 Jan 2026 21:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.209.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030000; cv=fail; b=tDQf+fLjYDk/PhdQgOMUtmnjeMVt5VkU5HubAVmQpAP1AoJS66gV9GAUfs/+WS/iLNu0R0l2CmiNQg7pvGsfqYxTm9nYRFBLa2E5Ens82xVyYSN56MfATYF84RtwWl4tJgEIwpG7km0sOwkmG5YY1DU2M5RNvU49t8EVq6bpEbo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030000; c=relaxed/simple; bh=5JcyNK6iLnSYcGbYly1WtPePbCQOkm3+O3rs00pl2vc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dgPunH5sSPHIxzW/Ug/+Ldot5xZHOUQG6839fG3XeU/hrMTnL3og+1SqWxgGKbRKLLA3ra33EJXOlrJ/2t1SjVpGXr2pKRNQAszXPgZxHhnp3Tm6lLQgNZT/58noZGW2RWnDUMdRW0sqepmfctsKXJ2OAC/WN6g2OTDK/7K+Pso= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=VybWJfP2; arc=fail smtp.client-ip=40.107.209.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="VybWJfP2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a/23pkLhyibK3NyYLCLRKJ8Q3SYxJY6CcjzH3EXPCT9fFRKHKsjVcQWo3boncMOw1SdxrxQttqtuF/gHTHkv+vzIAKY0gO3kLoNGXtCurQPKL0sNHzm+nQ929nnJGD3uPyKGBpIucCxopYeJbv3TF5hGC1MbtbIi2vrx58/qkwEHLj+tl4c3j4Si64nap3lUYCGBF5OIpONS8JFEvthpkEir/xyeuIwwr9UgMycj7QL/4MpvXxZBCuMijIHyx9AJybhxS8VxEO9rkHJpQSOR5hKQWh53Wl28TbEn3lhqd0yEiPiTCjlbaIVfVdwGhRt8iwDk3CeGgxyimeBlgPViBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0ot4YPkCiLiBaR6M1lp5qi3D4FX+rdEyylRX1o+LnZE=; b=F7nKio6Z6lNzgoQvyXagovKT8WRHU6byqt2TIQNU0/wMRKbQx+/4GqGTuVWXlKPw0Ya6xjoScK091qVAWgrVWz1NEzh8U/7G9xvY1myKf7CagyPRoaiQzaU6C9dTLJfIDpxo7brh2+AwHnJEkeMrkZKdjFa6Nx49SrxeH+nt9rSxi1+3Fh0AOxfwA/1qUaHjth6cV990ZxjnmdpHUa3s7vKgXT+oxqbJtNzXNg5MOhlgHw82Z1CLLe84ZW9A9Ytvv0pMLjvtvWVCcyWwrM0EUPTMtGJYOetYgyTwZWl4rKDF7Q22f6gGBxuQAOntrQ2Ob/xpEeJo/O9cY/X9B6QcwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0ot4YPkCiLiBaR6M1lp5qi3D4FX+rdEyylRX1o+LnZE=; b=VybWJfP2cYjYtjYZWWOSMSdIadfbJXzSUYLa1LTPDm5voeBCYzaNu936Q909/FPzxfsWGi8/LQ7h5cvHgUCgzBBFwgE/qDMZKzrlMKvkIOaYV+7IW6sU7IvdCtnFwAIzKzGC5MgjNzRLNRbGywuhTZOtFRxpNYuGv6dY+EtD15g= Received: from SJ0PR05CA0045.namprd05.prod.outlook.com (2603:10b6:a03:33f::20) by DS4PR12MB9707.namprd12.prod.outlook.com (2603:10b6:8:278::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.10; Wed, 21 Jan 2026 21:13:13 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:33f:cafe::ac) by SJ0PR05CA0045.outlook.office365.com (2603:10b6:a03:33f::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.8 via Frontend Transport; Wed, 21 Jan 2026 21:13:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:13 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:11 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 01/19] x86,fs/resctrl: Add support for Global Bandwidth Enforcement (GLBE) Date: Wed, 21 Jan 2026 15:12:39 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|DS4PR12MB9707:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e1cdde2-1359-4b28-c979-08de5931e324 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Un0XMty5w2EAPMt3YEpW72XwYc56gqE5hbXasnehQMZH1F19faJeD9DFwaIB?= =?us-ascii?Q?OHicYlpYhB2CZwniS51p90nBVlzY5k8cXoKmreHltun52VHrStweS+rK4Yce?= =?us-ascii?Q?vpEhMUDZZ9lUmVbDPjoz9fYjSSAmLp2cM6/h9RentrVM4fDaIv2OpPLfoyLm?= =?us-ascii?Q?gY/0SOcArV4q3Xm49dyMKnOYQcehP6dJBvzpqfZt+p8k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8OTpVUcPMsjCNhMSmCiaYATqvEc/91fc?= =?us-ascii?Q?KRBpny6QsuoddldBiTmX3dYUKpZPo24Fd1W8YQVmkz1l7uuUAHwucb0gE4mE?= =?us-ascii?Q?fN6gov8YDUXSUr0Wyxuy5CLf0akN6gWy2KVpm20Pd6xMLVrjlLQB1eCh3NBE?= =?us-ascii?Q?q8oSo7SAGSo9Nd1uAbaOahXXaPdUaB0qjDZWZpagjxHN193sKHRP2vk+CfhP?= =?us-ascii?Q?mumS05Wqwwley7GoiE83Rhop2cgfceiEoXUuCO3jsHtoQTJ095qToE1O+N2R?= =?us-ascii?Q?b4vjGe4UdJTxGG9MbMaFYwUPIDTpbHMUukZlHODMFp9EnD1x8zX40VpWz7n7?= =?us-ascii?Q?3+ewy2P9I4IHHxZe6hZGgtQfsHrg7txtBZMR40qrMHRjAaDI21rjtJo9PX2n?= =?us-ascii?Q?cJg04WMan4yUkTMCJrqaKVO1Q4uiul0Gx9nHQtESw8Xt1rSWuEOL+JVzpgDi?= =?us-ascii?Q?zi+V7JrUBk4jiBTs4YYT/nS50IyU2ZSBAwlaxEVp2pnpm9G7ykdANQoFPM+c?= =?us-ascii?Q?DN658Ii0LfrlkiVrb4LjWsaOQt4bR7PaoK2N5SaJQAR+rXlK1pKTRFMa3jPN?= =?us-ascii?Q?w5d1BCmuBa/3GdIf/PO+a8un//U=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:13.0958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e1cdde2-1359-4b28-c979-08de5931e324 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR12MB9707 Content-Type: text/plain; charset="utf-8" On AMD systems, the existing MBA feature allows the user to set a bandwidth limit for each QOS domain. However, multiple QOS domains share system memory bandwidth as a resource. In order to ensure that system memory bandwidth is not over-utilized, user must statically partition the available system bandwidth between the active QOS domains. This typically results in system memory being under-utilized since not all QOS domains are using their full bandwidth Allocation. AMD PQoS Global Bandwidth Enforcement(GLBE) provides a mechanism for software to specify bandwidth limits for groups of threads that span multiple QoS Domains. This collection of QOS domains is referred to as GLBE control domain. The GLBE ceiling sets a maximum limit on a memory bandwidth in GLBE control domain. Bandwidth is shared by all threads in a Class of Service(COS) across every QoS domain managed by the GLBE control domain. GLBE support is reported through CPUID.8000_0020_EBX_x0[GLBE] (bit 7). When this bit is set to 1, the platform supports GLBE. Since the AMD Memory Bandwidth Enforcement feature is represented as MBA, the Global Bandwidth Enforcement feature will be shown as GMBA to maintain consistent naming. Add GMBA support to resctrl and introduce a kernel parameter that allows enabling or disabling the feature at boot time. Signed-off-by: Babu Moger --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/x86/include/asm/cpufeatures.h | 2 +- arch/x86/kernel/cpu/resctrl/core.c | 2 ++ arch/x86/kernel/cpu/scattered.c | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index abd77f39c783..e3058b3d47e9 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6325,7 +6325,7 @@ Kernel parameters rdt=3D [HW,X86,RDT] Turn on/off individual RDT features. List is: cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp, - mba, smba, bmec, abmc, sdciae, energy[:guid], + mba, gmba, smba, bmec, abmc, sdciae, energy[:guid], perf[:guid]. E.g. to turn on cmt and turn off mba use: rdt=3Dcmt,!mba diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index c3b53beb1300..86d1339cd1bd 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -505,7 +505,6 @@ #define X86_FEATURE_ABMC (21*32+15) /* Assignable Bandwidth Monitoring Co= unters */ #define X86_FEATURE_MSR_IMM (21*32+16) /* MSR immediate form instructions= */ #define X86_FEATURE_SGX_EUPDATESVN (21*32+17) /* Support for ENCLS[EUPDATE= SVN] instruction */ - #define X86_FEATURE_SDCIAE (21*32+18) /* L3 Smart Data Cache Injection Al= location Enforcement */ #define X86_FEATURE_CLEAR_CPU_BUF_VM_MMIO (21*32+19) /* * Clear CPU buffers before VM-Enter if the vCPU @@ -513,6 +512,7 @@ * and purposes if CLEAR_CPU_BUF_VM is set). */ #define X86_FEATURE_X2AVIC_EXT (21*32+20) /* AMD SVM x2AVIC support for 4= k vCPUs */ +#define X86_FEATURE_GMBA (21*32+21) /* Global Memory Bandwidth Allocation= */ =20 /* * BUG word(s) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 9fcc06e9e72e..8b3457518ff4 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -795,6 +795,7 @@ enum { RDT_FLAG_L2_CAT, RDT_FLAG_L2_CDP, RDT_FLAG_MBA, + RDT_FLAG_GMBA, RDT_FLAG_SMBA, RDT_FLAG_BMEC, RDT_FLAG_ABMC, @@ -822,6 +823,7 @@ static struct rdt_options rdt_options[] __ro_after_ini= t =3D { RDT_OPT(RDT_FLAG_L2_CAT, "l2cat", X86_FEATURE_CAT_L2), RDT_OPT(RDT_FLAG_L2_CDP, "l2cdp", X86_FEATURE_CDP_L2), RDT_OPT(RDT_FLAG_MBA, "mba", X86_FEATURE_MBA), + RDT_OPT(RDT_FLAG_GMBA, "gmba", X86_FEATURE_GMBA), RDT_OPT(RDT_FLAG_SMBA, "smba", X86_FEATURE_SMBA), RDT_OPT(RDT_FLAG_BMEC, "bmec", X86_FEATURE_BMEC), RDT_OPT(RDT_FLAG_ABMC, "abmc", X86_FEATURE_ABMC), diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattere= d.c index 42c7eac0c387..d081d167bac9 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -59,6 +59,7 @@ static const struct cpuid_bit cpuid_bits[] =3D { { X86_FEATURE_BMEC, CPUID_EBX, 3, 0x80000020, 0 }, { X86_FEATURE_ABMC, CPUID_EBX, 5, 0x80000020, 0 }, { X86_FEATURE_SDCIAE, CPUID_EBX, 6, 0x80000020, 0 }, + { X86_FEATURE_GMBA, CPUID_EBX, 7, 0x80000020, 0 }, { X86_FEATURE_TSA_SQ_NO, CPUID_ECX, 1, 0x80000021, 0 }, { X86_FEATURE_TSA_L1_NO, CPUID_ECX, 2, 0x80000021, 0 }, { X86_FEATURE_AMD_WORKLOAD_CLASS, CPUID_EAX, 22, 0x80000021, 0 }, --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013063.outbound.protection.outlook.com [40.93.196.63]) (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 C6F223F23D9; Wed, 21 Jan 2026 21:13:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.196.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030010; cv=fail; b=jW6c0ZjvubRihiU1BertADlFJiFS/zEIT3OprFMtrFHdtjW27+LMV6ByRahnnudOSS0Ks/7guKDBX+Jjn/aHZqA/1VEG6XQEoKDAiZx9jp8w2zIrCgvXDunanUBpnMnwz4F90WSR7is5Lio/8QhC330bY0yUja4O3eI66WPDkcI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030010; c=relaxed/simple; bh=C6VNZ4StDNOCgDXKRm8QvQQ8spyv27tT0GJEkQuL8IU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DpmRk7qtUMtQ2oT9BwGZRuNpkmhI03343QjzgJGkrkKw35yUK4MCJBqexoI9u4jNY9XkeTmi329gIOG9NuEyIguNIREFKu45ZceI+uwkDg+JZ4tM63qcxa3ROvOhaGBot1ygGpZsHe6P7yLfVuYsAECJKkgrPs84OCazsdTiqXA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ZdU7voLW; arc=fail smtp.client-ip=40.93.196.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ZdU7voLW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i7fii/KFVW/+nkp6lPR9Y61qZg9LZhpVSfDVjBKGl94MNks1tEgHn1A5NTuC084erot3wL91npKVMaQT+7Nsb334Q/kQhj/kpISnEclyLRzf1BGaFuwfEXokAap/Vo+WJfEhgf2sbf+X+2Dm0XppPt/m8iVM+1ElRhWIoMnAsTgsbYtR8KWkOEyxWFM74AekyQpxvDKHgoLYYWD/RRTAyuuQy1WdTYDnp6gk8Nfmem8MFS+yJ3LbtBqk8mnM+MsLXPXyYD+ot+9Gn0hhhkFHMQuuVUQ12rxGot/hfmimhDeERxhjVySzd9n+YH3bYwGuefVLedtAOSYFXXRUJqRAtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CRM03+T1cgpAIYEAdTDYkMlwzAa53/I5tjNH681T7CY=; b=RUJg2nj1zC4EdFJc5IJEcHxgzyYQainrP+Jdk3KhLkEav7/YcxjC4t9JeYEEY2lvUKecSXSqsH7pdgSlxy8kmwzCB9/IUu2I71o4Ye1wuutArv7pKO9UXGHb3oQQy+5ZmTt+QuZvSgxSUbXTiJJVGj1UexsgyruTROSfcQIqSlz8kMmTQPGPyAEBQ52xShR6ULz1ylpnfwLFYWisa6wx9DM/2akzVEgFNpKmh6HezXxxQ9/zPEd+V8DUX12ez9XfCQwDB14rVzhStMrhWHN9dqh2egjRqeX1X4omYrMJ/WpqhrfkItXe7sBhoR8Yfhkyok9h//V3awxPRbjHC9l3zQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CRM03+T1cgpAIYEAdTDYkMlwzAa53/I5tjNH681T7CY=; b=ZdU7voLWmBQfcxeA7L/+OGnGBE7ukpDLdO/uHdawjhNL/bexqM2QnKiwoL4eGj0EYW6xvam7ZKZFSevw8VAsF6ao+v9DPED5iKYWJeUXmFFfRwSv6kKuTg+iOVQcyJYcovTWF4F9iJq/nlS2CDhdzMtsrj/kFX+0hnttBGeTPgE= Received: from BY5PR20CA0017.namprd20.prod.outlook.com (2603:10b6:a03:1f4::30) by DM6PR12MB4329.namprd12.prod.outlook.com (2603:10b6:5:211::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:13:21 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:1f4:cafe::37) by BY5PR20CA0017.outlook.office365.com (2603:10b6:a03:1f4::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 21:13:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:20 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:19 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 02/19] x86,fs/resctrl: Add the resource for Global Memory Bandwidth Allocation Date: Wed, 21 Jan 2026 15:12:40 -0600 Message-ID: <6c37e6003e82561070d8737ca8a3b542e70ff832.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|DM6PR12MB4329:EE_ X-MS-Office365-Filtering-Correlation-Id: 9630b168-53fa-4efa-ac8a-08de5931e7bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RfqpTwQtupE6+N8FCefwHs++5xAEvaYbYNxAa2dN6P85Ke6yb0JOtgOn4XXO?= =?us-ascii?Q?frzwqkbbU2uvJajKHK4DaX+XrNEIH1pmBzWe5ObbK91jzN06N2V2OJSY5rqG?= =?us-ascii?Q?SThPhawItu83r4fMSYmPacPeIzODxfTCmbLbeFmCT5XqdIhs3+zwef6gueLQ?= =?us-ascii?Q?XVkSRxTNs2KGcB+ciNYepkJrSTxBmQlIIGsqWgHh9nCUxr5FYoqV9bf8QyCk?= =?us-ascii?Q?Tgajt9KnLeFmo9NisJQVWI8tWajYbrPMltvu3HBUnPKih5SnSa1PKrhexvju?= =?us-ascii?Q?8lGs4AxhaQDznUIHBhsXCO0s6xGlhMIixw278H9nSeraq9PxEq8G/Vw/4Rpo?= =?us-ascii?Q?c3OSQXFWxkFWcXeAlQx3d6s6zDiukYXnw7uDBug+qOA2YSoZ7dRcKjabT9YW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kd4zwndRdKEGKgfjjE+UpL6GKw6yY+M7vJMIv?= =?us-ascii?Q?dOGEf31jfQn7so159v2Ny7STRF2ElIa1WvpczOcQyvl5iNyOL5cxqVkrBu0Z?= =?us-ascii?Q?2tTxGSPm3+2X1fN1hIz+Pf8p/1bfsUzaDZUtzxPZ5q1pRwhTvezVQAqTxVjo?= =?us-ascii?Q?w4lZPzG9DbqUVdH61qp819oz2QTCQxjNO6ytM4earEWVIPTul7qg2EfsEqfk?= =?us-ascii?Q?oTU5GTzNjsqthhF08TGxiI5UekICFTnm/WrgmtnUdx8BS5x0JEpKVCganF2m?= =?us-ascii?Q?bjYDDhS0N/RlDybH//wCBnoOVoKy347tSzBF8haGuSUN/uxTgzx18smH0Gb7?= =?us-ascii?Q?LvMXqDJ6BTGJlGTvsUAZ5Q9F8g0fnK547pBY/2eu6QMq+MRrGnue7epeBsJO?= =?us-ascii?Q?le0rglJdm0KND55B1LfZ8yKE3qs=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:20.8258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9630b168-53fa-4efa-ac8a-08de5931e7bc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4329 Content-Type: text/plain; charset="utf-8" AMD PQoS Global Bandwidth Enforcementn(GLBE) provides a mechanism for software to specify bandwidth limits for groups of threads that span multiple QoS Domains. Add the resource definition for GLBE in resctrl filesystem. Resource allows users to configure and manage the global memory bandwidth allocation settings for GLBE domain. GLBE domain is set of participating QoS domains that are grouped together for global bandwidth allocation. Signed-off-by: Babu Moger --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 46 ++++++++++++++++++++++++++++-- fs/resctrl/ctrlmondata.c | 3 +- fs/resctrl/rdtgroup.c | 13 +++++++-- include/linux/resctrl.h | 1 + 5 files changed, 58 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-in= dex.h index 43adc38d31d5..e9b21676102c 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -1274,6 +1274,7 @@ #define MSR_IA32_L3_QOS_ABMC_CFG 0xc00003fd #define MSR_IA32_L3_QOS_EXT_CFG 0xc00003ff #define MSR_IA32_EVT_CFG_BASE 0xc0000400 +#define MSR_IA32_GMBA_BW_BASE 0xc0000600 =20 /* AMD-V MSRs */ #define MSR_VM_CR 0xc0010114 diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 8b3457518ff4..8801dcfb40fb 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -91,6 +91,15 @@ struct rdt_hw_resource rdt_resources_all[RDT_NUM_RESOURC= ES] =3D { .schema_fmt =3D RESCTRL_SCHEMA_RANGE, }, }, + [RDT_RESOURCE_GMBA] =3D + { + .r_resctrl =3D { + .name =3D "GMB", + .ctrl_scope =3D RESCTRL_L3_CACHE, + .ctrl_domains =3D ctrl_domain_init(RDT_RESOURCE_GMBA), + .schema_fmt =3D RESCTRL_SCHEMA_RANGE, + }, + }, [RDT_RESOURCE_SMBA] =3D { .r_resctrl =3D { @@ -239,10 +248,22 @@ static __init bool __rdt_get_mem_config_amd(struct rd= t_resource *r) u32 eax, ebx, ecx, edx, subleaf; =20 /* - * Query CPUID_Fn80000020_EDX_x01 for MBA and - * CPUID_Fn80000020_EDX_x02 for SMBA + * Query CPUID function 0x80000020 to obtain num_closid and max_bw values. + * Use subleaf 1 for MBA, subleaf 2 for SMBA, and subleaf 7 for GMBA. */ - subleaf =3D (r->rid =3D=3D RDT_RESOURCE_SMBA) ? 2 : 1; + switch (r->rid) { + case RDT_RESOURCE_MBA: + subleaf =3D 1; + break; + case RDT_RESOURCE_SMBA: + subleaf =3D 2; + break; + case RDT_RESOURCE_GMBA: + subleaf =3D 7; + break; + default: + return false; + } =20 cpuid_count(0x80000020, subleaf, &eax, &ebx, &ecx, &edx); hw_res->num_closid =3D edx + 1; @@ -909,6 +930,19 @@ static __init bool get_mem_config(void) return false; } =20 +static __init bool get_gmem_config(void) +{ + struct rdt_hw_resource *hw_res =3D &rdt_resources_all[RDT_RESOURCE_GMBA]; + + if (!rdt_cpu_has(X86_FEATURE_GMBA)) + return false; + + if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) + return __rdt_get_mem_config_amd(&hw_res->r_resctrl); + + return false; +} + static __init bool get_slow_mem_config(void) { struct rdt_hw_resource *hw_res =3D &rdt_resources_all[RDT_RESOURCE_SMBA]; @@ -954,6 +988,9 @@ static __init bool get_rdt_alloc_resources(void) if (get_mem_config()) ret =3D true; =20 + if (get_gmem_config()) + ret =3D true; + if (get_slow_mem_config()) ret =3D true; =20 @@ -1054,6 +1091,9 @@ static __init void rdt_init_res_defs_amd(void) } else if (r->rid =3D=3D RDT_RESOURCE_MBA) { hw_res->msr_base =3D MSR_IA32_MBA_BW_BASE; hw_res->msr_update =3D mba_wrmsr_amd; + } else if (r->rid =3D=3D RDT_RESOURCE_GMBA) { + hw_res->msr_base =3D MSR_IA32_GMBA_BW_BASE; + hw_res->msr_update =3D mba_wrmsr_amd; } else if (r->rid =3D=3D RDT_RESOURCE_SMBA) { hw_res->msr_base =3D MSR_IA32_SMBA_BW_BASE; hw_res->msr_update =3D mba_wrmsr_amd; diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c index cc4237c57cbe..ad7327b90d3f 100644 --- a/fs/resctrl/ctrlmondata.c +++ b/fs/resctrl/ctrlmondata.c @@ -246,7 +246,8 @@ static int parse_line(char *line, struct resctrl_schema= *s, return -EINVAL; =20 if (rdtgrp->mode =3D=3D RDT_MODE_PSEUDO_LOCKSETUP && - (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_SMBA)) { + (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || + r->rid =3D=3D RDT_RESOURCE_SMBA)) { rdt_last_cmd_puts("Cannot pseudo-lock MBA resource\n"); return -EINVAL; } diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index ba8d503551cd..ae6c515f4c19 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1412,7 +1412,8 @@ static bool rdtgroup_mode_test_exclusive(struct rdtgr= oup *rdtgrp) =20 list_for_each_entry(s, &resctrl_schema_all, list) { r =3D s->res; - if (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_SMBA) + if (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || + r->rid =3D=3D RDT_RESOURCE_SMBA) continue; has_cache =3D true; list_for_each_entry(d, &r->ctrl_domains, hdr.list) { @@ -1615,6 +1616,7 @@ static int rdtgroup_size_show(struct kernfs_open_file= *of, closid, type); if (r->rid =3D=3D RDT_RESOURCE_MBA || + r->rid =3D=3D RDT_RESOURCE_GMBA || r->rid =3D=3D RDT_RESOURCE_SMBA) size =3D ctrl; else @@ -2168,13 +2170,18 @@ static struct rftype *rdtgroup_get_rftype_by_name(c= onst char *name) static void thread_throttle_mode_init(void) { enum membw_throttle_mode throttle_mode =3D THREAD_THROTTLE_UNDEFINED; - struct rdt_resource *r_mba, *r_smba; + struct rdt_resource *r_mba, *r_gmba, *r_smba; =20 r_mba =3D resctrl_arch_get_resource(RDT_RESOURCE_MBA); if (r_mba->alloc_capable && r_mba->membw.throttle_mode !=3D THREAD_THROTTLE_UNDEFINED) throttle_mode =3D r_mba->membw.throttle_mode; =20 + r_gmba =3D resctrl_arch_get_resource(RDT_RESOURCE_GMBA); + if (r_gmba->alloc_capable && + r_gmba->membw.throttle_mode !=3D THREAD_THROTTLE_UNDEFINED) + throttle_mode =3D r_gmba->membw.throttle_mode; + r_smba =3D resctrl_arch_get_resource(RDT_RESOURCE_SMBA); if (r_smba->alloc_capable && r_smba->membw.throttle_mode !=3D THREAD_THROTTLE_UNDEFINED) @@ -2394,6 +2401,7 @@ static unsigned long fflags_from_resource(struct rdt_= resource *r) case RDT_RESOURCE_L2: return RFTYPE_RES_CACHE; case RDT_RESOURCE_MBA: + case RDT_RESOURCE_GMBA: case RDT_RESOURCE_SMBA: return RFTYPE_RES_MB; case RDT_RESOURCE_PERF_PKG: @@ -3643,6 +3651,7 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgr= p) list_for_each_entry(s, &resctrl_schema_all, list) { r =3D s->res; if (r->rid =3D=3D RDT_RESOURCE_MBA || + r->rid =3D=3D RDT_RESOURCE_GMBA || r->rid =3D=3D RDT_RESOURCE_SMBA) { rdtgroup_init_mba(r, rdtgrp->closid); if (is_mba_sc(r)) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 006e57fd7ca5..17e12cd3befc 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -52,6 +52,7 @@ enum resctrl_res_level { RDT_RESOURCE_L3, RDT_RESOURCE_L2, RDT_RESOURCE_MBA, + RDT_RESOURCE_GMBA, RDT_RESOURCE_SMBA, RDT_RESOURCE_PERF_PKG, =20 --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010010.outbound.protection.outlook.com [52.101.46.10]) (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 5C9EC42983A; Wed, 21 Jan 2026 21:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030017; cv=fail; b=C9f30lKnWPRkZ8hgOQ5y7XkeUTsB0PTLhDJhuifI3Cmsy2mse6KN2Eor2MRXRcnBkLL5HaccxbaI2AiCk/W4jLshvvqrFHbL4wdnsDoINHCFj1fVhCahFQPwx96tZ1l/uoBjAzZd8GHe4VZS/kqQ8yZarssk0c+Mfr+ATVLtbcE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030017; c=relaxed/simple; bh=YNHJIyu5XLxzQQcbDOlHz4lAV40riJ3AydCjhHhfrow=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Rnr4RFG2tXXNgpMeoShFCF8KyQcI1oWd3eX4EKYTP8+4AkiEir67IdzyQWyJu4JpLHn8EYH6Ducx/GDAgH6d5UxFkhfLFCfkfxuTRWG9AcSCeEp0/Fl1KVyIJha4gKv7rCq3AE/wBnUPfWAUfxp7mkURYgtNalFspgaOUZSO/Yk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tt9HLdux; arc=fail smtp.client-ip=52.101.46.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tt9HLdux" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gI4Dq6dKkUk47JBNRu2Y/v8nj4KvwQXs3JT7fnXq2dbYJy81PWHUxFI/KGzMoz8LPmZDFV/MGTxUhf/06phPm6RIYdOIKv4xGGGSPRkHlw1tumI1OCbPYOfomEWkXy9E0inKRjGmArZP94yhTL1wpQggm8VBqSA2B5HSYlVxs5Al5i1ad0l21pkaW8K/BJ8gXFfPmSTWYNWG2bY4p9OLZjAQslprnLvDjA+EOCzV3Hx4bu9LnPngZdF4uDExJihJuBGEUpJlOZwh6sDom2yewfAAZats3G/BUc/nzPcCFetJYm+URky7Vm34V9t1bxzeQPfKeOzzJXGcJczaWrsbZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xk33vo0tJ3rkkIrL/9jLu72NVf+yXfzEmmi7ECxyveE=; b=xUXi778cCvMyAmA1XUgiXIZt2uKmGwHBooHn2h3XVQ+/NyFnmhZz7RavqBoz1mWxIZvZSsb0zY0/snX/cPn+Z6OVATebhpOPPIsdM4YjbkQ75EwWSoMkiLLovpiUeOZIa0tvMJPnnIVd8/56/+E/eAocp/ihvi6X3AAJUKEX6iNaEuNxT1kSFo5fJWdtVNe2R4l2aiM569flXyWntL70PQCXr1F8ORRjM8l0HQI5GCYH5Hob/O2m/lACHr8GdC689FDYhb1N2SuJ+607ppfSCciYmioPTsf85xVV1F7wDyQNPqqPDIfWFUUgwV1291pVHCjBMuFzc1La/0iiGsySxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xk33vo0tJ3rkkIrL/9jLu72NVf+yXfzEmmi7ECxyveE=; b=tt9HLduxKCncwSxXaP0fSw/pW6t9zYSRGxMPzWZSlBLc0eEyzkWu6+aO3T4HQdYSK2if41h/iula5EKpzHp6iB4hLOGDtAKRNHR125Q8H8Ff9oGA85ASK1wRj263/Pz9MlG9nmE2U2vij0Sy1rF4LPUgtcL7B101f6cA+QZlkjk= Received: from SJ0PR05CA0103.namprd05.prod.outlook.com (2603:10b6:a03:334::18) by MW4PR12MB5604.namprd12.prod.outlook.com (2603:10b6:303:18d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:13:29 +0000 Received: from SJ1PEPF00001CE7.namprd03.prod.outlook.com (2603:10b6:a03:334:cafe::fe) by SJ0PR05CA0103.outlook.office365.com (2603:10b6:a03:334::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.5 via Frontend Transport; Wed, 21 Jan 2026 21:13:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE7.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:28 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:27 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 03/19] fs/resctrl: Add new interface max_bandwidth Date: Wed, 21 Jan 2026 15:12:41 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE7:EE_|MW4PR12MB5604:EE_ X-MS-Office365-Filtering-Correlation-Id: 79b753ea-6ab7-4e69-957e-08de5931ec8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ApxvQg3Kc72T82WsUW6sIxFaTJJmmb0MzIg7eu3r9Ez3G4Emx/b22EPcdQ0F?= =?us-ascii?Q?QVFy6reQtUHsAZd6VUDojQYn0pKqZJxTwqA43JS5R57k//ItOwzipirJMAdT?= =?us-ascii?Q?C15GmlghIFUyucAlxYIv1Pv22hHlsClntgOah2454RUm18RSax2oZ5TFEl5y?= =?us-ascii?Q?p9nySdRvWFCQ75YNontbm38eAKcx5gy/EkKzUVoJ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53pFJetIR5oX1lfiRHs6hUM6ftgICSVeknKl914kvnVaOOuTjWPu?= =?us-ascii?Q?j/dT0x4iy1kIIyKs9qw8xNUqSDFP0XMq8w4Jv5SvfZATWHbQmqrpN4gQFruU?= =?us-ascii?Q?pdnv7Oz0+gsU9Mtr+FxmYipmuXd+G7vHxEGsSDXyxeukTabZ0p2iAdedsUGz?= =?us-ascii?Q?DZRk3SlDKpZu4NGT7DAPAfbwlrzMFelmXutX2TJVXBe/PtTpHIXy+w/eD1Gy?= =?us-ascii?Q?sPj9hb4oK/gFO7+sPQdcy6rZ1S5ka9nhuRCB40i8X5dyAf6WZmQ212b6a0tj?= =?us-ascii?Q?OlpRPS1Oyoo4Zpwe04H5M95qOczCRV5VXLQA/P0XjGv/pSSG5A194j65dWJ5?= =?us-ascii?Q?xmL7y9KMQXEj6v6mnN7YMtfP8P+auyAeEMhXIt8Q7gn5zqGPlKd69+D2fLVl?= =?us-ascii?Q?RAhCL+aA3Pv5+8KihvhcDRGh7CeKVDR4cxwJmNO04Xxya0fu+yFNYCe8qn4a?= =?us-ascii?Q?gm42Gfy9yHxgUJLXnqard04I3mh90HMY/LIjzHmy43+/12UFKeAPY8EJZPCf?= =?us-ascii?Q?wqrbGZpP8Ip8t3b9Zdp6Diw4Z96OUOFstwDq/1cGIDAZxcEK5kEiDwWV3hde?= =?us-ascii?Q?gtDuuZNhldPK66Vx4/zXvaeMMTQ=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:28.9365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79b753ea-6ab7-4e69-957e-08de5931ec8d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5604 Content-Type: text/plain; charset="utf-8" While min_bandwidth is exposed for each resource under /sys/fs/resctrl, the maximum supported bandwidth is not currently shown. Add max_bandwidth to report the maximum bandwidth permitted for a resource. This helps users understand the limits of the associated resource control group. Signed-off-by: Babu Moger --- Documentation/filesystems/resctrl.rst | 6 +++++- fs/resctrl/rdtgroup.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index 45dde8774128..94187dd3c244 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -224,7 +224,11 @@ Memory bandwidth(MB) subdirectory contains the followi= ng files with respect to allocation: =20 "min_bandwidth": - The minimum memory bandwidth percentage which + The minimum memory bandwidth percentage or units which + user can request. + +"max_bandwidth": + The maximum memory bandwidth percentage or units which user can request. =20 "bandwidth_gran": diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index ae6c515f4c19..d2eab9007cc1 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1153,6 +1153,16 @@ static int rdt_min_bw_show(struct kernfs_open_file *= of, return 0; } =20 +static int rdt_max_bw_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + struct resctrl_schema *s =3D rdt_kn_parent_priv(of->kn); + struct rdt_resource *r =3D s->res; + + seq_printf(seq, "%u\n", r->membw.max_bw); + return 0; +} + static int rdt_num_rmids_show(struct kernfs_open_file *of, struct seq_file *seq, void *v) { @@ -1959,6 +1969,13 @@ static struct rftype res_common_files[] =3D { .seq_show =3D rdt_min_bw_show, .fflags =3D RFTYPE_CTRL_INFO | RFTYPE_RES_MB, }, + { + .name =3D "max_bandwidth", + .mode =3D 0444, + .kf_ops =3D &rdtgroup_kf_single_ops, + .seq_show =3D rdt_max_bw_show, + .fflags =3D RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + }, { .name =3D "bandwidth_gran", .mode =3D 0444, --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013050.outbound.protection.outlook.com [40.93.196.50]) (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 92D3D42B759; Wed, 21 Jan 2026 21:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.196.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030026; cv=fail; b=gYvIRGLFi120W5k2Pj/JFMKCA3KWeLODUSK+kdPq9LhTwAUmo78Ef7OoJdo+f89NL2L2Yd5HkAEX79/iZFOqOvcPi1VTi6YW7v+XZWM/LfrflmBN9AbdXT+B5o4VhWF4X3047SYyZiCM36kRNGZxxq3BcJkJeKdQqe9OWW+tb0Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030026; c=relaxed/simple; bh=Si4oT+ZjhnigXaXf24Py/aaaUjWOphr2moG/TlJ5uf0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j2a9LFppjVV3lgL88FtCVweXnoj9Jt7uEDlW/XPUjtY6IPe2vWF+4Ok+e0a4aY6pyt3a1B5ZTu6X9T/RE0/cP+6X+O3ltfQ8yvzgDlardkO98xVdxUPzdqk4pdSkvD/VjBl18KXLnsnoyrFShYg2zytdHCCQCzWfPiDReTTHxS4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=bsWFt3tv; arc=fail smtp.client-ip=40.93.196.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="bsWFt3tv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EjcTb921HdX0FrS18UE1aRFqBzhA8UwJyBsGF83RFVpRm/WRs3X04SMrUOIeDPhe9RT4AH7MQh3ZuCoyJcHzhpWPnx3xYZFbGLkAqCEsnNEWrjdx4KNYBew66EKdC5mMvo6pu0LVCj9SF6p//bCQRBcC+IK2fnXImwvM/b403WvBnpVkaOqlIvMf07RzZP7Inw/VYP1QW5V3G9SY6NxoyvFS+488fkR/HmYVzFt+ZbzEDYnUXiVz9Qnm0F27npvCRtQPt7EtV2LllN68MIdrl80Htr3fqBVjVZQMOszmz3rvm7+xHamQc73vCNfN9CkS9aQBp8gJd7ipNtClYNxTKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GYIAkSRwOZyJ1DXPlSMjTzvfWW+fvbahMrWeAvqdUzE=; b=i5J129VzS5+F2Xz0VwZGZmHtygnny/VKGOdNkWiUtxaBdswPbxxlQRIUNzjdf2RD3W2SKo1kmoLXu7Yg810dMJry51SLxfkrY7LzSeVfKhu5d8ysE/Sknzc5YcnET9x69T3ybJsRaKnP5IWI8HgkDLOkjE2A63TykMgpRWgqrOxvikcY3iL/hZoPkFjG3MHQtroTAWLPlI6Pc40YS15HRUPxfU1qhGsHwD7NQ7WTCMwQgk/LPk7y7xptsei/ulsKj4aEbyEq/mfbdLwBjd24As9KPc+NEZUo3tb1H/7r4lspR3pbO+AxPkgvkTLi8m6zVGSAOeCco3I4R9thaNS9Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GYIAkSRwOZyJ1DXPlSMjTzvfWW+fvbahMrWeAvqdUzE=; b=bsWFt3tvuGrhE7rWSI93xV/KW9F3UN9h+CuoGwjJ2ed6izdNIv+ejSlfuMnJV/37IRNvx75HG6D0SRGv5q/VaCBTlttoOVxpqihu2slpQfUVWWmXbqpdx10q0nS9VbT+7iXlIsVt+BBB4f7eEHd9HVvUfsrypyYACNqgBBObd+I= Received: from SJ0PR03CA0362.namprd03.prod.outlook.com (2603:10b6:a03:3a1::7) by IA0PR12MB8086.namprd12.prod.outlook.com (2603:10b6:208:403::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:13:37 +0000 Received: from SJ1PEPF00001CE9.namprd03.prod.outlook.com (2603:10b6:a03:3a1:cafe::e) by SJ0PR03CA0362.outlook.office365.com (2603:10b6:a03:3a1::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:13:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE9.mail.protection.outlook.com (10.167.242.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:36 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:35 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 04/19] fs/resctrl: Add the documentation for Global Memory Bandwidth Allocation Date: Wed, 21 Jan 2026 15:12:42 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE9:EE_|IA0PR12MB8086:EE_ X-MS-Office365-Filtering-Correlation-Id: e39b8a1d-afcc-4e69-3cec-08de5931f155 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?oLVFa7h2ZXlxtVyHXxtQZw5GO739+7X05EdH2z5Qb2kODdpW1+5WkAQYfDjP?= =?us-ascii?Q?E9r6YJp0FsLQzENyi7UTt19b7Sr4JAVxc0xfqfx/hURGd7wSiQoRigrLriQ8?= =?us-ascii?Q?GzynU499EhsNMx4sGCjcfwKybgtCGDgMxWppSBQNgCpvz5+NgontWWx7btHr?= =?us-ascii?Q?IXsG6h5xWAdEmIHktL6rZiPd3ch1EzmyaPcYb+Vr5i4ukW/mI39A0+ibZvKB?= =?us-ascii?Q?Uo9ottpwb3V2AVUOfaPvOdQgGDJkJZXlcMitbzkxDF6I8fCjDf+7Enyboq87?= =?us-ascii?Q?xc+2aSV3bYtT3a/0F0UiWHNPy6BiDufZ55XNOCAh1byDCINBS/1bDOZrED0q?= =?us-ascii?Q?XddIeiQjwhjArbo7b51XQgW6A04O+VmoyklaxaAIiSj0OPnml8WAGw7GkEHs?= =?us-ascii?Q?KAK1Ljbzbwa/nD3vEFSyKiPqrp4HFPywR8Z5LLIJQuLqnDgSZlJ7SmlzEbPB?= =?us-ascii?Q?2BalRRf9uLhFMV8MgTCR3vlb5JAPg7sSH4k11+LHZP5hHlT5F1t37fdI87bq?= =?us-ascii?Q?/IVLXT4//bwVzfs4WHJGVzCn8LgVXantSyL/ifrx8qSGJA/f6tDw5KyIxNK/?= =?us-ascii?Q?hPykre85ZCRMwJPyLlCy5BoIyUJB9AbsN7k8ywHAV7yBZEfpAhWwyOV7gRK9?= =?us-ascii?Q?9QM12pCoLll8mVjI8m7kfj0PKBwf4/OJd/PTfpbK6+GSgHIG0iHgIpYeK4Fq?= =?us-ascii?Q?RUIOAk9mL0Obgy2GK7LNCC3z/KvWliexz1NfhpDF8D3rLX06qPtsJSD4z0y9?= =?us-ascii?Q?ekOUTgm5svwiOsK7vCGZ7wnPHKf3yvYlraDiwVZNUyDxFnC3p1wPt0LQGT4W?= =?us-asc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3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(36860700013)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:36.9004 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e39b8a1d-afcc-4e69-3cec-08de5931f155 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8086 Content-Type: text/plain; charset="utf-8" Add the documentation and example to setup Global Memory Bandwidth Allocation (GMBA) in resctrl filesystem. Signed-off-by: Babu Moger --- Documentation/filesystems/resctrl.rst | 43 +++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index 94187dd3c244..6ff6162719e8 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -28,6 +28,7 @@ SMBA (Slow Memory Bandwidth Allocation) "" BMEC (Bandwidth Monitoring Event Configuration) "" ABMC (Assignable Bandwidth Monitoring Counters) "" SDCIAE (Smart Data Cache Injection Allocation Enforcement) "" +GMBA (Global Memory Bandwidth Allocation) "" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Historically, new features were made visible by default in /proc/cpuinfo. = This @@ -960,6 +961,21 @@ Memory bandwidth domain is L3 cache. =20 MB:=3Dbw_MiBps0;=3Dbw_MiBps1;... =20 +Global Memory bandwidth Allocation +----------------------------------- + +AMD hardware supports Global Memory Bandwidth Allocation (GMBA) provides +a mechanism for software to specify bandwidth limits for groups of threads +that span across multiple QoS domains. This collection of QOS domains is +referred to as GMBA control domain. The GMBA control domain is created by +setting the same GMBA limits in one or more QoS domains. Setting the defau= lt +max_bandwidth excludes the QoS domain from being part of GMBA control doma= in. + +Global Memory b/w domain is L3 cache. +:: + + GMB:=3Dbandwidth;=3Dbandwidth;... + Slow Memory Bandwidth Allocation (SMBA) --------------------------------------- AMD hardware supports Slow Memory Bandwidth Allocation (SMBA). @@ -997,8 +1013,8 @@ which you wish to change. E.g. Reading/writing the schemata file (on AMD systems) -------------------------------------------------- Reading the schemata file will show the current bandwidth limit on all -domains. The allocated resources are in multiples of one eighth GB/s. -When writing to the file, you need to specify what cache id you wish to +domains. The allocated resources are in multiples of 1/8 GB/s. When +writing to the file, you need to specify what cache id you wish to configure the bandwidth limit. =20 For example, to allocate 2GB/s limit on the first cache id: @@ -1014,6 +1030,29 @@ For example, to allocate 2GB/s limit on the first ca= che id: MB:0=3D2048;1=3D 16;2=3D2048;3=3D2048 L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff =20 +Reading/writing the schemata file (on AMD systems) with GMBA feature +-------------------------------------------------------------------- +Reading the schemata file will show the current bandwidth limit on all +domains. The allocated resources are in multiples of 1 GB/s. The GMBA +control domain is created by setting the same GMBA limits in one or more +QoS domains. + +For example, to configure a GMBA domain consisting of domains 0 and 2 +with an 8 GB/s limit: + +:: + + # cat schemata + GMB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + MB:0=3D4096;1=3D4096;2=3D4096;3=3D4096 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + + # echo "GMB:0=3D8;2=3D8" > schemata + # cat schemata + GMB:0=3D 8;1=3D2048;2=3D 8;3=3D2048 + MB:0=3D4096;1=3D4096;2=3D4096;3=3D4096 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + Reading/writing the schemata file (on AMD systems) with SMBA feature -------------------------------------------------------------------- Reading and writing the schemata file is the same as without SMBA in --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012044.outbound.protection.outlook.com [52.101.43.44]) (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 102383803F0; Wed, 21 Jan 2026 21:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.43.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030034; cv=fail; b=Uq0g4j14PACYrfaJpbMCf8d+Wp2QRQc0wRRCJU1xWPtH3OO286Pe/bazJqoGBrht5EAsNqZnqa0z452LzVABQhC8opJJgHKP5av27bAUFNZWvWlvEl0MU/Gc7OlcXGLhbBAaQXr+golL6rFE1Gk2tJHpsSSUmifWK+t4sw2fqJk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030034; c=relaxed/simple; bh=RccvlA2mI4YwvN/U2TkpaT2uapoy4X3yhT1980Iicp4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=swwY0QNw8zHS0otAOBj4G4k/I3jvdSJ+ZDU98ID3aU/ZDTtmuAz3yG/45q4uWroUyDWt9RdAG+tpLEtJWkzA/30vSukULffpFpclXkFIoalZSWA2xQqJzRopdB9knRp2kXjO2Aym0X0p8+P21h7cg6sThqEMKBkR2ggotRfqxXo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=mPV90ir9; arc=fail smtp.client-ip=52.101.43.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="mPV90ir9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qk/ybuD+xEoqCcBjmivgvwLsgS5e532qPQ867TUcjpvirX7EONE4ZWzEdMlxxRy4giXtQvkelD1Gth7x28J2i0gUbFIpcB6ec4ibY8LsQBcpCo/D87oin9A3YSonvSx0FEQmsvd/JvFt52jH/JeeTqJB0rlm7rfy/KaxKuTsYGsTtzhCY1knWCErMIf0YbDfa7gBzKBTeQr7WLAE/iylfp//NMRkVeQM7QXpw9iv0mJ5a2kuXeDWUF0ezT6CLDKrL5CJUOXy6f7zB9s435P7j8Mw5uLGMh+gL9NmtD3wcqNWmvzX5aj31Sfs8+Myyty+WBffjxHuHHzzHomPvtSOKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dET9DkLiWFUYXQHLoGLpWw8qFSsU7xlV1jMTjS3LYtk=; b=GPRnaYGfJX1LZCGoVrcdzwQhC7+u7xQUb8VUjx9hPkzru6Vigimv4REHxgpZHwIhzA8o/nk5lZhD7zs4FY4C05OvtG9YOxF/Nh4ObKnIxvT0LSN+Ed7kQpR5py3fcSRIy/nBwTOoBS6TrMXmYvgqsm6k3XkXSW8cljT42b+58rmiltP/Mbn3NQuGBnbkV4Ag+Z0Bj9lnwOZlPkDs170HNRNPEC8MzMnG/tXmAE3OLFCyWx/+RlC8aXtzENpZsiB+On7JiEUVfzY1SRCMwwTGYyKUw9cRQurxE/zd0hEICGTJfDkGUr1PhZXrQPIhpf/PzTbGjdFPOztu53ynuESC/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dET9DkLiWFUYXQHLoGLpWw8qFSsU7xlV1jMTjS3LYtk=; b=mPV90ir9pFklb6ZbufQ73JGjW9AXtbFtVW0xtysvc2cwEQdD886S3hYK7aIiC4pXBPiMKSlr8GXGTHFAJIFhWBoChblom5ApuUq+cgZ/6PgRrWm6l1OuE44Z8S1XGu+dQ4+t6SFDNIOvIJOdZwRm3fIEUfKYJyJTl3HLMFQ6O4k= Received: from BY5PR20CA0008.namprd20.prod.outlook.com (2603:10b6:a03:1f4::21) by MW4PR12MB7015.namprd12.prod.outlook.com (2603:10b6:303:218::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.10; Wed, 21 Jan 2026 21:13:46 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:1f4:cafe::2b) by BY5PR20CA0008.outlook.office365.com (2603:10b6:a03:1f4::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 21:13:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:46 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:43 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 05/19] x86,fs/resctrl: Add support for Global Slow Memory Bandwidth Allocation (GSMBA) Date: Wed, 21 Jan 2026 15:12:43 -0600 Message-ID: <0f1046790e7721b4eccbaf246c23aa96b551008c.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|MW4PR12MB7015:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e102eea-ff71-4ce9-80c7-08de5931f71c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?n3v+b9a54znFp9HeFE8FjkS+rfUCPkd42jN0481Al6i0imXwnEXMsa9MuV0B?= =?us-ascii?Q?Jh8C/C4BlFDC3WZ2aOGsijkRBDC9TRPK+GtSBZm16MZ/yi5u3FreZJnlKCKl?= =?us-ascii?Q?6O/evJt8lCR+bsDBh6fB+ZhwoxFDQf8UVdpUv4riYg5Flg7Riqzib51GRQbb?= =?us-ascii?Q?9rScGU2rnW7FMegi3oDlQbD4Ljci6asY2QlG5qpuWzkWhs9wWq9cjczTlKRq?= =?us-ascii?Q?/NMnVNcLHs+RjXuSGjcmh0Lxieqe9L7PcTjnQdb8cp4kkYhTlTcc1+AtYaaZ?= =?us-ascii?Q?tANt31n7E33ws7JAf7BtO9zFrQVdAMgcWCcwNCCxGgcmG/aWwPX3oiTO/Ixs?= =?us-ascii?Q?Xp/B7igH1KRG+9Nj5f83ilpwTm4UNPA3xKdQtbQ3lThBbQUQxeKf7UWWsUNy?= =?us-ascii?Q?U10mRAwr6Mw2TCuTbIbQ5u4ilY59lqY1a6naZwBJ8O1RRCIf82ePUfmH6yRu?= =?us-ascii?Q?AvzxujuNUOA8oPjQjr/Qxrp8kN8RfybLUYfSwaE2fOaQ9d4uCDus1aUgDMCm?= =?us-ascii?Q?AYrxIPCZLBHpg0E6ou9KkTTB1KfNWSnKdxOs0GVlNROfDBgFwHvUv9UfZBOW?= =?us-ascii?Q?SFPVWwWPnhXQ95Y5Y9RAy6gtGjKCllYiadNnfW3EeCm/gZYlKC1knnd5dkcg?= =?us-ascii?Q?OxoTMurtXtlLNr+Uon+/S7C0qJkfS+du6pT5p1V5mBJ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ZvH7dnGSZ7zVa5201wLvB2mgp16iuUSw1EKSZYIm3GpN8?= =?us-ascii?Q?Q0Cker/rybVI60iZ35NoVhdz7QUxCuw6MADFFsDoe7thyA5mPOUSljv3Ikkv?= =?us-ascii?Q?z7VdSfZmR3LdLoXn7p4XzIQ2t3E=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:46.6222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e102eea-ff71-4ce9-80c7-08de5931f71c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7015 Content-Type: text/plain; charset="utf-8" AMD PQoS Global Slow Memory Bandwidth Enforcement(GLSBE) is an extension to GLBE that provides a mechanism for software to specify slow Memory bandwidth limits for groups of threads that span multiple QOS Domains. GLSBE operates within the same GLBE Control Domains defined by GLBE. Support for GLSBE is indicated by CPUID.8000_0020_EBX_x0[GLSBE](bit 8). When this bit is set to 1, the platform supports GLSBE. Since the AMD Slow Memory Bandwidth Enforcement feature is represented as SMBA, the Global Slow Memory Bandwidth Enforcement feature will be shown as GSMBA to maintain consistent naming. Add GSMBA support to resctrl and introduce a kernel parameter that allows enabling or disabling the feature at boot time. Signed-off-by: Babu Moger --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 2 ++ arch/x86/kernel/cpu/scattered.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index e3058b3d47e9..d3eb21e76aef 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6325,7 +6325,7 @@ Kernel parameters rdt=3D [HW,X86,RDT] Turn on/off individual RDT features. List is: cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp, - mba, gmba, smba, bmec, abmc, sdciae, energy[:guid], + mba, gmba, smba, gsmba, bmec, abmc, sdciae, energy[:guid], perf[:guid]. E.g. to turn on cmt and turn off mba use: rdt=3Dcmt,!mba diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index 86d1339cd1bd..57d59399c508 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -513,6 +513,7 @@ */ #define X86_FEATURE_X2AVIC_EXT (21*32+20) /* AMD SVM x2AVIC support for 4= k vCPUs */ #define X86_FEATURE_GMBA (21*32+21) /* Global Memory Bandwidth Allocation= */ +#define X86_FEATURE_GSMBA (21*32+22) /* Global Slow Memory Bandwidth Enfo= rcement */ =20 /* * BUG word(s) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 8801dcfb40fb..b4468481d3bf 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -818,6 +818,7 @@ enum { RDT_FLAG_MBA, RDT_FLAG_GMBA, RDT_FLAG_SMBA, + RDT_FLAG_GSMBA, RDT_FLAG_BMEC, RDT_FLAG_ABMC, RDT_FLAG_SDCIAE, @@ -846,6 +847,7 @@ static struct rdt_options rdt_options[] __ro_after_ini= t =3D { RDT_OPT(RDT_FLAG_MBA, "mba", X86_FEATURE_MBA), RDT_OPT(RDT_FLAG_GMBA, "gmba", X86_FEATURE_GMBA), RDT_OPT(RDT_FLAG_SMBA, "smba", X86_FEATURE_SMBA), + RDT_OPT(RDT_FLAG_GSMBA, "gsmba", X86_FEATURE_GSMBA), RDT_OPT(RDT_FLAG_BMEC, "bmec", X86_FEATURE_BMEC), RDT_OPT(RDT_FLAG_ABMC, "abmc", X86_FEATURE_ABMC), RDT_OPT(RDT_FLAG_SDCIAE, "sdciae", X86_FEATURE_SDCIAE), diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattere= d.c index d081d167bac9..62894789e345 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -60,6 +60,7 @@ static const struct cpuid_bit cpuid_bits[] =3D { { X86_FEATURE_ABMC, CPUID_EBX, 5, 0x80000020, 0 }, { X86_FEATURE_SDCIAE, CPUID_EBX, 6, 0x80000020, 0 }, { X86_FEATURE_GMBA, CPUID_EBX, 7, 0x80000020, 0 }, + { X86_FEATURE_GSMBA, CPUID_EBX, 8, 0x80000020, 0 }, { X86_FEATURE_TSA_SQ_NO, CPUID_ECX, 1, 0x80000021, 0 }, { X86_FEATURE_TSA_L1_NO, CPUID_ECX, 2, 0x80000021, 0 }, { X86_FEATURE_AMD_WORKLOAD_CLASS, CPUID_EAX, 22, 0x80000021, 0 }, --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012057.outbound.protection.outlook.com [40.107.209.57]) (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 8FC2D4266A8; Wed, 21 Jan 2026 21:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.209.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030045; cv=fail; b=OBJn9IDyNVPcXM+nEP87KQlbzTKMzADCDUMOXQGVO/BQY5Vquxb2E53EW5HSVQIucT8NPsT6LfDVimNsT1r78/xC5tajC/2PBJCHk/Y9cFJBeK7xo5P0WQ1AmHNoIueI7VUWuFEri9bfl6bqJ1S6TM14jx0fuNk55Mh3EOi5pkE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030045; c=relaxed/simple; bh=0yw+QGOG5FsjUpsFM0lRz+XbBCi5MllTwgsXV4dnWtk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SUFqVMZkTQdhRrTJIIqw67DuJsU65XZkK7OSX0YAOJ00DNmeJJ4Jw272SOm2ivZKUDESiz9zbxl7qgxoet2+OpxD55ri0onLdBAiNYkbIwxwXwI2tmTlcs8o7hH26B6CQ+Af7/+oMUWy6YXud/Dlyi43ozOYue4ln7zGlw0gEvg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=R8kVpwoL; arc=fail smtp.client-ip=40.107.209.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="R8kVpwoL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tJPe1u644YkWy0kCk09/hGpDSepc08AM2f6huyLA0GPdR6Ikq1s1C1+YFrEFlUlokE5SSZ7gNBn6rr10Hri81qt/1N3c0L76GrX7HqceSQqxGm+I03APdt0VIecOrhdBh+zwFlJxnT7j8eocXGH2Bw+TeLW1OUaifoaULmukuHoHxt0pOOB7q0U2VPk7Nstu+Mfd8+XUAry/9qjMabmKyEpkY4HVBqNsQH0v6JvzozE5ONVROZ0lOhKXhsgIaf9Lup14pCMFcreYh1yW67OFNHgdSjsKdWVZqEVVes4WyGGAUGIG0aMBQo9+VQPwHtTwV2/MFUY5UsIZEqUMFYE2wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=21bvvTCZp7ro2MXXcK1LQRhUC85Y/qfoDMFT7WCz3dg=; b=FaKr6BG6hsp97cID0Efi/xcAlJGa1fQigRf75pqmc5kzHPrYwwBA6QrrOxyzmLm5UZvye7ucJr1LUefPLOGJVAIxMQJGef6NB2/09jFAtzBkpjtYzdDBPlsngQElVDw+ZscsIyI4ulrHcOsLmIs8dJQSS6cEM/3/l1Sp+2qVybE1xfxlJAecIQUWQrCq6CMPHN0oQdhD7RgBMWHCiH/Gi38xxpCk/6mMWuiVJP6ecJc+jvfT5HnSp7XVyu7s+pcyeaFVCT7X3R4jrx3QVcD6TAcUZEjzRf1PV/KbQ0NGiOAPP2K/xR5M8eBLDwfPQSvFw+7BjDFXDHVmWhy750pi6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=21bvvTCZp7ro2MXXcK1LQRhUC85Y/qfoDMFT7WCz3dg=; b=R8kVpwoLeykQPatNsPrUZCllj2Hu4ktk0537iZ8xdIefhdz9C/GluBtnoCPIznje0/5it7CXbnfPRZGPECoIwHFRxWRgjbSUKHtse+n6ea13bETFo2dIsDkts0nLmXLbB0JpV5Y2IUOlgPiQLCTWAomGBoeVcq0UCtED2N3u08U= Received: from BY1P220CA0001.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59d::14) by SJ2PR12MB8740.namprd12.prod.outlook.com (2603:10b6:a03:53f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:13:57 +0000 Received: from SJ1PEPF00001CE6.namprd03.prod.outlook.com (2603:10b6:a03:59d:cafe::2c) by BY1P220CA0001.outlook.office365.com (2603:10b6:a03:59d::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:14:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE6.mail.protection.outlook.com (10.167.242.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:13:57 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:51 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 06/19] x86,fs/resctrl: Add the resource for Global Slow Memory Bandwidth Enforcement(GLSBE) Date: Wed, 21 Jan 2026 15:12:44 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE6:EE_|SJ2PR12MB8740:EE_ X-MS-Office365-Filtering-Correlation-Id: 8214b571-b788-4d92-a30c-08de5931fda7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9PSaHjgAyZF5SM/5NNduhUvl+6RwIJ3AzguViM0rIx+PXAzJ/CP3E6+YGKZD?= =?us-ascii?Q?SLRiP0ooMUcHsNERoe/6TRMp5S+pgvISAG1EQAharJV/FBex7ec4xq4IDmlW?= =?us-ascii?Q?VhVn8/O1tCH4H6OUSrf+CyrzLNb2Kq4r6v2tP1yiwZ5YAQCfcymSVOcSoWeB?= =?us-ascii?Q?U4zSE9eAeXwTMCt5vnU0NHmtxe8oSoPhJVK8cIz5ugfRp+NamD7zazdujGOZ?= =?us-ascii?Q?w7jlJW4y+aGC3381V6AP0doN4u0xPrYIklFISAlEznKXUui5hZNve/zZtTqX?= =?us-ascii?Q?qNoLgYG7CTmLBJSs6VEzz4r4OdjiLv95XSwKfwU5n64vMABEMhTzbRiqRWK9?= =?us-ascii?Q?dKEEpuSOck0Sql2quFzD6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us-ascii?Q?PZREgW0MqgCuRHIctYdaM7TwiesCIEg4IAyg/TUgoxkokKJJXsMgdo9TpCPS?= =?us-ascii?Q?QYeM2vmCk5rxZt1OkQ7pPqyYYGSDW5sALDOvyWLddDkKr9hEZmyK4k8AKVVX?= =?us-ascii?Q?Ot69iWorTXs6ErEF72x0Jp+PM0+PipRKR9Z30E+V00rixrZPJs5h4mKWTk8k?= =?us-ascii?Q?g9e6qDstfcgrniTdS9TKEASOJuNw8L7dD2ttoBx9aha2pPQo0GRqNEbKbZmB?= =?us-ascii?Q?ihrlg40koxNneG+0wTO9XtVqUFgkt3mFIcxroMxpAj1SFqpGPfbzDN1TtQiT?= =?us-ascii?Q?Ev0q8oS9KCEqoz68MNy8T4bd4lzo2qXZRkP9AOKjOj29TfvoeDCr4tUjBdr5?= =?us-ascii?Q?kzOq6w+JrYd8dx2hkHQ+BH/OD0gIVNE/7qrtGHyYM8FKflMONgvtf0ohU1Jk?= =?us-ascii?Q?YHIm3pBlscA3QFVkRtD8UJRcjtY=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:13:57.5997 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8214b571-b788-4d92-a30c-08de5931fda7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8740 Content-Type: text/plain; charset="utf-8" AMD PQoS Global Slow Bandwidth Enforcement (GLSBE) provides a mechanism for software to specify bandwidth limits for groups of threads that span multiple QoS Domains. Add the resource definition Global Slow Memory Bandwidth Enforcement to resctrl filesystem. Resource allows users to configure and manage the global slow memory bandwidth allocation settings for GLBE control domain. Signed-off-by: Babu Moger --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 31 ++++++++++++++++++++++++++++++ fs/resctrl/ctrlmondata.c | 4 ++-- fs/resctrl/rdtgroup.c | 16 +++++++++++---- include/linux/resctrl.h | 1 + 5 files changed, 47 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-in= dex.h index e9b21676102c..0ef1f6a8f4bc 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -1275,6 +1275,7 @@ #define MSR_IA32_L3_QOS_EXT_CFG 0xc00003ff #define MSR_IA32_EVT_CFG_BASE 0xc0000400 #define MSR_IA32_GMBA_BW_BASE 0xc0000600 +#define MSR_IA32_GSMBA_BW_BASE 0xc0000680 =20 /* AMD-V MSRs */ #define MSR_VM_CR 0xc0010114 diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index b4468481d3bf..cd208cd71232 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -109,6 +109,15 @@ struct rdt_hw_resource rdt_resources_all[RDT_NUM_RESOU= RCES] =3D { .schema_fmt =3D RESCTRL_SCHEMA_RANGE, }, }, + [RDT_RESOURCE_GSMBA] =3D + { + .r_resctrl =3D { + .name =3D "GSMBA", + .ctrl_scope =3D RESCTRL_L3_CACHE, + .ctrl_domains =3D ctrl_domain_init(RDT_RESOURCE_GSMBA), + .schema_fmt =3D RESCTRL_SCHEMA_RANGE, + }, + }, [RDT_RESOURCE_PERF_PKG] =3D { .r_resctrl =3D { @@ -261,6 +270,9 @@ static __init bool __rdt_get_mem_config_amd(struct rdt_= resource *r) case RDT_RESOURCE_GMBA: subleaf =3D 7; break; + case RDT_RESOURCE_GSMBA: + subleaf =3D 8; + break; default: return false; } @@ -958,6 +970,19 @@ static __init bool get_slow_mem_config(void) return false; } =20 +static __init bool get_gslow_mem_config(void) +{ + struct rdt_hw_resource *hw_res =3D &rdt_resources_all[RDT_RESOURCE_GSMBA]; + + if (!rdt_cpu_has(X86_FEATURE_GSMBA)) + return false; + + if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) + return __rdt_get_mem_config_amd(&hw_res->r_resctrl); + + return false; +} + static __init bool get_rdt_alloc_resources(void) { struct rdt_resource *r; @@ -996,6 +1021,9 @@ static __init bool get_rdt_alloc_resources(void) if (get_slow_mem_config()) ret =3D true; =20 + if (get_gslow_mem_config()) + ret =3D true; + return ret; } =20 @@ -1099,6 +1127,9 @@ static __init void rdt_init_res_defs_amd(void) } else if (r->rid =3D=3D RDT_RESOURCE_SMBA) { hw_res->msr_base =3D MSR_IA32_SMBA_BW_BASE; hw_res->msr_update =3D mba_wrmsr_amd; + } else if (r->rid =3D=3D RDT_RESOURCE_GSMBA) { + hw_res->msr_base =3D MSR_IA32_GSMBA_BW_BASE; + hw_res->msr_update =3D mba_wrmsr_amd; } } } diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c index ad7327b90d3f..5c529de24612 100644 --- a/fs/resctrl/ctrlmondata.c +++ b/fs/resctrl/ctrlmondata.c @@ -247,8 +247,8 @@ static int parse_line(char *line, struct resctrl_schema= *s, =20 if (rdtgrp->mode =3D=3D RDT_MODE_PSEUDO_LOCKSETUP && (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || - r->rid =3D=3D RDT_RESOURCE_SMBA)) { - rdt_last_cmd_puts("Cannot pseudo-lock MBA resource\n"); + r->rid =3D=3D RDT_RESOURCE_SMBA || r->rid =3D=3D RDT_RESOURCE_GSMBA)= ) { + rdt_last_cmd_puts("Cannot pseudo-lock MBA/SMBA resource\n"); return -EINVAL; } =20 diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index d2eab9007cc1..fc034f4481e3 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1423,7 +1423,7 @@ static bool rdtgroup_mode_test_exclusive(struct rdtgr= oup *rdtgrp) list_for_each_entry(s, &resctrl_schema_all, list) { r =3D s->res; if (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || - r->rid =3D=3D RDT_RESOURCE_SMBA) + r->rid =3D=3D RDT_RESOURCE_SMBA || r->rid =3D=3D RDT_RESOURCE_GSMBA) continue; has_cache =3D true; list_for_each_entry(d, &r->ctrl_domains, hdr.list) { @@ -1627,7 +1627,8 @@ static int rdtgroup_size_show(struct kernfs_open_file= *of, type); if (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || - r->rid =3D=3D RDT_RESOURCE_SMBA) + r->rid =3D=3D RDT_RESOURCE_SMBA || + r->rid =3D=3D RDT_RESOURCE_GSMBA) size =3D ctrl; else size =3D rdtgroup_cbm_to_size(r, d, ctrl); @@ -2187,7 +2188,7 @@ static struct rftype *rdtgroup_get_rftype_by_name(con= st char *name) static void thread_throttle_mode_init(void) { enum membw_throttle_mode throttle_mode =3D THREAD_THROTTLE_UNDEFINED; - struct rdt_resource *r_mba, *r_gmba, *r_smba; + struct rdt_resource *r_mba, *r_gmba, *r_smba, *r_gsmba; =20 r_mba =3D resctrl_arch_get_resource(RDT_RESOURCE_MBA); if (r_mba->alloc_capable && @@ -2204,6 +2205,11 @@ static void thread_throttle_mode_init(void) r_smba->membw.throttle_mode !=3D THREAD_THROTTLE_UNDEFINED) throttle_mode =3D r_smba->membw.throttle_mode; =20 + r_gsmba =3D resctrl_arch_get_resource(RDT_RESOURCE_GSMBA); + if (r_gsmba->alloc_capable && + r_gsmba->membw.throttle_mode !=3D THREAD_THROTTLE_UNDEFINED) + throttle_mode =3D r_gsmba->membw.throttle_mode; + if (throttle_mode =3D=3D THREAD_THROTTLE_UNDEFINED) return; =20 @@ -2420,6 +2426,7 @@ static unsigned long fflags_from_resource(struct rdt_= resource *r) case RDT_RESOURCE_MBA: case RDT_RESOURCE_GMBA: case RDT_RESOURCE_SMBA: + case RDT_RESOURCE_GSMBA: return RFTYPE_RES_MB; case RDT_RESOURCE_PERF_PKG: return RFTYPE_RES_PERF_PKG; @@ -3669,7 +3676,8 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgr= p) r =3D s->res; if (r->rid =3D=3D RDT_RESOURCE_MBA || r->rid =3D=3D RDT_RESOURCE_GMBA || - r->rid =3D=3D RDT_RESOURCE_SMBA) { + r->rid =3D=3D RDT_RESOURCE_SMBA || + r->rid =3D=3D RDT_RESOURCE_GSMBA) { rdtgroup_init_mba(r, rdtgrp->closid); if (is_mba_sc(r)) continue; diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 17e12cd3befc..63d74c0dbb8f 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -54,6 +54,7 @@ enum resctrl_res_level { RDT_RESOURCE_MBA, RDT_RESOURCE_GMBA, RDT_RESOURCE_SMBA, + RDT_RESOURCE_GSMBA, RDT_RESOURCE_PERF_PKG, =20 /* Must be the last */ --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010042.outbound.protection.outlook.com [52.101.201.42]) (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 7BF9D42EED8; Wed, 21 Jan 2026 21:14:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030059; cv=fail; b=W7eC4+QnGddN95l8ja05CadYv2mg3I2d10OH4st3UIYmtI0CPCyplztlJ9bJIQtB3kmm4DY/GXSGJ3Io2FTrCRq97oxViLo1dfyc7gK9omn6GOS7KVOL/s31FCz/aE8oEg5E6lzMQkU8wvQ4tuVz8E6Y8TeM8t70her2wKsjFKg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030059; c=relaxed/simple; bh=Pb9YvZpY4Xi/9YFd9OlNhVTalxQ5FZtQuC/2zWrOp3c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ua+aUyy224p2GfBmYQBh/GpjZxNbailnj3A6FgL28TZt2Y33Ba5KutjVIBXhMGcxPKr9aW+MyvKpOF2LBMW89hZq/EbgE/gPG/IqYSqKa9iOtRRqjBW9h/Ib6zhtYo5oz00wOJm4zra0KLM3vHwP1wrnPDyXpWeYHZzLAGBbHr4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=k3cZfTu+; arc=fail smtp.client-ip=52.101.201.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="k3cZfTu+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p3RN++dBz+1CalTOMN2P34DwknTfFV/0E7A9OnDfmKrzQkN8yMHFF3t0irM/xMbDjj+dHtMI/j7vUieKhS8g7/RKIrf1DwYLIJRyGUrnYYUsbgDwcpMQ0J4u0nX9Sge8plpi8Zqq1HOGJLoqTBuS+JLZvCVaL8IagsTAzEZUl0lX9K8a362xGcMdZbwIJpO3t6Lc7p1QuPDg+nqDOrPv4d4yZHIaKDZ4SwU7YZC33FaO20vYofQnAZMvY4cHb8PI1SEWjljAaa1o7ImhY39wvoP5y3eGS7wO3ok/jBYrINoevzDKWaSOhUnpaJAQq6vtJ2YfCSvFbu3Vc2DUJz1Atg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WitgPiOjTreNz/VMCh2V4/ToIZ4QEsuJ9aMU9pUKumw=; b=JOl+L1bpAItHUMF+qzoWbeYOvKG390Df0v5WOY+VwMv3A+VvAx3wA+/ZfajKYlOwKOlTElSFYbBKC+8WBC6lOmv70j2igmT8wxTKeEqSqsA05OCek0eyIZM7CmgAzz+zt8X94kmeALNtfmRDBvsKhu4wxxYrBBebZtp9gvVVLTMXtBOnFWnivYxD5wLZ4S4NQAtsRicBriToczRnRJEG4vzKGaUbU1vN8lkifBgGA8j/joA0egNVZ3+aVudEIGliXbcV653L5UDUWzCWMfXr8veNZ3JWgQxh7hDf9kv/sJB8qx42sDR6corVgnGG4T879lFKuxG/G8eFdMGWE5Pz2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WitgPiOjTreNz/VMCh2V4/ToIZ4QEsuJ9aMU9pUKumw=; b=k3cZfTu+m4tcSfzpJ6wiR3TO49FlEQRTdF6qp7p3YcvaF4FGHAhRRUkwa0fLX7oYp/7AblA1XWgtOPL3GMDYCSZ3fMOafqw60k91HwMgQSuH5DA3sz45OCTOFpb4QycRYWIrEP6ccQT11NjeBjQxAdjTQNANN8nVqGd9LoCk/eM= Received: from BYAPR05CA0039.namprd05.prod.outlook.com (2603:10b6:a03:74::16) by CH3PR12MB8330.namprd12.prod.outlook.com (2603:10b6:610:12c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:14:11 +0000 Received: from SJ1PEPF00001CEA.namprd03.prod.outlook.com (2603:10b6:a03:74:cafe::2) by BYAPR05CA0039.outlook.office365.com (2603:10b6:a03:74::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9564.3 via Frontend Transport; Wed, 21 Jan 2026 21:14:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CEA.mail.protection.outlook.com (10.167.242.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:11 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:13:59 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 07/19] fs/resctrl: Add the documentation for Global Slow Memory Bandwidth Allocation Date: Wed, 21 Jan 2026 15:12:45 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEA:EE_|CH3PR12MB8330:EE_ X-MS-Office365-Filtering-Correlation-Id: ca520328-b9af-4706-ffe1-08de593205bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RYj8YASRB6hkgTkJbdMgIZ7HcvKW1wOjxthk525ExMuk5aZaPTvlm4TkRmuf?= =?us-ascii?Q?Fs2hL+X7JOFEJBbmuFpf7PhQ/u3vE7dUQHPkH35WG6HftBXt9eQe84wj1EG6?= =?us-ascii?Q?GcM9jS7bTA2GwkRwls3drS1xqndReat+UF3ygN3s9P++KzqHERNJgXuxAsPL?= =?us-ascii?Q?HChAtys1LG4VubnwcVEna7r1Wuzj/PRw6vI/s7Yev29m96Tvxd24xOZW94x4?= =?us-ascii?Q?hHkWbhmZYpX8XN2txAjI04MpWuL0cPbULC9A9zZWT5yzkIBLu5JwoKr5+vpt?= =?us-ascii?Q?9yotXFM8IR8t4qEC3u9otAmxDxPvY4xwcSoaRgCenN/KZU/30HcBGiBZNHr7?= =?us-ascii?Q?OPKXNUkgVBh2+QjmCi7soE1sUktPDBboSxgwHPpjQeN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f/70AMhSa06jwIYyjZA77iWjvGHnmOIJloWv6hys?= =?us-ascii?Q?4GEjwQ8n+mlixb9EzDuVoMG5hSgnqnXLYl3Ip1wup6Z2Ld0UwDNVWQddUpe9?= =?us-ascii?Q?Pjgzgmk9YMy/foIlMZWyKmdyXTNYDDZ+xzVSKmPBBWOFDcSTtSmBuXONzSpH?= =?us-ascii?Q?HUfb90aiGw8nwV5BvPUUNuRRuFERs7AanbhtoxSjdIWEeENsn35l0ts9g49E?= =?us-ascii?Q?lykyZSDGZ7+pRrKGFq1yr51+LqMuo8Wr4AW4bHbvOzIGntU63d3r/5Ah8tYW?= =?us-ascii?Q?KK1/65WwpzUMs4MtQPR3dYUJtfFLuS17zPt2OhAhLpA0TM3+VDV23vSC4ths?= =?us-ascii?Q?AorG/1L4NFaFXghVrohRtgv3b2TWsEnOBL3Ro/9T1LLXH7OFcnuZ/jR27/hK?= =?us-ascii?Q?uV3+ILuoyTUJE69rMmgLpF3ZzX8=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:11.1547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca520328-b9af-4706-ffe1-08de593205bb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8330 Content-Type: text/plain; charset="utf-8" Add the documentation and example to setup Global Slow Memory Bandwidth Allocation (GSMBA) in resctrl filesystem. Signed-off-by: Babu Moger --- Documentation/filesystems/resctrl.rst | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index 6ff6162719e8..3d66814a1d7f 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -29,6 +29,7 @@ BMEC (Bandwidth Monitoring Event Configuration) "" ABMC (Assignable Bandwidth Monitoring Counters) "" SDCIAE (Smart Data Cache Injection Allocation Enforcement) "" GMBA (Global Memory Bandwidth Allocation) "" +GSMBA (Global Slow Memory Bandwidth Allocation) "" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Historically, new features were made visible by default in /proc/cpuinfo. = This @@ -995,6 +996,19 @@ is formatted as: =20 SMBA:=3Dbandwidth0;=3Dbandwidth1;... =20 +Global Slow Memory bandwidth Allocation (GSMBA) +----------------------------------------------- + +AMD hardware supports Global Slow Memory Bandwidth Allocation (GSMBA) +provides a mechanism for software to specify bandwidth limits for groups +of threads that span across multiple QoS Domains. It operates Similarly +to GMBA, however, the target resource is slow memory. + +Global Slow Memory b/w domain is L3 cache. +:: + + GSMBA:=3Dbandwidth;=3Dbandwidth;... + Reading/writing the schemata file --------------------------------- Reading the schemata file will show the state of all resources @@ -1073,6 +1087,31 @@ For example, to allocate 8GB/s limit on the first ca= che id: MB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff =20 +Reading/writing the schemata file (on AMD systems) with GSMBA feature +--------------------------------------------------------------------- +Reading the schemata file will show the current bandwidth limit on all +domains. The allocated resources are in multiples of 1 GB/s. The GSMBA +control domain is created by setting the same GSMBA limits in one or +more QoS domains. + +For example, to configure a GSMBA domain consisting of domains 0 and 2 +with an 8 GB/s limit: + +:: + + # cat schemata + GSMBA:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + SMBA:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + MB:0=3D4096;1=3D4096;2=3D4096;3=3D4096 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + + # echo "GSMBA:0=3D8;2=3D8" > schemata + # cat schemata + GSMBA:0=3D 8;1=3D2048;2=3D 8;3=3D2048 + SMBA:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + MB:0=3D4096;1=3D4096;2=3D4096;3=3D4096 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + Cache Pseudo-Locking =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CAT enables a user to specify the amount of cache space that an --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010042.outbound.protection.outlook.com [52.101.56.42]) (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 805E534C9AB; Wed, 21 Jan 2026 21:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.56.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030071; cv=fail; b=V9kGC7xCPbkQ6QTp2yk2pkcjSMUlgD35ThgnZ8kQAKMXFVg3v8ifY5E0YkmSG9tyDcmft/Ucb17lC/ZLTdMkJONCsviEmC0BDDPyjtvebQ5xKcpYUu4EEd4QZBhfs2NLJ1tF+jBKyw3kPYvJ8NiW5Fx+gz4wnocz70kZuMxqJ0g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030071; c=relaxed/simple; bh=7gzS6AEOBm8GgMlIpXngQVS6IN1/87xveGFUswoKRfc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bSt3ATyYL0yRaYadllMFxdxHIqRUXn33qysWHfU0XJfo9WxvCQyjLiNvhJyFLHmAP8ha3UeBDHbQtkwEIZ1I58/kv7GVGheH5AOOXIXguDWpP293TLTwqYT/8+R5zcoQK6+ZFlw9eu3Mcw5CYp/0/xvz9nm507GkqJNbeRPYOhU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ema5eeUe; arc=fail smtp.client-ip=52.101.56.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ema5eeUe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v3DNeNGXYDSQQAXY0TDw0ZqJbmbpALYsFmwAGpwYqDlVirRrhpFVJb9m3TVZulBMq2JG+b9tsm7Jyd/ADQNYDdziKBdHY+6QzytYqFw08ANfjFWMy42x5XIxctAZ1wVBN2Zs4vnKqMa7alQrwXtbokyxZMC1Vb/eMjVePi+HLIbx46lkmwa3AcJCyG8UaAvUAFm+KI6f9xeWp1+x7Nx2YT7zF6HlAKx833aSO5guoLGwxueMgm1h+wmCgXJsubDFifZCbAwJB7vPzH4T3QlvWOzs5FR21lgSdbhdYLw7SVECWh3qZS5KHu3NHGpiTJkq76wBhRAHyQMCsmQcaU38iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1Xt1F2DPBD8WMBT71HBDImNQPgzhV60b2WT5WOAzbmo=; b=SPTD/PwGx85L/1z75rlRx9JQj/Ekc69EdUEe9Kh8Q78AQVZTb/Hjrt0QNOo7Pz+raNeVXBWBMOxFk9zRya6wTyVxlssswbq9KA/E4J/FOGBrvTaZxDD0dUnrcfTia1dbVdCEDcPU1DkROo7eTqN3B9iQC9NufIiYC4a5KaPtFE/Sbw9NUNCbdu1sFEXeMGo5oBA77HjBbFIUqHgVcvTfz9YuN99DYN31769SIeSlJFTT+ZO2yfcQ7Whi2oaZN1xwAHrdXbUMWJVvlWzoLHET5KBEM7WU3tWEdUbgYbe2OEBeFCY5Akyq9yPYFBwnN1cWy26eTiclXh95ryymv7ChdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Xt1F2DPBD8WMBT71HBDImNQPgzhV60b2WT5WOAzbmo=; b=ema5eeUeAAxaHxPHkazfnMx/twQ5biVCpYMk7HYMpfmSNcIq44iQYQ614LI5aG6C2g6MADK95HAUwGdGtoymsOnBkU5zl8D9ZOaOHUhWNEpfIC9M5NCBatGwGDou4+3DqbzHcr3uXRQ1/Op+9/dsU1mFhVCCYFOyS160/oEFJ10= Received: from SJ0PR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:334::8) by MW6PR12MB7087.namprd12.prod.outlook.com (2603:10b6:303:238::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:14:14 +0000 Received: from SJ1PEPF00001CE7.namprd03.prod.outlook.com (2603:10b6:a03:334:cafe::bd) by SJ0PR05CA0093.outlook.office365.com (2603:10b6:a03:334::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.2 via Frontend Transport; Wed, 21 Jan 2026 21:14:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE7.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:14 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:07 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 08/19] x86/resctrl: Support Privilege-Level Zero Association (PLZA) Date: Wed, 21 Jan 2026 15:12:46 -0600 Message-ID: <3c3029e61d4602476b7836d82614ba4ec71b3a99.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE7:EE_|MW6PR12MB7087:EE_ X-MS-Office365-Filtering-Correlation-Id: c2a726e3-d276-465b-7e59-08de593207ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ynY3BEmQX3fP7nDfDgMAMCopbkRsWBmzmzf6UHfARX74UhV7mhdoeH2Zzg3/?= =?us-ascii?Q?fx/h+bbU8AXdP4qDiI3/b9HWKJViKEucWbMxysbTyjqnc2ww98Zys5ailXj0?= =?us-ascii?Q?jmGdSrJ4C/gnThFg/bQDKNDNUMrjggsTiVBq0IO4+i+RMRecStuxDGndEOFH?= =?us-ascii?Q?JNDraowyonJfm/yxslVMrpOwIrXXhGayLmPadMEYXqEqtr/KWaGRkoncf423?= =?us-ascii?Q?0cn3rw+rVMfBTtoKJZ2QVkAa5Vh7fJqEwsVANxb1E5xaTMWzdFkwPMSSmWg9?= =?us-ascii?Q?E7fq989qwl3+KVRaRHq99FwaIvlcjwX/xcu5UkMfSaQC9p7RcGzPKlJQY6WT?= =?us-ascii?Q?ojr42RNgsmOu4Gd5ocoPyww0eQtCxTG0k0caicLJtRZjEL16nSyQ+1H+4rmY?= =?us-ascii?Q?XbTsV1vV2++kQNav5QSr/a95+zRJIaBiI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8ayFJjR6oQGRxRkIu7JMZB7ndMS4jHMgRZA8Z8HKGsAinpKSlq?= =?us-ascii?Q?nBUQ1tftZLTSi4cBBwfOFvlNOJ2m++YFe2MYeOso8E5i7nlVVPkN9bXpGTf7?= =?us-ascii?Q?NqmJK31zs3nbbn+wC5LUuefZpNnFX2C8L2lbpSmDBpxbl8Azk1eFHZKmII6Q?= =?us-ascii?Q?2f70cgmBmcXFZdFUTHEg1THDwb8uxhun9jfvPbet40KafjAhz0G63Gl3zYcT?= =?us-ascii?Q?drIbWOKvaZWME+xOs3LlPpXpdBlc6YXRfxdWFx/RDAFFGH9ZRNhaemUXnnnP?= =?us-ascii?Q?dZF2RDh5je7rZpud0ak1mzP5PXocDYT9bAOts7dA9V7dq4K5OJqUAB83L01Q?= =?us-ascii?Q?rtJL4L03SEXGKOVMJhMjLOYbiss=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:14.6311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2a726e3-d276-465b-7e59-08de593207ca X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7087 Content-Type: text/plain; charset="utf-8" Customers have identified an issue while using the QoS resource Control feature. If a memory bandwidth associated with a CLOSID is aggressively throttled, and it moves into Kernel mode, the Kernel operations are also aggressively throttled. This can stall forward progress and eventually degrade overall system performance. AMD hardware supports a feature Privilege-Level Zero Association (PLZA) to change the association of the thread as soon as it begins executing. Privilege-Level Zero Association (PLZA) allows the user to specify a CLOSID and/or RMID associated with execution in Privilege-Level Zero. When enabled on a HW thread, when the thread enters Privilege-Level Zero, transactions associated with that thread will be associated with the PLZA CLOSID and/or RMID. Otherwise, the HW thread will be associated with the CLOSID and RMID identified by PQR_ASSOC. Add PLZA support to resctrl and introduce a kernel parameter that allows enabling or disabling the feature at boot time. Signed-off-by: Babu Moger --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 2 ++ arch/x86/kernel/cpu/scattered.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index d3eb21e76aef..4ce3a291cd68 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6325,7 +6325,7 @@ Kernel parameters rdt=3D [HW,X86,RDT] Turn on/off individual RDT features. List is: cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp, - mba, gmba, smba, gsmba, bmec, abmc, sdciae, energy[:guid], + mba, gmba, smba, gsmba, bmec, abmc, sdciae, plza, energy[:guid], perf[:guid]. E.g. to turn on cmt and turn off mba use: rdt=3Dcmt,!mba diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index 57d59399c508..0c3b44836cfe 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -514,6 +514,7 @@ #define X86_FEATURE_X2AVIC_EXT (21*32+20) /* AMD SVM x2AVIC support for 4= k vCPUs */ #define X86_FEATURE_GMBA (21*32+21) /* Global Memory Bandwidth Allocation= */ #define X86_FEATURE_GSMBA (21*32+22) /* Global Slow Memory Bandwidth Enfo= rcement */ +#define X86_FEATURE_PLZA (21*32+23) /* Privilege-Level Zero Association */ =20 /* * BUG word(s) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index cd208cd71232..2de3140dd6d1 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -834,6 +834,7 @@ enum { RDT_FLAG_BMEC, RDT_FLAG_ABMC, RDT_FLAG_SDCIAE, + RDT_FLAG_PLZA, }; =20 #define RDT_OPT(idx, n, f) \ @@ -863,6 +864,7 @@ static struct rdt_options rdt_options[] __ro_after_ini= t =3D { RDT_OPT(RDT_FLAG_BMEC, "bmec", X86_FEATURE_BMEC), RDT_OPT(RDT_FLAG_ABMC, "abmc", X86_FEATURE_ABMC), RDT_OPT(RDT_FLAG_SDCIAE, "sdciae", X86_FEATURE_SDCIAE), + RDT_OPT(RDT_FLAG_PLZA, "plza", X86_FEATURE_PLZA), }; #define NUM_RDT_OPTIONS ARRAY_SIZE(rdt_options) =20 diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattere= d.c index 62894789e345..4c98c8c5359f 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -61,6 +61,7 @@ static const struct cpuid_bit cpuid_bits[] =3D { { X86_FEATURE_SDCIAE, CPUID_EBX, 6, 0x80000020, 0 }, { X86_FEATURE_GMBA, CPUID_EBX, 7, 0x80000020, 0 }, { X86_FEATURE_GSMBA, CPUID_EBX, 8, 0x80000020, 0 }, + { X86_FEATURE_PLZA, CPUID_EBX, 9, 0x80000020, 0 }, { X86_FEATURE_TSA_SQ_NO, CPUID_ECX, 1, 0x80000021, 0 }, { X86_FEATURE_TSA_L1_NO, CPUID_ECX, 2, 0x80000021, 0 }, { X86_FEATURE_AMD_WORKLOAD_CLASS, CPUID_EAX, 22, 0x80000021, 0 }, --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010054.outbound.protection.outlook.com [52.101.201.54]) (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 13F4D42981F; Wed, 21 Jan 2026 21:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030072; cv=fail; b=ufdpk0DCbGNAl649+0/BfbDVo+b0cWLL4FdZ/+kuDlBlg2M381/C25Cg2I1DYn3ScxoeMtSTz/uGpJNyosPaBA1oJO2xgLOdHfruCPxQ1HNEksvQfML+pk8vqMmjWpNml3E8cleUVXXTlikRcmp6aWUPHIbPRgnHY8R0YgB9DGo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030072; c=relaxed/simple; bh=PgHKmuMwt+Y+Mlj8hjAqMjZpHkoYPZpHwXeCvJqrTQo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UuT2asRp6Hb7ymqZb5Ep+ykaIs662BtzgVjCvIP1zgYc8KM/IxfJUoDaUTLdrvSxPDbDdiv6M6CMhQW0lIvgUQAsEJrBIDhfG6FTZriv9jzqnTxstIvHzEpGoR/dxhuC6kvbRpfsCf/1CwAMTDvFuUklU8+/Y34RtaNNDUh0LTU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=uLwtJDHw; arc=fail smtp.client-ip=52.101.201.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uLwtJDHw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YY9PJoTC4A69Qnuv3nCt9dYD+0ZIl3Mp+B1um5csZ7aKQBrP+n0Fuwoq8JUkPc6S2ASWU60tIm4zRCD0y9prYspNAdauklLeJl46P/PweUU5Z3duE0E4KyL4y82rRjsaO+cRJFCGTqnjs2TdUu04Fp4xHlKdQd+mnhShAeV8cm45V6gn5lYQNFu4+p3ly74GjuVbHBsgAczIkGj0v7nv1Kd4LnhoQNp/NbcudIXYxcYmk7gsxjqSE99EW5Fa4rVEA0VvXqCbLkF1tehRdX+KuHT5nWMkltKNA+E+hyep/JcpIV96rkH9w+EW6s+aF+vE/AylkdP8ljrez4Fb1DRzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=drOkolsyZ4dJEEQe+0KW7qcNf6Mf95gudj4fYUzDYLU=; b=NhE2dYQq+Qnsus1UiBf8t2W9hh1shqtIzGe7xmpwIUQyLys2AE7yqSIxtHGcF0+enX/ORMMkpQBwqQLdEJFTWNx9fyU+7iNP0h8PTRnKV065MLpfOTUQU8E5CnpHT4X3oSlY3WmiHOwrYcy9RZE+NTruigOhaDAd0PtmeIAgUyB0HlESE0Ni/CCWqdYxz7xR7yfqrfrzmS6b3gn1rUTHkZ4e7ccAgoGUR3kq2TSuIgen3csvKlKDLQGFIEYnVCpqiYvTKW9MOsbpRVV8pV3RcaUXlc/uUc8suWFrlnVARkdx2U+MRwJNhQPCsEM/UWdQOJiGtGmeif/eqZNqaW+cSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=drOkolsyZ4dJEEQe+0KW7qcNf6Mf95gudj4fYUzDYLU=; b=uLwtJDHwKPyXIfzB0riu198NfT0s9tuQBx9uOeOecYZdTDBtlKZNSnwIVKhm7buawcf7GRqrfyQJVUquLH4JwfJyr6TkPjoJofvNTv2ljfYT4TnPrJkbjodrRFhUX6gDoRWuseo4jCf+EA3K8xCQWpT/96bqzMZzYKq+y/LXbeU= Received: from BYAPR05CA0072.namprd05.prod.outlook.com (2603:10b6:a03:74::49) by CH0PR12MB8506.namprd12.prod.outlook.com (2603:10b6:610:18a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.10; Wed, 21 Jan 2026 21:14:24 +0000 Received: from SJ1PEPF00001CEA.namprd03.prod.outlook.com (2603:10b6:a03:74:cafe::24) by BYAPR05CA0072.outlook.office365.com (2603:10b6:a03:74::49) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 21:14:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CEA.mail.protection.outlook.com (10.167.242.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:20 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:15 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 09/19] x86/resctrl: Add plza_capable in rdt_resource data structure Date: Wed, 21 Jan 2026 15:12:47 -0600 Message-ID: <7b7507eac245988473e7b769a559bd193321e046.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEA:EE_|CH0PR12MB8506:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c80da5f-9d8f-4210-9a12-08de59320b5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8bHj3o1YgNWnQgdEPFebdqpmKzvk8TjQ8EQQ1XnJDGVA/n4/kqZtBYZyBw06?= =?us-ascii?Q?ESXmQJtHQrY3oiCPLNfbU8K9DRIoXjNww9rFRn4yG7I5Xb85sGE2jFcjeLaw?= =?us-ascii?Q?R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U85r5uf2LP?= =?us-ascii?Q?ZlMf82IoPb1N3uo6WP5aZ9dllKfOW2kyJ8zyDfeI/QBByunrhFtR89bOHXrO?= =?us-ascii?Q?+wP/mpMc4Ez6HKPF/IRvrYjKGUvx70NHRXQzXQxHFtQELgF+z6RJ9t8NAmT3?= =?us-ascii?Q?d140Vr/j2uxaR59cRq6Vtdv+gkBjamQCkjCNxzfQTP/J053h7FqkjNqInpaw?= =?us-ascii?Q?9bc/dL1rXYsYRtZzKA5N1g48Wu071bw9140qtJLwfGdNsPEwe1VLMcPgrehn?= =?us-ascii?Q?xW9fElhALe5F9Ugvl04sVccpV3cCG5ZBrpOo8eBpyx69CPz/9kKUDmZXl9rq?= =?us-ascii?Q?CavVhtfxcUgrySHc3+jnKH0OUCAkprBGjtBZHMvukDCI5SzGXXpzKfknnxWt?= =?us-ascii?Q?a8yctVtWQWh1fZ/7gB/EFjr5zBEAqts3eZ/yw1L5yCWA64uAFU8ZDgMcxg1J?= =?us-ascii?Q?wa6MWUprCE07aBYRbjDmLKFjPK5XPR70gbkCtXmBtmjOsnmikKPyt3NjpDXC?= =?us-ascii?Q?tXUkV6qpL8E6IK3Psx+SuyTdUZx1jBBZCoq169Shk19QFaZzQYe/pOgPtLhr?= =?us-ascii?Q?OmKmUUUeHTYo2zGrRZvk7UXVEgrTvtSRAueFS5rQvxKjuSH7/rqZEih9WjOl?= =?us-ascii?Q?W2vYiAecCQCNpBEhIrN8XgbMSSnfUl0vmNlwMh1nPpaNhoErKpO/izVqYXWR?= =?us-ascii?Q?g60Rsx/xhd6zWio6/+qGONLOnF4=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:20.5961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c80da5f-9d8f-4210-9a12-08de59320b5c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8506 Content-Type: text/plain; charset="utf-8" Add plza_capable field to the rdt_resource structure to indicate whether Privilege Level Zero Association (PLZA) is supported for that resource type. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/core.c | 6 ++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 5 +++++ include/linux/resctrl.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 2de3140dd6d1..e41fe5fa3f30 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -295,6 +295,9 @@ static __init bool __rdt_get_mem_config_amd(struct rdt_= resource *r) =20 r->alloc_capable =3D true; =20 + if (rdt_cpu_has(X86_FEATURE_PLZA)) + r->plza_capable =3D true; + return true; } =20 @@ -314,6 +317,9 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt= _resource *r) if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_INTEL) r->cache.arch_has_sparse_bitmasks =3D ecx.split.noncont; r->alloc_capable =3D true; + + if (rdt_cpu_has(X86_FEATURE_PLZA)) + r->plza_capable =3D true; } =20 static void rdt_get_cdp_config(int level) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/r= esctrl/rdtgroup.c index 885026468440..540e1e719d7f 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -229,6 +229,11 @@ bool resctrl_arch_get_cdp_enabled(enum resctrl_res_lev= el l) return rdt_resources_all[l].cdp_enabled; } =20 +bool resctrl_arch_get_plza_capable(enum resctrl_res_level l) +{ + return rdt_resources_all[l].r_resctrl.plza_capable; +} + void resctrl_arch_reset_all_ctrls(struct rdt_resource *r) { struct rdt_hw_resource *hw_res =3D resctrl_to_arch_res(r); diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 63d74c0dbb8f..ae252a0e6d92 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -319,6 +319,7 @@ struct resctrl_mon { * @name: Name to use in "schemata" file. * @schema_fmt: Which format string and parser is used for this schema. * @cdp_capable: Is the CDP feature available on this resource + * @plza_capable: Is Privilege Level Zero Association capable? */ struct rdt_resource { int rid; @@ -334,6 +335,7 @@ struct rdt_resource { char *name; enum resctrl_schema_fmt schema_fmt; bool cdp_capable; + bool plza_capable; }; =20 /* @@ -481,6 +483,7 @@ static inline u32 resctrl_get_config_index(u32 closid, =20 bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l); int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable); +bool resctrl_arch_get_plza_capable(enum resctrl_res_level l); =20 /** * resctrl_arch_mbm_cntr_assign_enabled() - Check if MBM counter assignment --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013070.outbound.protection.outlook.com [40.93.201.70]) (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 3E27A43C062; Wed, 21 Jan 2026 21:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.201.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030076; cv=fail; b=jVgrWaI87b8AlWk11WUR/yCm3zwoxddCv/qYIDW7vdG3sJxHhSw1RBqe2C6UzmFJBKUweG4p6NTsS51x9OCZYgY5BHQvRSdMfjApISXU3qp/JfjplBilINd4K2C0CuVBjQO/ftYfG6oxiv20TCeKZxyL3JGttR/6Pkiz0IXWts8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030076; c=relaxed/simple; bh=orNwuItCWADF6E0D0iaknm1rgFmTybCQtft+Vl8k/yY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OyYNzT3drzvYkxLr6pYu7UNOw7WASuSTKkbWvwfhIaRcVL5V/AcmFZUnE9gVPbv5FobvaCqKGLNUsoxG+XWTKhEhPKlEKmXjagsFH7HoAnXVMCkO4GD8Yntnsm3u0wREHKQ9V87jGsxPQyVxdjUhC0f4IWr0UcOr2MwDc7a2Ung= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=xzHyh860; arc=fail smtp.client-ip=40.93.201.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="xzHyh860" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vIJ83KMuWDVeMmx78I1Qe0dzvG/Znlxe1crx95uuEuNFWAwXYZGSz4nbip8wbYAdlJi5lgizwM3SJ+lk1ofUktvKnKQ9X/ONKLNTYFg1uQu5q9dQ2FNjmgaImIn2AybGzAujXcJTOv1U2RyLFaEeoGLlELgpQ5T4Jpaxh0tmLtHTEC+q+n+reIGhpyJF9KgiIKM9KMVsyU1KHabJwut2MaZ3La/Q2UQS3Cmj1dEEaPjxa6KigmPW1f7/NXMfvyJbEwL6qY0JlVEhQzYbxeSH+Lk1bRvO19N/87H5EJ8AmYQaD0CouDiYZiAE2Urc/bUlzcPxYOYSMoQfYEu+fk6rqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=adzOeOoQgK9iMFAQldtCXZy2aHut5huQ4S238nNfzao=; b=fLJNejtuWySpGq9A6yaHFYGcXpToq5JeY2VQoVpqtMYaF10pK1spiks/8gsVJ3dSQU0GvMvT5dpzwg8YvS5Ovl095n52Ap20K680/8ZQnWUPvtjJ7tWcoz8XUXLlf9aRXL+iMgsulxB7YmWrwKo8lhKZLmZQoEU0Baj8QcbjDneW76vQdRW4wjDOa+yYcKfs6qV01hFIJvH+akDeC4Wz+dnVdClEnSXrnOqZn2q0MsD6RIY+xAQgwymUPvh+gYIaXSOLIKeDzXtvPRbimoGfiQRhwuye/ra/D8b+apKZAfPFDBbglkB30gj9LTFnWIJUG4YFC+merMr+yM8H9hs4qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=adzOeOoQgK9iMFAQldtCXZy2aHut5huQ4S238nNfzao=; b=xzHyh8608G8Fhk+MaOcjVGdLUyRZw7IPpOX/Fs5OZH9rQ8hOCiJ9eaO5AShBy1F/sbpZgWkKETqan3AeBaGVxG90niqaaeC7AGpPclW8lKAkanYT1dkQvqeknqGGQPsjikG2/9KEZbx+bu/0Slutvr4L+ASYqP1dyX8s2ysv9cM= Received: from SJ2PR07CA0001.namprd07.prod.outlook.com (2603:10b6:a03:505::11) by SA3PR12MB7879.namprd12.prod.outlook.com (2603:10b6:806:306::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:14:28 +0000 Received: from SJ1PEPF00001CE4.namprd03.prod.outlook.com (2603:10b6:a03:505:cafe::69) by SJ2PR07CA0001.outlook.office365.com (2603:10b6:a03:505::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:14:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE4.mail.protection.outlook.com (10.167.242.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:28 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:23 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 10/19] fs/resctrl: Expose plza_capable via control info file Date: Wed, 21 Jan 2026 15:12:48 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE4:EE_|SA3PR12MB7879:EE_ X-MS-Office365-Filtering-Correlation-Id: e26cb46b-441c-4e79-ea59-08de5932101d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jDAHvxjfX1vIAe2EiAZAe19BXiEq1V+jUuWerRoPEWk2c21f3bm7u3kIc/ke?= =?us-ascii?Q?onKCJn3CwLxK9Xx9b7JBQNe2t+fXrmWEP4YTuyDN0GtWKq+VYDh4U+hLhd0k?= =?us-ascii?Q?TBpnIT4r+gUSm5CsYp2bQfiwRzazXsY0TE3ZgXQwmFZwuK1lpuyvEUfAubS6?= =?us-ascii?Q?VJH4oCmSIBM9+hDwiaabOgWm6+tRWrWTmFR8Bmbd9YsEMzHavO827VRNjz88?= =?us-ascii?Q?5tGbtI446ljkn0A5bKLQ5JjFgdDYk3dl4VsbBuCtd6rgJLkCxj5xSeIgDG7K?= =?us-ascii?Q?VZxuj0iszQ+g5nz/mBUYjZ/AkXkAPCn7DIZhJWddMWDF6reblcvEkI+SSSI/?= =?us-ascii?Q?F0VqI93x4Qv89dZmmlV9v+zoo4NmqwySa1RCCHa0oW217K7aQujqQkQHWnkQ?= =?us-ascii?Q?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frUhncV?= =?us-ascii?Q?swWkocb2+3cbidqAdqGcNklEl7Sa+YY3ZYDxdAcov8QeAN97rtiStOvJ7MB2?= =?us-ascii?Q?itx2WfZDBGT7udiKfjOmEpIGz6PBFv/cB6kChIpHt61/YEP8+AT5pgL63NoC?= =?us-ascii?Q?AYEqLkN30PUXeTvSvUXoJ4gTkTuCGpRoXa3NOfYWkJDZpTUaafss8o3m0bP3?= =?us-ascii?Q?ANAyjQa+FClLKvSKNjz5kyMDA7ZjWpEjIuHMLl+dlatWQYqxpN6VM+N8Iyka?= =?us-ascii?Q?bnh9x13Qz6mikdgTZFEZ1wecyHV7Uuo5Rd9TgVMdNajV+KlqI4mREcFvh9S3?= =?us-ascii?Q?IQwJhc7UKNltN4yUEN73XvZR8RZznXiBvHJwV2AI3G3u8s1xwOZOkkv70631?= =?us-ascii?Q?7rBoRPTJ62JmM2TrlHpHaLPkiko=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:28.6021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e26cb46b-441c-4e79-ea59-08de5932101d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7879 Content-Type: text/plain; charset="utf-8" Add a new resctrl info file, plza_capable, to report whether a resource supports the PLZA capability. Allows user to query PLZA support directly through resctrl without having to infer it from other resource attributes. Signed-off-by: Babu Moger --- Documentation/filesystems/resctrl.rst | 17 +++++++++++++++++ fs/resctrl/rdtgroup.c | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index 3d66814a1d7f..1de55b5cb0e3 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -30,6 +30,7 @@ ABMC (Assignable Bandwidth Monitoring Counters) "" SDCIAE (Smart Data Cache Injection Allocation Enforcement) "" GMBA (Global Memory Bandwidth Allocation) "" GSMBA (Global Slow Memory Bandwidth Allocation) "" +PLZA (Privilege Level Zero association) "" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Historically, new features were made visible by default in /proc/cpuinfo. = This @@ -151,6 +152,22 @@ related to allocation: "1": Non-contiguous 1s value in CBM is supported. =20 +"plza_capable": + Indicates the availability of Privilege Level Zero Associa= tion (PLZA). + PLZA is a hardware feature that enables automatic associat= ion of execution + at Privilege Level Zero (CPL=3D0) with a designated Class = of Service + Identifier (CLOSID) and/or Resource Monitoring Identifier = (RMID). + This mechanism allows the system to override the default p= er-thread + association for threads operating at CPL=3D0 when necessar= y. Additionally, + PLZA provides configuration capabilities for defining a de= dicated resource + control group and assigning CPUs and tasks to operate unde= r CLOSID + constraints reserved exclusively for PLZA. + + "1": + Resource supports the feature. + "0": + Support not available for this resource. + "io_alloc": "io_alloc" enables system software to configure the portion of the cache allocated for I/O traffic. File may only exist if the diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index fc034f4481e3..d773bf77bcc6 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1260,6 +1260,16 @@ static ssize_t max_threshold_occ_write(struct kernfs= _open_file *of, return nbytes; } =20 +static int rdt_plza_show(struct kernfs_open_file *of, struct seq_file *seq= , void *v) +{ + struct resctrl_schema *s =3D rdt_kn_parent_priv(of->kn); + struct rdt_resource *r =3D s->res; + + seq_printf(seq, "%d\n", r->plza_capable); + + return 0; +} + /* * rdtgroup_mode_show - Display mode of this resource group */ @@ -1991,6 +2001,13 @@ static struct rftype res_common_files[] =3D { .seq_show =3D rdt_delay_linear_show, .fflags =3D RFTYPE_CTRL_INFO | RFTYPE_RES_MB, }, + { + .name =3D "plza_capable", + .mode =3D 0444, + .kf_ops =3D &rdtgroup_kf_single_ops, + .seq_show =3D rdt_plza_show, + .fflags =3D RFTYPE_CTRL_INFO, + }, /* * Platform specific which (if any) capabilities are provided by * thread_throttle_mode. Defer "fflags" initialization to platform --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012047.outbound.protection.outlook.com [40.107.209.47]) (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 4DB8F42981F; Wed, 21 Jan 2026 21:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.209.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030085; cv=fail; b=gJABeeKyDxXWe8EnjVKCJaWjUAWRr/TmX4hG7+jr+VNuzNJD99vqPm9sE8X6no0sczCE1MhaFGavxVcp+kRSShqBYyw3SqbotZZOIZrz5CV5yc8kDlgogFyYxuL2nbjcf4B91C7KwiaofsVCcv0KmWmnNjQFv1Ebh2nL3OJ2Wfc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030085; c=relaxed/simple; bh=keyDIbB+DsOToFMczIvTaElavnVua322jVgPdVzNT18=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YswOuQeFVNdhJ2lk01y4RhFB5lIifC6Jsu8ZVlG7kuLi1TwXAT0tRoRtvlNvpZHtfiphbeyKvBL5vXUH/rzgkwM5zAvfOnlzda/m0v65tyD4AouZdZQSt8fyNtvvFN+OEqaqQsgGQWuseHkAMNZwUITRXtAnt56hVqNlH7DylR0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=OQo8KIfF; arc=fail smtp.client-ip=40.107.209.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="OQo8KIfF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q2sSsER0Pizz/XHOJ4/vDNd9r9JVYodDyRsKm03icPfh86NINKUqXTuAK7b6+eWKJnZIGxDf/JwRG1iy1I4HXuRtUWFH5YqexA7k72dBC7fQZPb5WKATkcJOnbrUfidKnyy1RGAx+9iK1MpbFbF7aSVKDFc+bBxaqaLnKROFAcPfE+21av2LZ25hJbsQT8rediM8B6GT8TrEHY6kNncj9kjOvsqnnLzs8LD2cn8mvXvTlDWz1BbA8ivydQPYKx/i5idQpm2AIK2sZIehE7oBnOF/snH1moLbOM57ybgveqR4zfCWsAgfpdLQtqUmWSDq7WVGtPIxTap5hweDn84uig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j+f5Aju4xTRtSE1hOox5BhFE0A3pz2SwFoszUzV9hMw=; b=fh6TKEOom61ymDIPrVVaUs9qaRqhaZl8Lg4sw3ycHT4kmJmYohhLxOHB9DpfAonyHSGkdk3U8LLXDEA34R9va//5eMIMQDvZ+gGPNY+nS8XuE4soWvttcvPjnrDsXfisrK1BAyd5JS6TyILZ4/KFw2r0RklRnMlSnDzoDWHrfF1zhlzMPSHy69z/A0UNJTK9wABc+eS4t4Ur4rLoboGFuY9VPfrMDmRCyzQF6uyXnBm9+mkdh/2MVAZyYyoB2Dymta3is9JhbTLx9Ex9kB3MjSy/bAWJDxosYfBvnWH9oN8qIUPbreNPrapL2KFxPeo1Sn43bZIjQoglWG+j14YKsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j+f5Aju4xTRtSE1hOox5BhFE0A3pz2SwFoszUzV9hMw=; b=OQo8KIfFLvjYFxbpyhBqLygWSbC3EJqG5z1CAG9ow7cq9iIzftfQsO4HO6pDSJF2hK4OnpaZqbO5RdBbsrAA7pkTUgmVxxjuIMhV69xr2M20nHB6zDBnk4CtqfWdNOC4ihyuKXol5G6DuClzzuMRg6GnntDxJ4QOJPFHIWzIYBk= Received: from SJ0PR05CA0047.namprd05.prod.outlook.com (2603:10b6:a03:33f::22) by PH0PR12MB7905.namprd12.prod.outlook.com (2603:10b6:510:28b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.11; Wed, 21 Jan 2026 21:14:37 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:33f:cafe::83) by SJ0PR05CA0047.outlook.office365.com (2603:10b6:a03:33f::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.8 via Frontend Transport; Wed, 21 Jan 2026 21:14:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:36 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:31 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 11/19] resctrl: Introduce PLZA static key enable/disable helpers Date: Wed, 21 Jan 2026 15:12:49 -0600 Message-ID: <4269529e1623128265ad2ee9915ab5e653b156b5.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|PH0PR12MB7905:EE_ X-MS-Office365-Filtering-Correlation-Id: b35324e3-c5fc-4a4b-ec4b-08de593214ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?D4gde3QbqcD6hepsTzpkYgfnFX9JbqJN7uvE+7VdIfIB+so3R9YiqZz/CNA1?= =?us-ascii?Q?GAxtYo9ppBRocsvCFTGaUFep4Mda14ZW9SXICTxaFqcdioDmuzHcMapzXFrJ?= =?us-ascii?Q?e5pJPCBu+nBv8kRtbkzAOGtKGiSU9+e6F7XmtDaR85EsBZlvGGOU5W7F4DDx?= =?us-ascii?Q?uT0z0JfDEmpuHzHRnPRD2RY66CkfgCyHgKfRxA6wkRSGEYzi64dK7NO2W3+x?= =?us-ascii?Q?neLoUaoAvCT4qxAJXpN58jrXfNfKwvetnw1UQJ/n7Lh16cy/5Wdc4M2SExN3?= =?us-ascii?Q?bTYkyLvlEqMI1Esg/kWs6dIKsk9UhECWB/Rrms9Mj5mTmyecPFW5KJ5hMjA5?= =?us-ascii?Q?tmaJzJiSRrQ8q1N4Yj2OPiA7y3HjEmFn+kSd3GArdTNPMJHY0Jie7cRr2vIv?= =?us-ascii?Q?fjz+LqxuyhmlhN/44cK2TnDScGwWpuARlNuKMP87bdl/f6rKDE01EAkuz7ts?= =?us-ascii?Q?XDGSRH0MY15zB3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=?us-ascii?Q?M22VWLj1YlB6uoWd1WlRIOKDDMc19yyB5/10mhWs14lO5TQNUbE+YVMQdeo2?= =?us-ascii?Q?946onGXMRlRn3hGp3dw10uWM5Gm3WSRqatwTTZHmJNViIpA9o+DqPkG/lpWc?= =?us-ascii?Q?zx9vuVnuV1hGziHHxqOXjArMf7QXjFJhsH81LDusxr+HaXkCWcmELlVI2cul?= =?us-ascii?Q?1T5R2g2bfCyEbGyqbp5j7zbcskTuJE2CzvD2+PbPzaoesTYqycHBKCYLqKP3?= =?us-ascii?Q?2e4n1XgygEHt9/WdRpqgBvajhXyPwT98YFO2Ox4ipmpur2MdEQEFqzFtVe7b?= =?us-ascii?Q?nCJFTJzMi2Nzbqec1dZJVSuxG/I=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:36.6284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b35324e3-c5fc-4a4b-ec4b-08de593214ee X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7905 Content-Type: text/plain; charset="utf-8" The resctrl subsystem uses static keys to efficiently toggle allocation and monitoring features at runtime (e.g., rdt_alloc_enable_key, rdt_mon_enable_key). Privilege-Level Zero Association (PLZA) is a new, optional capability that should only impact fast paths when enabled. Introduce a new static key, rdt_plza_enable_key, and wire it up with arch helpers that mirror the existing alloc/mon pattern. This provides a lightweight, unified mechanism to guard PLZA-specific paths and to keep the global resctrl usage count accurate. Signed-off-by: Babu Moger --- arch/x86/include/asm/resctrl.h | 13 +++++++++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 ++ fs/resctrl/rdtgroup.c | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h index 575f8408a9e7..fc0a7f64649e 100644 --- a/arch/x86/include/asm/resctrl.h +++ b/arch/x86/include/asm/resctrl.h @@ -48,6 +48,7 @@ extern bool rdt_mon_capable; DECLARE_STATIC_KEY_FALSE(rdt_enable_key); DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key); DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key); +DECLARE_STATIC_KEY_FALSE(rdt_plza_enable_key); =20 static inline bool resctrl_arch_alloc_capable(void) { @@ -83,6 +84,18 @@ static inline void resctrl_arch_disable_mon(void) static_branch_dec_cpuslocked(&rdt_enable_key); } =20 +static inline void resctrl_arch_enable_plza(void) +{ + static_branch_enable_cpuslocked(&rdt_plza_enable_key); + static_branch_inc_cpuslocked(&rdt_enable_key); +} + +static inline void resctrl_arch_disable_plza(void) +{ + static_branch_disable_cpuslocked(&rdt_plza_enable_key); + static_branch_dec_cpuslocked(&rdt_enable_key); +} + /* * __resctrl_sched_in() - Writes the task's CLOSid/RMID to IA32_PQR_MSR * diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/r= esctrl/rdtgroup.c index 540e1e719d7f..fe530216a6cc 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -38,6 +38,8 @@ DEFINE_STATIC_KEY_FALSE(rdt_mon_enable_key); =20 DEFINE_STATIC_KEY_FALSE(rdt_alloc_enable_key); =20 +DEFINE_STATIC_KEY_FALSE(rdt_plza_enable_key); + /* * This is safe against resctrl_arch_sched_in() called from __switch_to() * because __switch_to() is executed with interrupts disabled. A local call diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index d773bf77bcc6..616be6633a6d 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2910,6 +2910,8 @@ static int rdt_get_tree(struct fs_context *fc) resctrl_arch_enable_alloc(); if (resctrl_arch_mon_capable()) resctrl_arch_enable_mon(); + if (resctrl_arch_get_plza_capable(RDT_RESOURCE_L3)) + resctrl_arch_enable_plza(); =20 if (resctrl_arch_alloc_capable() || resctrl_arch_mon_capable()) resctrl_mounted =3D true; @@ -3232,6 +3234,8 @@ static void rdt_kill_sb(struct super_block *sb) resctrl_arch_disable_alloc(); if (resctrl_arch_mon_capable()) resctrl_arch_disable_mon(); + if (resctrl_arch_get_plza_capable(RDT_RESOURCE_L3)) + resctrl_arch_disable_plza(); resctrl_mounted =3D false; kernfs_kill_sb(sb); mutex_unlock(&rdtgroup_mutex); --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010014.outbound.protection.outlook.com [52.101.85.14]) (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 4E47A43DA23; Wed, 21 Jan 2026 21:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030088; cv=fail; b=HaDtET5mfpNKKkovb7MeeuC/fJI1UC+8di1RauNTnyW80K9QhH/xcNIkhts2NynuZEDzLF2bfXyfo9G67k0og4Qme/3ri12wOMMHLld5wvvzDbCyDquktrE994s909zh0zqVUGeYkxy3A9DXvKwNF9qX3BY0MHT32TPCTnzYLl0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030088; c=relaxed/simple; bh=pQU9Ng5ohZjo4fDHiQ4O4Mg9BTXQjlizDbXF71QILJA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LF9n9gF4fUS5H1krS1sYie4vmXKQbH5ulInoSu6MBQ+qQx+jSAn573HY/4tBO/qedLltZFM5LM+RWMUuKkBgNDJcjf0uoYezA92z50zwR9tuDqq3tjTfRGDbQs449WVHYMdBqpfhfJfuU9huDk+6cMmPXtuAYeYBeZv/yiYdduk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=5n3U2/KF; arc=fail smtp.client-ip=52.101.85.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="5n3U2/KF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z5Ga3U7TpN2sKC6BoNuzCmJcP0nqofNbhI9pA4TFmR/BYQubzWxGZbwwz1ga8wyijqkXJsmetK8v9CJY9FQZ3yyH2nF6Tp2sXAn9xXF4tzUBu1bdvTDNK3Gl486VpxDBtDZZzymdaAm9QE/JXRu9CbI0sq+ElYE2xGHZ+5C+gzofx3e9uTH+1uqTe7bkFKPEiX+9JxyodbyPsrpKddDk4vN4EyzaPfH79SnLfjCgcTajcguW6EVCh+wWiymfDKUzLeilIZSelciySQXG8NGkF1Wl1BO/zM2AM2vxqdF2smsy/+Sael3VJGR3QJ09gNSuHoz9bFMU//MSo5C7fG58eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V8eR6qUZ5+T5NQSMqXaX94qahxXc8MlLikha6eBYjPY=; b=TokCmfif5+eKicH1CiYd87/ZT22RSB43WFdKBY4R4Wlhm86Rf5YhY41I5Wg7TI8aiYNPTDDe+8By9UwOW4jiojEnldZBwFFso6GAfNwjyd+Uxjv+9MwfICigr9pgYELM847xVdbDCSUhjVR3mVWLKAchTjUD6UkduaQkTb5V8ffltTYE6R5lLuLZaS84pGNOJdRyT8xhtab/syi9fkNQowXKvKl5Wty+uTReVeC/cM78nWh3R2/wit8XDvYZFPux0Y7LgrDSDcWJB5lTnfcVkMuG/PYSHQ4b92Or+2QcElFmBVrDQmRoxnSouneMxZLwlVIUVFT/ruHgetip9HJfaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V8eR6qUZ5+T5NQSMqXaX94qahxXc8MlLikha6eBYjPY=; b=5n3U2/KFMMTcDZmOUIfy441jHOOrj00qamw8C9fA4roEfzsrYMlgdid5Jq4M+cYvsxvQFMsTKQpw3I5f+tlwOp+SyqzwAKL4U4peptEBkC38Mq4JzZwVH3E0b0LlPXdDKIB+hmUaEOeindtrqfWXFwP+tahDf2yNY8Phylza4EQ= Received: from SJ0PR03CA0297.namprd03.prod.outlook.com (2603:10b6:a03:39e::32) by CH3PR12MB9344.namprd12.prod.outlook.com (2603:10b6:610:1c8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:14:42 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:39e:cafe::77) by SJ0PR03CA0297.outlook.office365.com (2603:10b6:a03:39e::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:14:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:42 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:39 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 12/19] x86/resctrl: Add data structures and definitions for PLZA configuration Date: Wed, 21 Jan 2026 15:12:50 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|CH3PR12MB9344:EE_ X-MS-Office365-Filtering-Correlation-Id: de3e4a57-0f33-4c9f-1dc9-08de59321847 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?j1lfl0XWBxelCqkQgiQW7XsnhmAsWXnY8pqSqV9xJLN7qENtZ1eoecUhdb1F?= =?us-ascii?Q?B/pL+J0N0CpjwFuEu2limWEuS6cGvEjGwGyjrtpM4Quhd9D/0Ie401FW6p9p?= =?us-ascii?Q?iSelj9t32IbXSKCZ7GGTcF+xscpQKl4cgkh0YkgxsL7arG66hZZsZzBxcUiS?= =?us-ascii?Q?/kbYbgWC9QhNOE71YgDqlSYeSLq0RhtXhvOJ2u0HEvEWd/S6LqWKTm2Qoopq?= =?us-ascii?Q?q/8AIz4L3yG+1y6RSAqET/odY75IgMtEGnbyCmhQevzQ7OBh4H4ik8R/0xS/?= =?us-ascii?Q?/MHQWNBpyMdrDMrowSH/EXsO7L3xOt6xP82Yb0nJqf9WmN3ZZfVBgXMkF7/L?= =?us-ascii?Q?n9rxluaCNJ/EVtCEyHv/oap97fUKZIsmNb3Xa5js8IjZTbFrO/TQw423AJo6?= =?us-ascii?Q?p9giTotbGv9IrYXt+3bJ/uon3u7UexRmV+qz/npZcSI5jyJlXwXTOFWqdniC?= =?us-ascii?Q?7dk5psnyYf3Ohi/5oAKz5CjTbPJMfNLeu57AnEsB3eASVLa0RNWa2UEKIxn3?= =?us-ascii?Q?ZWEXI+BXi26qOZhZQ569feNmtnW0Gt75eZ3cTAD4cJNQDZmUQIuKCWa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GIUzK8iF5sAM7HHA0pAhbRurbuEKR3Et00pJ2Jo6w/qb?= =?us-ascii?Q?ES+ti4N4zPns9FucTK9RvdzrhVEmOzFLUTHgrAZmCfunawDYhzfoHhFS6lFg?= =?us-ascii?Q?dqfTXrYN5f+nkHCpOxBfn9ggvnkr6pbud+64dg00fvmm8TEOyByeuKeISf1n?= =?us-ascii?Q?SnpM9rHMtrTyE/hLqME3TqMta33AYeUbqIC/GoIrijq2b+KaUHhZJR26i+HG?= =?us-ascii?Q?L5d07SFJ0kL0UI7VSiYrxo1DoR0=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:42.2661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de3e4a57-0f33-4c9f-1dc9-08de59321847 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9344 Content-Type: text/plain; charset="utf-8" Privilege Level Zero Association (PLZA) is configured with a Per Logical Processor MSR: MSR_IA32_PQR_PLZA_ASSOC (0xc00003fc). Add the necessary data structures and definitions to support PLZA configuration. Signed-off-by: Babu Moger --- arch/x86/include/asm/msr-index.h | 7 +++++++ arch/x86/kernel/cpu/resctrl/internal.h | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-in= dex.h index 0ef1f6a8f4bc..d42d31beaf3a 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -1271,12 +1271,19 @@ /* - AMD: */ #define MSR_IA32_MBA_BW_BASE 0xc0000200 #define MSR_IA32_SMBA_BW_BASE 0xc0000280 +#define MSR_IA32_PQR_PLZA_ASSOC 0xc00003fc #define MSR_IA32_L3_QOS_ABMC_CFG 0xc00003fd #define MSR_IA32_L3_QOS_EXT_CFG 0xc00003ff #define MSR_IA32_EVT_CFG_BASE 0xc0000400 #define MSR_IA32_GMBA_BW_BASE 0xc0000600 #define MSR_IA32_GSMBA_BW_BASE 0xc0000680 =20 +/* Lower 32 bits of MSR_IA32_PQR_PLZA_ASSOC */ +#define RMID_EN BIT(31) +/* Uppper 32 bits of MSR_IA32_PQR_PLZA_ASSOC */ +#define CLOSID_EN BIT(15) +#define PLZA_EN BIT(31) + /* AMD-V MSRs */ #define MSR_VM_CR 0xc0010114 #define MSR_VM_IGNNE 0xc0010115 diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/r= esctrl/internal.h index 61a283652d39..4ea1ba659a01 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -219,6 +219,32 @@ union l3_qos_abmc_cfg { unsigned long full; }; =20 +/* + * PLZA can be configured on a CPU by writing to MSR_IA32_PQR_PLZA_ASSOC. + * + * @rmid : The RMID to be configured for PLZA. + * @reserved1 : Reserved. + * @rmidid_en : Asociate RMID or not. + * @closid : The CLOSID to be configured for PLZA. + * @reserved2 : Reserved. + * @closid_en : Asociate CLOSID or not. + * @reserved3 : Reserved. + * @plza_en : configure PLZA or not + */ +union qos_pqr_plza_assoc { + struct { + unsigned long rmid :12, + reserved1 :19, + rmid_en : 1, + closid : 4, + reserved2 :11, + closid_en : 1, + reserved3 :15, + plza_en : 1; + } split; + unsigned long full; +}; + void rdt_ctrl_update(void *arg); =20 int rdt_get_l3_mon_config(struct rdt_resource *r); --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010056.outbound.protection.outlook.com [52.101.193.56]) (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 26808329C6B; Wed, 21 Jan 2026 21:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.193.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030107; cv=fail; b=uWNIpi+BIN582lj1mguYTO21BMfb10QBfg40heC9u2D9jtY1rvvd/pDAP86imyLoWjt5VazdDhvRxDN3fVMYs6nmodwOVQjOV6F1xryTxLeDReEUgQUgKhl4kVn+6w0x9Nr086zBBKvxiENyG+3kdbAkEdlFOTKiZ4XjKAXIW7s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030107; c=relaxed/simple; bh=oZ7xA6sc2cisryQ7y+JtO+Z5wZ9Xn8KqG892Zq7Pm1E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iYn0iJn5BOx+1peHnzNkrfc+nfvJ3THjUi9rot6kVcULBqFuglDvxaAaeNuBI+7+5GUSrhAzwWRffVRikUOuFfK71Ai8VCXupQ4/KhV9MBSzhvFr0Bnw5O2cSJMA5RPqeF+qM1lEK706/BYRlfxzkmEbT38OJHan2+sFezG4UiQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=OzJk1LfN; arc=fail smtp.client-ip=52.101.193.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="OzJk1LfN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ebBJLFHbG85ZrugWL+TEiKFWHan1WCGSEHap2wVqXtMyHzgAsF+qcsxgmd6sSZ23QTTO5EPcYO0dsLqoPC3+bNnZtI3vK/UmtOzaTuvlSGksW/ZIG27WbmBoBVlBYep35v7dSo5zqljp0+Kldm1fKFWus+s66I30Cb2o0inDWOQqf6TAe+CwHaWJ28a2kBrHRX+vgKa/MtQI86WWaRDJAKvE/lageOCKnyxuZvYopfBqN/mkpihX/1kXZIaTiyFYK6PvhSdpBexUif3kMZvL92ltVj2H8OlPwhRl2zx6Ltg7E+txh3BwOZWFChLdAVrazI1z9HI6CEWtNRDEaAMFQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9PC7edQFe39USyvVGw3hUVGB69g3g2zI7YfRZB+iWxc=; b=Y5O0BTwRHZn20w4KsZt3KAJ7Z44Q/SdDGhJS7hgZoOuRvUgCa7iNu9c3Zb2yR1qSDQtJHsFol/NX132wBTq/92kzmdpMXbC9+MPQm3IrlY5e/TICkM2qJz7LMDuWA2k5dyKMylA68v9iYfisF1l9wLoVVCoTcUGqFL9TMOifXs+NfnjIS/IovG9Y0iWXWjMVlHEmI11adEQZmAn3ReMdU2MQzV2HpIMWLSHfF+R8TftL6PlzTOZwA4vncQb3IRVe9WDhr2jKlq0OF238Ci9OY9HPbxHstJai6FkgHZrzz+7N8uB0lrj7Q7m0Fud7GovCQU0QiHkTW/cZerbYlgPoFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9PC7edQFe39USyvVGw3hUVGB69g3g2zI7YfRZB+iWxc=; b=OzJk1LfN/MkYnSwFkXWvg1gc2zDKPEkjlYK9nH3OH4BmTwjBon/8NeOtQlP64ii7lZSUzSg9N1J/0SzzZxfrvj4QkkC1dxKJ82qbA1boijmS4xVKY8c3eM465GGA1+EA3CX5MaPoAoSHtTFN62WkIWvxDYtvCvucpM8IIYpeqtg= Received: from BY1P220CA0007.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59d::13) by BY5PR12MB4099.namprd12.prod.outlook.com (2603:10b6:a03:20f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:14:55 +0000 Received: from SJ1PEPF00001CE6.namprd03.prod.outlook.com (2603:10b6:a03:59d:cafe::83) by BY1P220CA0007.outlook.office365.com (2603:10b6:a03:59d::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:15:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE6.mail.protection.outlook.com (10.167.242.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:55 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:47 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 13/19] x86/resctrl: Add PLZA state tracking and context switch handling Date: Wed, 21 Jan 2026 15:12:51 -0600 Message-ID: <17c9c0c252dcfe707dffe5986e7c98cd121f7cef.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE6:EE_|BY5PR12MB4099:EE_ X-MS-Office365-Filtering-Correlation-Id: e2d68424-17d0-4831-6bf0-08de59322030 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BHkjhDef0RJSBHghdJHiVyi9gM/IvfP8xggq9zt6QfFD/2TESeyCjLJJawLw?= =?us-ascii?Q?YEQYtAURtNvW+JHDqsfOWPC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= =?us-ascii?Q?GN5hjoKt5hDmzCGjWn15o52RggK4ZB1XCWi8mUKc2SCAoL5hhNVqiah07EXA?= =?us-ascii?Q?/kBgnpBlW75aj1AmIyRzYWvJfqEBfZpZrGkCk46cXLNXsBmKA+anj7XBivIh?= =?us-ascii?Q?LM/wdMIx8N/uGN2cGDdU25JoXBy/cTvO17crfJNnOkZt/sEyXodbNsrsb9Pr?= =?us-ascii?Q?x20/9HLCTzHEaqo3eOJJjmDDsgsM8jG44L55uTYf0955u072jtr6qrT9aa+I?= =?us-ascii?Q?TSCi99QOFN5u7kJdLLJsP8SsJuAe4RgTIOOl1rJkLXujG+448l08ggoh1aDa?= =?us-ascii?Q?k3QoZ1Vd5mFX4DC8WxTDUAg3xORhazc5Z4Lu1Aylocf3cdi1tBPlu94j7rhw?= =?us-ascii?Q?hbG5dYTMWUE9knwaRV3r/lNuhduujF5kZhnXv1IzUINI3FyrzlS6NUiuGuhQ?= =?us-ascii?Q?OF0w08L85cKOrfMUtrb55xR+T5d9AGVpfian80Ewt1tWIL0neARF7aSzW/My?= =?us-ascii?Q?aBkKOuBd8nM7zyEwLgE5gCiX6o0kcUwfwh29cBrJEGouu0f5A9HSVYTdls1s?= =?us-ascii?Q?19l4IbPLaGoCLbq4ghyV3/aAqL9eYeeWB2egGTzJkRAgDoUsC/6KistYAslW?= =?us-ascii?Q?DsyahVWzTqF0RSTYshI8zIKjP0VyBHaZ7mYhEoQhjhzOZxMkwyKnhi61sDjq?= =?us-ascii?Q?3LLMqvwx0f2qSLBffl9f5Y1KxFOwmPlkbE6OjqSfmHFghDE4YblKi9pDi0MF?= =?us-ascii?Q?3/o+1yxQPxTXoj+LXZ5/u2FHA1g=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:55.5382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2d68424-17d0-4831-6bf0-08de59322030 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4099 Content-Type: text/plain; charset="utf-8" The resctrl subsystem writes the task's RMID/CLOSID to IA32_PQR_ASSOC in __resctrl_sched_in(). With PLZA support being introduced and guarded by rdt_plza_enable_key, the kernel needs a way to track and program the PLZA association independently of the regular RMID/CLOSID path. Extend the per-CPU resctrl_pqr_state to track PLZA-related state, including the current and default PLZA values along with the associated RMID and CLOSID. Update the resctrl scheduling-in path to program the PLZA MSR when PLZA support is enabled. During the context switch, the task-specific PLZA setting is applied if present; otherwise, the per-CPU default PLZA value is used. The MSR is only written when the PLZA state changes, avoiding unnecessary writes. PLZA programming is guarded by a static key to ensure there is no overhead when the feature is disabled. Signed-off-by: Babu Moger --- arch/x86/include/asm/resctrl.h | 19 +++++++++++++++++++ include/linux/sched.h | 1 + 2 files changed, 20 insertions(+) diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h index fc0a7f64649e..76de7d6051b7 100644 --- a/arch/x86/include/asm/resctrl.h +++ b/arch/x86/include/asm/resctrl.h @@ -38,6 +38,10 @@ struct resctrl_pqr_state { u32 cur_closid; u32 default_rmid; u32 default_closid; + u32 cur_plza; + u32 default_plza; + u32 plza_rmid; + u32 plza_closid; }; =20 DECLARE_PER_CPU(struct resctrl_pqr_state, pqr_state); @@ -115,6 +119,7 @@ static inline void __resctrl_sched_in(struct task_struc= t *tsk) struct resctrl_pqr_state *state =3D this_cpu_ptr(&pqr_state); u32 closid =3D READ_ONCE(state->default_closid); u32 rmid =3D READ_ONCE(state->default_rmid); + u32 plza =3D READ_ONCE(state->default_plza); u32 tmp; =20 /* @@ -138,6 +143,20 @@ static inline void __resctrl_sched_in(struct task_stru= ct *tsk) state->cur_rmid =3D rmid; wrmsr(MSR_IA32_PQR_ASSOC, rmid, closid); } + + if (static_branch_likely(&rdt_plza_enable_key)) { + tmp =3D READ_ONCE(tsk->plza); + if (tmp) + plza =3D tmp; + + if (plza !=3D state->cur_plza) { + state->cur_plza =3D plza; + wrmsr(MSR_IA32_PQR_PLZA_ASSOC, + RMID_EN | state->plza_rmid, + (plza ? PLZA_EN : 0) | CLOSID_EN | state->plza_closid); + } + } + } =20 static inline unsigned int resctrl_arch_round_mon_val(unsigned int val) diff --git a/include/linux/sched.h b/include/linux/sched.h index 8f3a60f13393..d573163865ae 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1326,6 +1326,7 @@ struct task_struct { #ifdef CONFIG_X86_CPU_RESCTRL u32 closid; u32 rmid; + u32 plza; #endif #ifdef CONFIG_FUTEX struct robust_list_head __user *robust_list; --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013063.outbound.protection.outlook.com [40.93.201.63]) (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 F096143DA23; Wed, 21 Jan 2026 21:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.201.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030115; cv=fail; b=qeD++JiU6UTaiL+zUmeE8fJuVvNDP+q5jhDjxoJ8CpXelIsDIeTcDKRTbtOukwnNXAtTfr+9sltxDUPf5HVHjfmar5f6PQyjjm0m+/Cp7pIERd0zM10y4TcggPSP46Xu+lNLPi5Or1aGg2DU2BIxPwem1W/YYttCvhmpHol3Ne4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030115; c=relaxed/simple; bh=3XMYqlluCr+ocS+pMijk48E8n2FUoz4q12MDwtGFhC8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P4Rr9ogALapPKJX2T3zvh6TPgOnllM+KYLeSu65Pf6A3kErVT5G0u6F7ZzcAHl7uFQTvFAdJNmcBlklubK4/2/KAWEttgWS8oWxxea5lw0DJqEbPXey7RUZVlJN1dv8+JHn1FRwvtEEXX/fkKgwbM6n8zqciGFZs3lT7QuZJFzU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=1Qvp3QM4; arc=fail smtp.client-ip=40.93.201.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="1Qvp3QM4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ek5n88h2S6w+UlwABwpkYThCM+cpiD27E45TA7eZsiwrVE+p7Y/EWY9R9AMc/UGEgUNvAXlSgznWPLlUTuE0Sohe4s3xqEaAefqO4Gy1+8hY4lvWYaHZAcF9goIgjkB5aAXQIZsYdxD5pD9cR7j60eVrEinxShrTc806LajHQsHpgKNbJyqP3fmizjyf2+3J0UZc2MTFz4Ohs5eKrAgssUiPu8iXfyKcqVEXFCwPcljyo2Zs+TsyI5jAZapOwjAFz8BZZ3zNgJhDU/ocCt24s9z/LPuxG4JAv0K9+HtWzBm+EUY3C2ib5a5iC3oSpVrgfPunyvclFA/HrtVN9KT1FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xa6iMP1GyjrKHIDm3MbLB1uSe9wc5N0e7SmptiOSha8=; b=W6aiq2352CMfJrsViRqy7Y2XAOxs38AB/Ia3+TYGht3oMdM690+sD3cDoTgjXKbUNHBEuciLsiTsgH4hBHm0UdJP6+lDZSVqIYrh7e6s11qnvMbY0Mbtu0swYl1loljicNN8ycidrpNxgJ4ehqA1RrWg/IhvUnngAiIvBPOBz1Y7QmSfHworWVEBcIENLEIGD9ofZCg7mkeYIAIzsRDcpTShYmsacF6MQC/mff+f88JlQdhN3KXW3GPKzvBtZeNn14dBMoe2c5UXzYD8rfKSGhvU3yjd7BDBX9xz7sjWY2azjlsHBbtPkQgti9WNrWnN6UWBXbOkFZazWSgijr5Wrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xa6iMP1GyjrKHIDm3MbLB1uSe9wc5N0e7SmptiOSha8=; b=1Qvp3QM4eXGUgUoBwzoUkVW5VrQioNuoEBu9MCt4bbPwe+des8eSogXoHn36aNFhgSGFkLXriMJ+y8KVXBSlLZxsXreNe2vCceCC2LcMrOA8gkKRSzVTkpKNGDCPXXI/ysR2ZzyVqHgWsx+qZ+bDRyLhAiSdG618cVC7gLmot68= Received: from SJ0PR05CA0099.namprd05.prod.outlook.com (2603:10b6:a03:334::14) by SJ5PPFF62310189.namprd12.prod.outlook.com (2603:10b6:a0f:fc02::9a9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:15:02 +0000 Received: from SJ1PEPF00001CE7.namprd03.prod.outlook.com (2603:10b6:a03:334:cafe::b4) by SJ0PR05CA0099.outlook.office365.com (2603:10b6:a03:334::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.5 via Frontend Transport; Wed, 21 Jan 2026 21:14:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE7.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:14:59 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:14:55 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 14/19] x86,fs/resctrl: Add the functionality to configure PLZA Date: Wed, 21 Jan 2026 15:12:52 -0600 Message-ID: <84b6ec2a2b41647f44d6138bc5e13ceab3aa3589.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE7:EE_|SJ5PPFF62310189:EE_ X-MS-Office365-Filtering-Correlation-Id: 566b7534-79f9-4415-ceb0-08de593222b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Q1kprrINSyYkH44K3lik3DQOkcEAmj+4haG3zoePIV/Hgp0dxNTegG44Yp2I?= =?us-ascii?Q?YeTTKBCfAM8W8e3e3neQy6eoeUu7T2AWdFmh1cjlqzvSFg+rtGMSSERp9ufM?= =?us-ascii?Q?1jMo+EvLZYsJOVMuSEkTtbRK8pgckUP1DfM+nOpDITKEZbWS6Zm7RiWqgA3i?= =?us-ascii?Q?v5nWUE7ldXxQu1t6PyOe0cOS9brvjNOrCk6wvAnXi/VXGeyjs5vrh7ysk+wY?= =?us-ascii?Q?N/iPB78Yt/2t60TjYHEoF6vg9Nh03V+LcdLWEeEppUT2Jiqz1J2t5uRHJ5Fj?= =?us-ascii?Q?xHSvjkt4BnPWg5Y9/lMMVTyOeB9qNt6NuZcGzAqNxgi9S7kswA2Hz1gVN8Lq?= =?us-ascii?Q?3Y0d4IQ/o/0KAR2o48UVmq/TtaIxgk0N1uOUKDtHuruO3t8aEEh0FxBYxmy4?= =?us-ascii?Q?yRCv1XS3qrVKtyEnVSb4z1NITBW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q?pBm+8LaWxXMf9kJWZunyJMvsCezeNJgdFXK2hl14XXsLcVtnxAl3hlFTSyJX?= =?us-ascii?Q?3S7MQZYZ/0CEbldrlXrXDhJDLFmeIN+03bc6qtemyJNm/IJBUgsZLUPNYP/A?= =?us-ascii?Q?0sAFLm9AfAtr//bA5SoOmeuox8QKQlewxbE4qYFFrr2066QOWDw8hId9HgAP?= =?us-ascii?Q?birZOPe0FauX6Nc0oyKvEJ+iqsBgTSUjEd+7rc5GQ/XmggvqvyzAbaM4+gkA?= =?us-ascii?Q?IAzXu8oM2Cn787sROTBfhEsbU6/SLHZnTsE7oGObZxSCO2BK9k2T4yW0ThWF?= =?us-ascii?Q?Ulwi9laxktk6mY43nVr9EW7GVQwuE97Qw4gsSkZ6by/5rGNyBis95EAd8p1E?= =?us-ascii?Q?VcR1RedPV2lODbA/uqB9xtVTj7w=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:14:59.8209 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 566b7534-79f9-4415-ceb0-08de593222b9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPFF62310189 Content-Type: text/plain; charset="utf-8" Privilege Level Zero Association (PLZA) is configured by writing to MSR_IA32_PQR_PLZA_ASSOC. PLZA is disabled by default on all logical processors in the QOS Domain. System software must follow the following sequence. 1. Set the closid, closid_en, rmid and rmid_en fields of MSR_IA32_PQR_PLZA_ASSOC to the desired configuration on all logical processors in the QOS Domain. 2. Set MSR_IA32_PQR_PLZA_ASSOC[PLZA_EN]=3D1 for all logical processors in the QOS domain where PLZA should be enabled. MSR_IA32_PQR_PLZA_ASSOC[PLZA_EN] may have a different value on every logical processor in the QOS domain. The system software should perform this as a read-modify-write to avoid changing the value of closid_en, closid, rmid_en, and rmid fields of MSR_IA32_PQR_PLZA_ASSOC. Signed-off-by: Babu Moger --- arch/x86/include/asm/resctrl.h | 7 +++++++ arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 25 +++++++++++++++++++++++ include/linux/resctrl.h | 11 ++++++++++ 3 files changed, 43 insertions(+) diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h index 76de7d6051b7..89b38948be1a 100644 --- a/arch/x86/include/asm/resctrl.h +++ b/arch/x86/include/asm/resctrl.h @@ -193,6 +193,13 @@ static inline bool resctrl_arch_match_rmid(struct task= _struct *tsk, u32 ignored, return READ_ONCE(tsk->rmid) =3D=3D rmid; } =20 +static inline void resctrl_arch_set_cpu_plza(int cpu, u32 closid, u32 rmid= , u32 enable) +{ + WRITE_ONCE(per_cpu(pqr_state.default_plza, cpu), enable); + WRITE_ONCE(per_cpu(pqr_state.plza_closid, cpu), closid); + WRITE_ONCE(per_cpu(pqr_state.plza_rmid, cpu), rmid); +} + static inline void resctrl_arch_sched_in(struct task_struct *tsk) { if (static_branch_likely(&rdt_enable_key)) diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cp= u/resctrl/ctrlmondata.c index b20e705606b8..79ed41bde810 100644 --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c @@ -131,3 +131,28 @@ int resctrl_arch_io_alloc_enable(struct rdt_resource *= r, bool enable) =20 return 0; } + +static void resctrl_plza_set_one_amd(void *arg) +{ + union qos_pqr_plza_assoc *plza =3D arg; + + wrmsrl(MSR_IA32_PQR_PLZA_ASSOC, plza->full); +} + +void resctrl_arch_plza_setup(struct rdt_resource *r, u32 closid, u32 rmid) +{ + union qos_pqr_plza_assoc plza =3D { 0 }; + struct rdt_ctrl_domain *d; + int cpu; + + plza.split.rmid =3D rmid; + plza.split.rmid_en =3D 1; + plza.split.closid =3D closid; + plza.split.closid_en =3D 1; + + list_for_each_entry(d, &r->ctrl_domains, hdr.list) { + for_each_cpu(cpu, &d->hdr.cpu_mask) + resctrl_arch_set_cpu_plza(cpu, closid, rmid, 0); + on_each_cpu_mask(&d->hdr.cpu_mask, resctrl_plza_set_one_amd, &plza, 1); + } +} diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index ae252a0e6d92..ef26253ad24a 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -704,6 +704,17 @@ int resctrl_arch_io_alloc_enable(struct rdt_resource *= r, bool enable); */ bool resctrl_arch_get_io_alloc_enabled(struct rdt_resource *r); =20 +/* + * resctrl_arch_plza_setup() - Reset all private state associated with + * all rmids and eventids. + * @r: The resctrl resource. + * @closid: The CLOSID to be configered for PLZA. + * @rmid: The RMID to be configered for PLZA. + * + * This can be called from any CPU. + */ +void resctrl_arch_plza_setup(struct rdt_resource *r, u32 closid, u32 rmid); + extern unsigned int resctrl_rmid_realloc_threshold; extern unsigned int resctrl_rmid_realloc_limit; =20 --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010009.outbound.protection.outlook.com [52.101.193.9]) (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 2268D44103D; Wed, 21 Jan 2026 21:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.193.9 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030122; cv=fail; b=Xw6+A37FTUQUWIU5alZZMCK3oU5i0Wbau02RbvCmfvaGNM6hOl+QCWKPJcnegfZZ5viP0/oHh6WSGMMzrlW3HxaZTjP1ey/v4vgt8nCzPmNZwsDjfXwhBY8OdSib+msHO44j/h3VIDw4YqxAsUYMlbgrKLZEmzx3uPjsvGBAThY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030122; c=relaxed/simple; bh=eGIKTzYnjiO37skilu3SIkxRrYLkPxmtPcmYL8SIszM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YDHt5o5ODw6Cl3SN5DSankpBAj83+QNdt2wgsv89BoQXaAT9V5o/QX3rWp/+0GRrtfJ2zgXUtROypS/AHi71nGhsMkxlSr2A1l1jEVlt8Ug+aaq1E+3eoYUKKegVGT3x9fCaqI4bi+MuCK0ee9cDyKG/R0WV2HExwHiRY/xbeP4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=V+dBH7g1; arc=fail smtp.client-ip=52.101.193.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="V+dBH7g1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lRSE9+lxiNft4ZrYYz7ECiSOad8oNIm6VIPKxgmOOwBpv+s4y+eS5i2J45XNzAsFqSie7WHJyiSMgczl7RgaUZNo56AjJxEs+dJW7UagO7U/FzqAfxr4Gv60yoeO/AG4EjByV9f+SzP1C1DUhubkM7DaPzeo7ztcrUFGTmz8Gma/DO4RoAOlqVOm4gtkyd0OKg5R7gwZqFdhBo2JfEobdFIDxcn1DcGPn+ZRkdYKiwUaRcwGxCBYqJnSrlKo6jguSI9MjaHsbPmC8UElTJrOId3CKcNLm1rYXAlphvqBpdNdVoovGq87syFeSDi4PkeTR/Bs7g2F9XZvK0cpNESaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PrubP77xkMqumAI1ZVS+28jsLZdgm0R1CglheM0BNxE=; b=O5hs3E+7FvvLwIYUdhE5DLGthmTwxxtacgdk5Vc13MU9LBO0b1Nleprqv5LOca7Bf0Kx/oeJePJ4NuS/i9+PXtdki3X0oo4LgCAK/3V/r++qY9wE3wza+Y4confUlrv9BnZ2p/9qZTsfcAPCGvADVR+n7QBG3OuYDVJ/4YX0jwzm1EcFLUXJJeVBnrDtzDwqmYv8TztCvuAV3HD0TWlaH7yGP8t8wy31+H9rF5qZO+dQ2pN6htWKounvZ3Vy+dG93vhWwdqV03K6reOIj3cdlzfk807x8zfAwWKRi/fQW+opxrxvw3oY5DGclLvd5s1CAPCKiDZ9posqadLyZwyTGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PrubP77xkMqumAI1ZVS+28jsLZdgm0R1CglheM0BNxE=; b=V+dBH7g16Ld9L2Rp8KWWvYOHQ/4ZKn/mkqzxF3FM1e9oUqE4MbLUb0UQjSP2+httGtT4kE/VSzsMmbb9vVQILOQafGmhgH38U/uZvC9IyJPjT1ZkmIXqkXRqGMCQKVx8LeIlC0FwMQRO4u6D7K7o9i0OAfUuqbj1rrt5o9bBH+c= Received: from SJ0PR03CA0291.namprd03.prod.outlook.com (2603:10b6:a03:39e::26) by MW4PR12MB7310.namprd12.prod.outlook.com (2603:10b6:303:22c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:15:12 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:39e:cafe::61) by SJ0PR03CA0291.outlook.office365.com (2603:10b6:a03:39e::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 21:15:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:15:12 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:15:03 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 15/19] fs/resctrl: Introduce PLZA attribute in rdtgroup interface Date: Wed, 21 Jan 2026 15:12:53 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|MW4PR12MB7310:EE_ X-MS-Office365-Filtering-Correlation-Id: 10c5e9c0-14e5-4920-587a-08de59322a5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7nuDGagfVIekqSUpHrvhh74Sg3uRsIDp5qKcFv7UYUyMKQ4vQ4k7gtUEcrYw?= =?us-ascii?Q?Z6VVhUOIOfyUs3wCxS3bA8KvTIkkMadevW9GXb88DBFaeyiQyuUCMNsnLcDq?= =?us-ascii?Q?HzGelqGHnppx4jPAOA6CzeufulR/GEVTPHuIbd/IFBkl5678DPUUcfOAX7Pi?= =?us-ascii?Q?dTfwvsgSdmXRUOIFjGTVQeOStESbea613ekLAja3lTYMvH/TGu97HwDBfqZB?= =?us-ascii?Q?DgeL/FnjSS+x/UeVy82C3fHgSUMJgwuFXK8AMXvqwYcsrb9RYaLDr7qXn7DQ?= =?us-ascii?Q?RhBCWFuIeciMB26yPn5rtL1hnmd00+iy2WhzJryEpqHxDZniTLpK8+cfwBEk?= =?us-ascii?Q?cKbPHJv5xI70x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Q?= =?us-ascii?Q?d9S3ynbURKEM0meiM8FNzdejcs8ppK8xRcMXohbDaWmkOqtK152nfxHRBGll?= =?us-ascii?Q?VK83Qoa+5HL9cXhdrmnqhJlb38OXJ3eQj1ExJGY07RLj4xH4RQcwljDoraWN?= =?us-ascii?Q?q5KvBI2J3t5f0TxgSntJuHLLwI7pZNDlEREM19C+OSZa30DLdv0wYbdUB3Jk?= =?us-ascii?Q?k936N2wAEX9C9uEWEPL1zpcK550631R+daZ2b6oRt7aRc0wZGN2IGvjtamwl?= =?us-ascii?Q?i9oDSUTLolKhCvDGAVL3+en8cottikJPzaTLR7UvpNe3V1Qu6mGUQVeYahYZ?= =?us-ascii?Q?vILJn/2HtAIOBHFpYMlHwWkd8Yc4C/LjOyPqesHbqqRRKrFV+2xB0wjXu7fX?= =?us-ascii?Q?nFLaC2txk62/bTa8H5xr5D9EfVuxZBhjVSj9b3KFq3af6zV1FGMV9mTZBpY2?= =?us-ascii?Q?dtjSFg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(376014)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:15:12.5857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10c5e9c0-14e5-4920-587a-08de59322a5d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7310 Content-Type: text/plain; charset="utf-8" Add plza attribute to display Privilege Level Zero Association for the resctrl group. Signed-off-by: Babu Moger --- fs/resctrl/internal.h | 2 ++ fs/resctrl/rdtgroup.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h index 1a9b29119f88..c107c1328be6 100644 --- a/fs/resctrl/internal.h +++ b/fs/resctrl/internal.h @@ -215,6 +215,7 @@ struct mongroup { * monitor only or ctrl_mon group * @mon: mongroup related data * @mode: mode of resource group + * @plza: Is Privilege Level Zero Association enabled? * @mba_mbps_event: input monitoring event id when mba_sc is enabled * @plr: pseudo-locked region */ @@ -228,6 +229,7 @@ struct rdtgroup { enum rdt_group_type type; struct mongroup mon; enum rdtgrp_mode mode; + bool plza; enum resctrl_event_id mba_mbps_event; struct pseudo_lock_region *plr; }; diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 616be6633a6d..d467b52a0c74 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -880,6 +880,22 @@ static int rdtgroup_rmid_show(struct kernfs_open_file = *of, return ret; } =20 +static int rdtgroup_plza_show(struct kernfs_open_file *of, + struct seq_file *s, void *v) +{ + struct rdtgroup *rdtgrp; + int ret =3D 0; + + rdtgrp =3D rdtgroup_kn_lock_live(of->kn); + if (rdtgrp) + seq_printf(s, "%u\n", rdtgrp->plza); + else + ret =3D -ENOENT; + rdtgroup_kn_unlock(of->kn); + + return ret; +} + #ifdef CONFIG_PROC_CPU_RESCTRL /* * A task can only be part of one resctrl control group and of one monitor @@ -2153,6 +2169,12 @@ static struct rftype res_common_files[] =3D { .seq_show =3D rdtgroup_closid_show, .fflags =3D RFTYPE_CTRL_BASE | RFTYPE_DEBUG, }, + { + .name =3D "plza", + .mode =3D 0444, + .kf_ops =3D &rdtgroup_kf_single_ops, + .seq_show =3D rdtgroup_plza_show, + }, }; =20 static int rdtgroup_add_files(struct kernfs_node *kn, unsigned long fflags) @@ -2251,6 +2273,14 @@ static void io_alloc_init(void) } } =20 +static void resctrl_plza_init(void) +{ + struct rdt_resource *r =3D resctrl_arch_get_resource(RDT_RESOURCE_L3); + + if (r->plza_capable) + resctrl_file_fflags_init("plza", RFTYPE_CTRL_BASE); +} + void resctrl_file_fflags_init(const char *config, unsigned long fflags) { struct rftype *rft; @@ -4609,6 +4639,8 @@ int resctrl_init(void) =20 io_alloc_init(); =20 + resctrl_plza_init(); + ret =3D resctrl_l3_mon_resource_init(); if (ret) return ret; --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010011.outbound.protection.outlook.com [52.101.201.11]) (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 9E04B44105A; Wed, 21 Jan 2026 21:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030124; cv=fail; b=cmdjeVwPWbjzsXsv8f5MCKTg+Nz4hiHa9quibTItTuoXaOpEEth7TmTYIQjMAMY4aA9vJxVJT8Ebac66l0l3nZBvxy6LE87ZmBk1Horzyw/sdgszt/vw1ao20KJ9U1oObK6lpbzv0YAziwSRWd0C9bomOo8TDZ49iHqUW04UQR4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030124; c=relaxed/simple; bh=g9K/divpyNO0LVGbum73cgBwML/httOxdYj+9PJZwIk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jy6cIK1Hm9wg//ZeZ/Il9WSbN+qIXPrmCg+BOUwCq+e/JgsCtf4enHBDuf9onRp2EFxFnG171yY6yp3010fBPSpgIjq7OHRaNArJHWh3KqkNfgfwiuiYdyh4L4OSuaC+6hZUwzsdRjZdpay5f9sApp5eNbh09/3ubVkPcQqoLX8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=4PtGgm3w; arc=fail smtp.client-ip=52.101.201.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="4PtGgm3w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tUOnOCV54HUfj6VC/cixFqGxPjp0SXS82n5oeaUzcHp0y0VTPKzjOIitruoMm8j78fwaYq/pOg4AzcVAjCw7nfC4GMYr3a39kJCihxQMe9QTi/rL5c9fZYnCZ7Wiu+YtC74/ctwwFwrK2fuHog96jEu1EI4V0nkhbFitoobSyShvrKh+MmSlU4H5UK1dpf8GL1J1G5QsWZMp5BMjtaaxfipsd1Pk9mvT88/EiYfyMrwTYgx7L1EjoLuHIxy5+e5N+uxw3Nw5I8QPAYoweltQ5xpe9EdsGspP8kh2BikEJis36BQE5+Aidb9Qbwwc4R46w108wTq3jvytUMsIDkbFHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g44AbSYRkiGcVxuF87xdaKJfk/yXYofKUBtUfAxi6M0=; b=zDD4PIaRMw/KX86V1kunwo6tB7GJNIQT7mn+EcGjrG7VwkJIFgrZMIH++U/T8/abjenqZSQGSorQn3BXpV+GPKAbllUECpUF2PTUtHPJ3HcFejh5Vp9XMz8chtocWl+E8RhK007EuO6TKK1owQtEnhzQo0wM/pj8EIMObOEBV+U6LLzuLHm2jvxtYkJEdFeIAdw62hFRDRWjMO+nAyz2RuJ9PKtNQT4VXTDm0LOiHXQblQHUmjdODdNihrFof00IXU/WduCzdWwdc0izaHZxmddTwvUgwWTFqpDyMnSmoeb0FPCV6w14nkVMhwLKlgwFV4PdkcZlzRZTjh308zsJWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g44AbSYRkiGcVxuF87xdaKJfk/yXYofKUBtUfAxi6M0=; b=4PtGgm3wFkjFygP1mekLQd+UQOw9CKGPP7C/RmHgPxrPMmOQoC0YKXo6ssb3qfT3eYeUJ+bHPDIoqZ3leUzv+O50MaO98aN86WYhGqcwPOHgHBpjIwbkyUXMdU78dkUPnkTKXtff4ywNDWI4fg5l/LAf13toKg4qvcz8dCzLKVo= Received: from BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) by LV2PR12MB5798.namprd12.prod.outlook.com (2603:10b6:408:17a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:15:17 +0000 Received: from SJ1PEPF00001CEA.namprd03.prod.outlook.com (2603:10b6:a03:74:cafe::2c) by BYAPR05CA0064.outlook.office365.com (2603:10b6:a03:74::41) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9564.3 via Frontend Transport; Wed, 21 Jan 2026 21:15:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CEA.mail.protection.outlook.com (10.167.242.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:15:17 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:15:11 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 16/19] fs/resctrl: Implement rdtgroup_plza_write() to configure PLZA in a group Date: Wed, 21 Jan 2026 15:12:54 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEA:EE_|LV2PR12MB5798:EE_ X-MS-Office365-Filtering-Correlation-Id: c8acb9e6-a260-4492-e7d1-08de59322d12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|7416014|1800799024|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fQ2v5BqCwwgitALPN//O06dLoXEYKqmiBFmV1eLWXiSZncnlHrVIKjDIqSQA?= =?us-ascii?Q?sASm+8KROtfbJHKQw6ey84wiGr/2jisl33auy2Sz/tycLSeeIX9C5VESCNMd?= =?us-ascii?Q?IaDmz/8Tph+d7LUcL6YkjFuhc6BaMKhrZZ//kkSgM4UbKE2/Ax6dJD3H3GmS?= =?us-ascii?Q?7xSoLdWvQp/TH0A2Nc7lBFMBX9mrVP6NBvfJX1uTpz1reRidfIK8RNb/Nazn?= =?us-ascii?Q?+AnuDe9l/Q8aQ7h6i99DozZEJQo1bZusmjZ0VTiLtdz/4Ud5u0oY/0yI3oBK?= =?us-ascii?Q?4Ev9w1vV+MEac0dSrJI8h1gCTUyHPupEaiDyY4eQGQyCLHOCAcj4jkNoY6pm?= =?us-ascii?Q?e1IL2GflLNhELkxGdWmYm9+3UIRS5IAQ5NS/DpTmxDqGC9zvKvWUaC+lXXai?= =?us-ascii?Q?NbdsNCZQzv67+6beQ34wSwjeeKV7YdoLAGh+HJOHheWs/cJsQoitLAmbaIom?= =?us-ascii?Q?pS2ngz74q2NHdusaKI3hvnatrIHQt+1RyUgQirY/nuNkZFpk7Kku3hEuaoTI?= =?us-ascii?Q?QOFrxpDdIVwtqJHkCkJ5PvEoWkAqs6l58gOKbz5BKgnQVi5nYcG95spT2tUi?= =?us-ascii?Q?1RPtHARCt6TpGhkVC3784N84iC0cNcxYSuHn66oOVpgPHRB+ZHbXBhnBma0G?= =?us-ascii?Q?bNqc5YJfJX02CUAiP0+Kipuk8/sMcGb1d5WQPBhE7BurKCJAuk6DV4GeqtPk?= =?us-ascii?Q?zg+YjAly3SsJm9qHQMw4dPKG4c3OkBsHZWOmKXOQ/vz4tX4+lypYsCXG9+iP?= =?us-ascii?Q?uesla3Mqhd/ZIBXp6CYUBhasnoc4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?Q?pAP7DdzaFOGHBuw6nkIQJffbMBo=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(7416014)(1800799024)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:15:17.1557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8acb9e6-a260-4492-e7d1-08de59322d12 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5798 Content-Type: text/plain; charset="utf-8" Introduce rdtgroup_plza_write() group which enables per group control of PLZA through the resctrl filesystem and ensure that enabling or disabling PLZA is propagated consistently across all CPUs belonging to the group. Enforce the capability checks, exclude default, pseudo-locked and CTRL_MON groups with sub monitors. Also, ensure that only one group can have PLZA enabled at a time. Signed-off-by: Babu Moger --- Documentation/filesystems/resctrl.rst | 5 ++ fs/resctrl/rdtgroup.c | 88 ++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index 1de55b5cb0e3..8edcc047ffe5 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -626,6 +626,11 @@ When control is enabled all CTRL_MON groups will also = contain: Available only with debug option. The identifier used by hardware for the control group. On x86 this is the CLOSID. =20 +"plza": + When enabled, CPUs or tasks in the resctrl group follow the group's + limits while running at Privilege Level 0 (CPL-0). This can only be + enabled for CTRL_MON groups. + When monitoring is enabled all MON groups will also contain: =20 "mon_data": diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index d467b52a0c74..042ae7d63aea 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -896,6 +896,76 @@ static int rdtgroup_plza_show(struct kernfs_open_file = *of, return ret; } =20 +static ssize_t rdtgroup_plza_write(struct kernfs_open_file *of, char *buf, + size_t nbytes, loff_t off) +{ + struct rdt_resource *r =3D resctrl_arch_get_resource(RDT_RESOURCE_L3); + struct rdtgroup *rdtgrp, *prgrp; + int cpu, ret =3D 0; + bool enable; + + ret =3D kstrtobool(buf, &enable); + if (ret) + return ret; + + rdtgrp =3D rdtgroup_kn_lock_live(of->kn); + if (!rdtgrp) { + rdtgroup_kn_unlock(of->kn); + return -ENOENT; + } + + rdt_last_cmd_clear(); + + if (!r->plza_capable) { + rdt_last_cmd_puts("PLZA is not supported in the system\n"); + ret =3D -EINVAL; + goto unlock; + } + + if (rdtgrp =3D=3D &rdtgroup_default) { + rdt_last_cmd_puts("Cannot set PLZA on a default group\n"); + ret =3D -EINVAL; + goto unlock; + } + + if (rdtgrp->mode =3D=3D RDT_MODE_PSEUDO_LOCKED) { + rdt_last_cmd_puts("Resource group is pseudo-locked\n"); + ret =3D -EINVAL; + goto unlock; + } + + if (!list_empty(&rdtgrp->mon.crdtgrp_list)) { + rdt_last_cmd_puts("Cannot change CTRL_MON group with sub monitor groups\= n"); + ret =3D -EINVAL; + goto unlock; + } + + list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) { + if (prgrp =3D=3D rdtgrp) + continue; + if (enable && prgrp->plza) { + rdt_last_cmd_puts("PLZA is already configured on another group\n"); + ret =3D -EINVAL; + goto unlock; + } + } + + /* Enable or disable PLZA state and update per CPU state if there is a ch= ange */ + if (enable !=3D rdtgrp->plza) { + resctrl_arch_plza_setup(r, rdtgrp->closid, rdtgrp->mon.rmid); + + for_each_cpu(cpu, &rdtgrp->cpu_mask) + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, + rdtgrp->mon.rmid, enable); + rdtgrp->plza =3D enable; + } + +unlock: + rdtgroup_kn_unlock(of->kn); + + return ret ?: nbytes; +} + #ifdef CONFIG_PROC_CPU_RESCTRL /* * A task can only be part of one resctrl control group and of one monitor @@ -2171,8 +2241,9 @@ static struct rftype res_common_files[] =3D { }, { .name =3D "plza", - .mode =3D 0444, + .mode =3D 0644, .kf_ops =3D &rdtgroup_kf_single_ops, + .write =3D rdtgroup_plza_write, .seq_show =3D rdtgroup_plza_show, }, }; @@ -3126,11 +3197,19 @@ static void free_all_child_rdtgrp(struct rdtgroup *= rdtgrp) static void rmdir_all_sub(void) { struct rdtgroup *rdtgrp, *tmp; + int cpu; =20 /* Move all tasks to the default resource group */ rdt_move_group_tasks(NULL, &rdtgroup_default, NULL); =20 list_for_each_entry_safe(rdtgrp, tmp, &rdt_all_groups, rdtgroup_list) { + if (rdtgrp->plza) { + for_each_cpu(cpu, &rdtgrp->cpu_mask) + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, + rdtgrp->mon.rmid, false); + rdtgrp->plza =3D 0; + } + /* Free any child rmids */ free_all_child_rdtgrp(rdtgrp); =20 @@ -4090,6 +4169,13 @@ static int rdtgroup_rmdir_ctrl(struct rdtgroup *rdtg= rp, cpumask_var_t tmpmask) u32 closid, rmid; int cpu; =20 + if (rdtgrp->plza) { + for_each_cpu(cpu, &rdtgrp->cpu_mask) + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, + rdtgrp->mon.rmid, false); + rdtgrp->plza =3D 0; + } + /* Give any tasks back to the default group */ rdt_move_group_tasks(rdtgrp, &rdtgroup_default, tmpmask); =20 --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010050.outbound.protection.outlook.com [52.101.201.50]) (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 2EF43449EA0; Wed, 21 Jan 2026 21:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030131; cv=fail; b=cRchVRqoH2Tsu9FFKGZik6H8ER8WluXpdtjKqRhCWYgc6UntMCqxZCNfGQNp0GZzEF7O6aVCKs0HY5MuDXZLK7ZDCexsvstBRz4UMAqQLOWl7oo48g/GT5wd4ebCDbZWs0pEQjzzK6kmMEnvVpZ0vA44yeTN7f/woFlWOG/tExU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030131; c=relaxed/simple; bh=h/bQjCarL7StpR5IgKz9pHqE2EH+SdkSyHVhb//1ZU4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BdQ5hGmAsbTmB2dUBtPc3dQOPBrucQ11f7qrnCdI6S5u0/JUYlU0JGcRP+8skLUvbben/QD6LWXpwzsCxH/clA4tW21cTro2l0/Wv6tX6wrXmcyQM3rqf9FDgm9yXEOQ12FmNnsBdX0E7UVqz4SC1YyXrEXdBnUYaJQay3+2/CA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=n7DP0tSO; arc=fail smtp.client-ip=52.101.201.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="n7DP0tSO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Mkix79O70GjlcHIqTMflrlgfTc4XvcVuptK8aG4DB9o0Ap6dLCcTYbA2FvoWJ6+WpWI2slLygxjcTIUiBn++ByQX+kVP5xUgABlBOZBKHXS1rR6GqwiRjAgkLzscyW2W0syyH3OHnILirqGD/u6IBCUbACszoVxcONy15juGBbAm7bfn517sVCsCiWeUYuTPjFcY1uLsSaRclnlTkmC4JZfDD622EScnsnt7T+hYJN5nLeOe53maK8AArC1HDXWGNNxtStERdEO7zFMcg32Mwp6eWLroob5c9I8ZJxq1N1OljxwsRSlMa6HYKkG3MyMzCvdQ5x9unrZiAr+aI7nICw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=skz7OdnAoWnCtXKIWjkf2IYibfdIXj4yeG7h2r4qG8s=; b=DI3hwdGZdHWtAt2yTxZGGMQ6p2SmkPomvFcv0TyN+T4sJdwi0R01DtpmeYvM4osGIflpPLwTqoZnBF7bs99FeNsSHmup7aLockfgOuVDTzixHHjjbdk8zDWZB0T3lDr63uf0WWqrCxcxyFdRj5/svF3z5yQsjoGHD+wDw7voqd85G5V5RtXZNCuZKhZPetuEfZWbdOEBdKmP2TERVIqU58GUpo7kU1nCfvACt+gghvvFUTPYiKRjApp0x6PcxaCJAYpbA1SZnmi7mJ8JQXGmUwmRHkiKF8GN5AOpUNjGezlGzO2i60DUwIz3JlfpdtgWkYVY8CLYGgOGd2VGLe5PBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=skz7OdnAoWnCtXKIWjkf2IYibfdIXj4yeG7h2r4qG8s=; b=n7DP0tSOEmiFPZbsxty6JMNCRB7y+gBrfjok/Ey+brCjrQgRcD1m+pYfKs6iQlRjiQEZ6lVp7OrWjS5gqdSsbqYqlerKJlOhCYeoVdA4YGwaDdp1Tk38NgeznJid4uXe8yipi/J9yVCGZ3V/aHNiIqIz1lM8wW017wb9KeC0JsQ= Received: from BY3PR03CA0014.namprd03.prod.outlook.com (2603:10b6:a03:39a::19) by DM6PR12MB4203.namprd12.prod.outlook.com (2603:10b6:5:21f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.10; Wed, 21 Jan 2026 21:15:24 +0000 Received: from SJ1PEPF00001CEB.namprd03.prod.outlook.com (2603:10b6:a03:39a:cafe::58) by BY3PR03CA0014.outlook.office365.com (2603:10b6:a03:39a::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 21:15:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CEB.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:15:24 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:15:19 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 17/19] fs/resctrl: Update PLZA configuration when cpu_mask changes Date: Wed, 21 Jan 2026 15:12:55 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEB:EE_|DM6PR12MB4203:EE_ X-MS-Office365-Filtering-Correlation-Id: a5902eb2-ad84-46fc-3d24-08de5932315a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?gj+Uufe3v815hmAAeOP0dzMvqZBk63qErUpHMY0VUiw18TSgx3Ep32NhW2vW?= =?us-ascii?Q?yLH/pgEi3XOA6GgP7Y+V8Dy/THTHHQxbvNSJkuqDNK2GLh8F8gTxLGnUG3FB?= =?us-ascii?Q?gvUcKZJ4BBPOskqQ7EDXYXroMKzPVodhNTX9tOC8Zx33Gjs/K/fjdok1Gjfc?= =?us-ascii?Q?z0doCfJvX9MG6dmeF2bXGKTnV2US5J92XIifqSHjuhi9FkrkgiLDZjYyPkbz?= =?us-ascii?Q?rmmmyMv5wpD3v5PjmnNe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sIIsbyo3Y0Xp?= =?us-ascii?Q?UBhkJk/Y9zHapPsOYritHUq82iVqm5Ew0Qgk+38FTT0s9kzv9+8GvWJ1IYNx?= =?us-ascii?Q?0P14Yj6MxJnFPNoxEOj1hqjg1OX3PzvKzQ1VeSPUUZssiSe48uAgb+fZkHkL?= =?us-ascii?Q?pF49oFFTH5YgneimVM9JH0ZjiZi/26h410XApe9IRJnv2IbKTC6ERnrge7pm?= =?us-ascii?Q?9ykHIDRT3NJh2xy3yrxXVcY056/hk6/JMpf+M2ItJOIYtWkCnpdDCPl2iyq8?= =?us-ascii?Q?u5yQO1M6ON+oDxOQGTT/YUVdLU/OFPxD4vZCY8dXLsMNwNFdOUAdP2u6I4VP?= =?us-ascii?Q?KN+oAWWxihdm2fce1FJSJC1uCpBa1bJNOtjBK5FGh8aFZHyaIQqMU/07wodF?= =?us-ascii?Q?ADNSxa2rRgKXN26LbGJAvfk6Zya7ok7PbnVm3XgMTr7RPyFEJwTH2LTfl+YX?= =?us-ascii?Q?K7YW5HEqINqv6lfH4iN/aMgC0zFAifdZExJ4564GbwR4Zsi6i5VxqB7+2RqM?= =?us-ascii?Q?lYiu53fzhvuXc/lRLXxqK2plz0ugOTBNyz6XybndEOGxquGeKbm+pVyrLws1?= =?us-ascii?Q?2gKd0BGiRwC1GZvXBLynATzhkCI=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:15:24.3603 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5902eb2-ad84-46fc-3d24-08de5932315a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4203 Content-Type: text/plain; charset="utf-8" When PLZA is active for a resctrl group, per-CPU PLZA state must track CPU mask changes. Introduce cpus_ctrl_plza_write() to update PLZA on CPUs entering or leaving the group. Signed-off-by: Babu Moger --- fs/resctrl/rdtgroup.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 042ae7d63aea..bea017f9bd40 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -508,6 +508,33 @@ static int cpus_ctrl_write(struct rdtgroup *rdtgrp, cp= umask_var_t newmask, return 0; } =20 +static int cpus_ctrl_plza_write(struct rdtgroup *rdtgrp, cpumask_var_t new= mask, + cpumask_var_t tmpmask) +{ + int cpu; + + /* Check if the cpus are dropped from the group */ + cpumask_andnot(tmpmask, &rdtgrp->cpu_mask, newmask); + if (!cpumask_empty(tmpmask)) { + for_each_cpu(cpu, tmpmask) + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, + rdtgrp->mon.rmid, false); + } + + /* If the CPUs are added then enable PLZA on the added CPUs. */ + cpumask_andnot(tmpmask, newmask, &rdtgrp->cpu_mask); + if (!cpumask_empty(tmpmask)) { + for_each_cpu(cpu, tmpmask) + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, + rdtgrp->mon.rmid, true); + } + + /* Update the group with new mask */ + cpumask_copy(&rdtgrp->cpu_mask, newmask); + + return 0; +} + static ssize_t rdtgroup_cpus_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { @@ -563,7 +590,9 @@ static ssize_t rdtgroup_cpus_write(struct kernfs_open_f= ile *of, goto unlock; } =20 - if (rdtgrp->type =3D=3D RDTCTRL_GROUP) + if (rdtgrp->plza) + ret =3D cpus_ctrl_plza_write(rdtgrp, newmask, tmpmask); + else if (rdtgrp->type =3D=3D RDTCTRL_GROUP) ret =3D cpus_ctrl_write(rdtgrp, newmask, tmpmask, tmpmask1); else if (rdtgrp->type =3D=3D RDTMON_GROUP) ret =3D cpus_mon_write(rdtgrp, newmask, tmpmask); --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010071.outbound.protection.outlook.com [52.101.56.71]) (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 2CF803E8C6B; Wed, 21 Jan 2026 21:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.56.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030142; cv=fail; b=RBjePw2xSkuV+dw4SMnmFcATL6SZ0U4IFHsv/cEhr6RgatrZKQrf0fR1Qrx8p4TTvMY0JqhPfrooZ7b6dTWImRpH2vWcrSyjDSfUVCCL9Zw3D2UTSFXl7EmmXS06JimNbBQSFKHosACuHwXCOTz/vVl+E3eRyayDKgZXrv3+zR0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030142; c=relaxed/simple; bh=8SDcoR80eo54AsZESIywTHTuNcrRvKYW/lwxzQf+YBo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aRvoXHHoCxl98QBedE+RlR7RQCGgON8NoaBa6sDFXtyKeCHKFCR3eMRU1g1U6MQ8oakmM4sOagKlz23nx6U9fZZv9KPOqRSGEf7YBxOdsZrYqnGkaabMfEZRH3RD9QQaB+t8Uuo37/wbk7Yz/oggQUXR55djJZqKy/e0JyGqVwI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=wrGNzm2Z; arc=fail smtp.client-ip=52.101.56.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wrGNzm2Z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EyVHAZHwUHp8hOVRTrhkECIJGN0qYrs1ab3R0hj4xPUQjDxwnWGuZRx4ujuRpZwZ0ZaNwKMFjX/VCZoxRakF/0YjXSik/cxIISO1+OefLeOullmKmmvTNO9KZ24K2fyztcltWTyCzGUUbaHmVlRK0Sxgi/2PkBPsHPQS4pbYTQEjLBvN27VjnMZ5nkKKiBPM+PYsBnEbcafgqHy/dlY6w46bTAeMPnd4joSmFDzq93SYlm3RfkwpwPdv9Np6jnGKJi8yDTk8ImyaVAIEW+1vRNq4EaN66WSbRihjLNXPrZU4ERwmlnAY42or49Re+VwtmwHJUfiYHyXDXPvoNC7M+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RzzTBuxTRJfXmN2gAB5Bz1i/QpJQlfNBq4oLALv4zzk=; b=iEv5LfhV2xKRWEohA3MdPMsj377BCknqFdlQ0AG0k0UKvRXnzkff7t2XiCtvN4aNGBDeegO7sfZzKU7KPSBss440PZGP85d3sHiLoE6m1YAfhHxHNtyJQ9nL56565C3kDd3f5tmxsE8Pu797kMlyXi7RY1f/7xhRC6UQ5/NYS944sbeGzJcfPXGlhQC4ApPgp/cCzGn9WSfj5J8WtmKTtmQxwDoaqe/Bwdk841gsUOhZbUQIrv1LcCn7n1vcRU09PaTTgu61nMqMXlGi1L+aej9jgc1BF28b5rmpKzvXjlxRjvzkSlwaJP+UQXiF19zlIo9y4DjL/8TX65V1m4BwgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RzzTBuxTRJfXmN2gAB5Bz1i/QpJQlfNBq4oLALv4zzk=; b=wrGNzm2Z2mVL+ku/gCnv1wD1Ex3l06ojwBkBMxGrOLNobIMPiEkSTnYixtFp9YQGQQamr5jX3rqA03OPhXOAGDUkGSG2i+yfkjLmgMsJdyVmcFm1RtSEOdlZDczCToVuxF13qG8tPXVT4DtKC1VabEJOsdztWLl0MvdHT4KsYHo= Received: from SJ0PR13CA0138.namprd13.prod.outlook.com (2603:10b6:a03:2c6::23) by CH3PR12MB7761.namprd12.prod.outlook.com (2603:10b6:610:153::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:15:32 +0000 Received: from SJ1PEPF00001CE9.namprd03.prod.outlook.com (2603:10b6:a03:2c6:cafe::4f) by SJ0PR13CA0138.outlook.office365.com (2603:10b6:a03:2c6::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9564.3 via Frontend Transport; Wed, 21 Jan 2026 21:15:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE9.mail.protection.outlook.com (10.167.242.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:15:31 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:15:27 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 18/19] x86/resctrl: Refactor show_rdt_tasks() to support PLZA task matching Date: Wed, 21 Jan 2026 15:12:56 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE9:EE_|CH3PR12MB7761:EE_ X-MS-Office365-Filtering-Correlation-Id: c2ee05f2-b239-4e16-eb62-08de593235c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|7416014|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ahLV52UhBTWousxyGFM+8kAHLklbHlJGQUQmCppkwfRoXpuKcJzUV0lNg3bd?= =?us-ascii?Q?hODYLneZg7N0pmmT2F7KcMo/oEWHQU6HurTXV6hzcxnkaDZbCyY78AWe2X7x?= =?us-ascii?Q?2sl3Lzp2Q0DYw5dj9Om5y/0NDS0vhuBU3bBJ+qPOXg1L7kxhI3TFrjBLfxsw?= =?us-ascii?Q?hnX/66Q/XwHezMIgEz5kDr1b9lTxdAQD8AP80CLm3o8m55Ooz48CDMqYwSjv?= =?us-ascii?Q?Egx63SHuzes36TvdJHL+wo/HAsAi4mCWjPk2fXjtlq/oz1VvIqL1XIu9x7Dl?= =?us-ascii?Q?FDqe/SZbsRdnC6bFXVsxB7FDCu8AO6kh8lZmCBnr7hpY8rc1prQuuOWaN86h?= =?us-ascii?Q?Cy2I93Y80ATXtasr0fCoaPv8yNtHy0FUYu7Ul4lYL9pXUYaWI2myNVu3kDig?= =?us-ascii?Q?q7vXjZ2ybxjy/+oVp8lWPpXX7zozLf2MnTU5VsZyGf5JpwdQl52LDarUDgGG?= =?us-ascii?Q?E8lek7SyWOAopJTuC0Oq/qxDC9gMppAn6mFEV6DTOYkaxyykrfcojo0e2r6o?= =?us-ascii?Q?lKJL3DwZ2Swrt5ohQ4I8xWV1zs2Nw7cbgEanYqxga0ia7rOeIjHY+YBJfTHb?= =?us-ascii?Q?irgyx2mM9Y++uQoO0CipKReB2TGT/CtgDv+N5OPUlj0TFsiK2IB/2j5VKVmP?= =?us-ascii?Q?0QOOqk7iJ2onfXF5xscN6s2xwxM1LymtXT/h0DyoogLVtCifWieupPrkkMcd?= =?us-ascii?Q?VlHC5Qnl0BQ5BSYHqPCpTjhtILKv3L6aPpsE0VyNCZJuEGpOr6aI+rfXra6o?= =?us-ascii?Q?DGgranFO+xoSZ8feI2ovviQSHOu+ErcSW0L0TC3UlWD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?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(7416014)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:15:31.7573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2ee05f2-b239-4e16-eb62-08de593235c6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7761 Content-Type: text/plain; charset="utf-8" Refactor show_rdt_tasks() to use a new rdt_task_match() helper that checks t->plza when PLZA is enabled for a group, falling back to CLOSID/RMID matching otherwise. This ensures correct task display for PLZA-enabled groups. Signed-off-by: Babu Moger --- fs/resctrl/rdtgroup.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index bea017f9bd40..a116daa53f17 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -845,6 +845,15 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open= _file *of, return ret ?: nbytes; } =20 +static inline bool rdt_task_match(struct task_struct *t, + struct rdtgroup *r, bool plza) +{ + if (plza) + return t->plza; + + return is_closid_match(t, r) || is_rmid_match(t, r); +} + static void show_rdt_tasks(struct rdtgroup *r, struct seq_file *s) { struct task_struct *p, *t; @@ -852,11 +861,12 @@ static void show_rdt_tasks(struct rdtgroup *r, struct= seq_file *s) =20 rcu_read_lock(); for_each_process_thread(p, t) { - if (is_closid_match(t, r) || is_rmid_match(t, r)) { - pid =3D task_pid_vnr(t); - if (pid) - seq_printf(s, "%d\n", pid); - } + if (!rdt_task_match(t, r, r->plza)) + continue; + + pid =3D task_pid_vnr(t); + if (pid) + seq_printf(s, "%d\n", pid); } rcu_read_unlock(); } --=20 2.34.1 From nobody Sat Feb 7 17:55:23 2026 Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11012045.outbound.protection.outlook.com [52.101.48.45]) (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 9441F44BC9F; Wed, 21 Jan 2026 21:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.48.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030145; cv=fail; b=rcrwKuKppFVlxWzfUlydqCYQE7RgKua0DuiSunOM+t1lLX4wX8ItveGGApSo7gELJCg1ps6jqu1iQbYX0J2wDAoMXPhlaVIlUWls8VLmoEP2/D0tOL3DA5UrxNp+kRat+PSFoSgVwl9Q0tXZ0VyPTkUmVtEHJxDpuLoDw/F4Wz4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769030145; c=relaxed/simple; bh=hm0C/630O+fyxsO+nlugQZPEsOL+cdQUClZ97H40yWs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QzndH9rh/1Jpj6MwbKn/5AMB0P58eXzV4UdFyLxgeZJ1DIXqRZDnLnWIRcYvLXvSYn+UqLdgwScyiFFzdc/hqfDXGKxK3Rn5K71BPiaUUyj9Xl4h4W6M4HKYyWe0k5i6f40/g1nMijWgfpBfX0IlW2CyhKMNsv1RjOxsEOwHEZE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Ac6GU/2X; arc=fail smtp.client-ip=52.101.48.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Ac6GU/2X" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dMxb2hYbzKPQ9FWf3vFOMl7ZJi4R+DEBMMrLkuUP5WMb5z7Fa6aOUKqrZfMTqVlxN5RTWa/ljFXKzZdzmzegGhUV5bFvNC2tYEFiZFkurUynX4x5QhwvMbwp4500z4urpj0aRFhlugXkrS8KMgx4FpM8WLFAkiT++amRA9DElrdfMhsRbYH8FyX//d6sJP7KIJBQxrwIxFJ0pJqcyAHg+C4eJKEEnMNP3dykdWHCB/sqVIuZh3RbbQqB/iaE9cebNKjhrCip5dZSr/CNWizi0q5zLjR2RRe1fB3nqPgIz4iiFUM46CZ3P+PQoC5vP+n46WUWQdl196A+p8iuoNUcMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z2ZPLEI8voNpm4e664+GJxAyrvr0dO+czn9mhemO5hQ=; b=Oe/dcRV3KF1dcnxoC4N+prJ5gN5TGlfsXIKQ044w5h+caJNdxiV0BR1nAv2ihqZphY9oEu8hxDmKQtVv+DXAUlsqunrl+Lq56iWnRZSdEA31aWhZ9p2uDeRI7R2H9yGC+SBFbvl93lu/a7d/SBeR4mjYht4diZYj+AdNxO/0HfYzu5EoyMrTVvTkQZeURQyHtGnChxqnN9fiYGh+818NCYqC6HZhVYLRLDQ8ANF9QVMlkx4tVLu+FCOURQAVx/fkIXvNKC3gvfsVOyUJO04ei6NMQqTyaNn5QZYlUJkA579pS2fHfyGh3uyuRTanLehkvPp8XHLRiQPfe88WbGXxmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z2ZPLEI8voNpm4e664+GJxAyrvr0dO+czn9mhemO5hQ=; b=Ac6GU/2XQ1Ee4/dvwLDn9a0scvs2H8KBDNP7BBQzpS804xkXvXCCziCec+set+7G0HG4QMcuXAjcAaZV9kHGDVzZLrVV+o9Sr4p//t7f8ucjpBbfhLuDk09jiL2qmDb6TgSjsPOKP0+hpL6BitZTnG4h2jKVJViOhOxQMxiLRoA= Received: from SJ0PR03CA0300.namprd03.prod.outlook.com (2603:10b6:a03:39e::35) by IA1PR12MB9740.namprd12.prod.outlook.com (2603:10b6:208:465::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 21:15:38 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:39e:cafe::87) by SJ0PR03CA0300.outlook.office365.com (2603:10b6:a03:39e::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.10 via Frontend Transport; Wed, 21 Jan 2026 21:15:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 21:15:37 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 21 Jan 2026 15:15:35 -0600 From: Babu Moger To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 19/19] fs/resctrl: Add per-task PLZA enable support via rdtgroup Date: Wed, 21 Jan 2026 15:12:57 -0600 Message-ID: <096d70c47ca16630a51284a61541e068d4b48698.1769029977.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|IA1PR12MB9740:EE_ X-MS-Office365-Filtering-Correlation-Id: fc926851-bb92-46e0-80a9-08de59323921 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9VLLnl5p8D/HM/vjquiseIDbr+cC74T9PI0mSH627D+sYImJ86aVhbv2P+w/?= =?us-ascii?Q?1GybitDdBCAUO066WyB1iKr9UI2f2WmcMhZzqJXJ7lTuK6cFUvF3hfpgX64Z?= =?us-ascii?Q?wvYdpnm8+1M++J/ZFAEIq54hoO7waXQtAfzJGgadxhJOqsMjBz3T3hEa7kif?= =?us-ascii?Q?yRTWUw7R2Ynv86JLedjNTATInmumg/FMZFahO7jHfxYA5JWhbI+1tUWuD7BW?= =?us-ascii?Q?4HYvrKItorj8t8kYBlLHdu0ojczc5HnNKMB2FUmQLp4FgHFHqy5/1bYj2eiP?= =?us-ascii?Q?Jhu5D7AssnTLykirIryrvOJFpQ07hyUR9epRXm3x19y2YF61SgiVkAr9kC+6?= =?us-ascii?Q?ZBWQmSNLoK1+zzsSE2lTbWB2StVM4iY499cnwpowor48LgIXxKv2E0PQsTDF?= =?us-ascii?Q?PLPXkL9oxSUuuz4LT5qZPsIzDa4CBeumm1B9kfLSHQVQnQYerk9ny3zNup9D?= =?us-ascii?Q?xlS/KoI5l1brG0wc7KZkxPXbHpph4TloqGuzvqjSxLdWq4zxNWi2ZxOada9W?= =?us-ascii?Q?gN9/iNS0K06TlsOEu8h67UhqqS3iepdd+CTsx37wxdq03IAeXYWR6xRkDuFE?= =?us-ascii?Q?seKv4mxRDpnH5GOZIFKB7p1eRlXRTjkjPG+ozQ0ekN+4DSdVacvXJ7VQuM7x?= =?us-ascii?Q?J1y7VTkXaH5zi4KYTE9vHfdii8PwNAol25SyfOvRm9yPlGrHiehUcLioYrkF?= =?us-ascii?Q?Jr08JBXkkgmBHyPa+kRxo8jCX0QEfqDB9V4309yKzBNvDtgktb2TPA5PmX8j?= =?us-ascii?Q?sqxls5ZIGy4ZWn/LF8syzd3ybxXCTq/uNXJEu1xZnI4hwTocmxYomjhy2q26?= =?us-ascii?Q?MpeUtO+BPyfN2Mh8KpV+QDyJGeB7uJyf7DpPnFvC9QV8glZIxvI/wQTkYvar?= =?us-ascii?Q?nFgneEnjyx4By7SBH7xeHltKHu7+cFoyNCN7ww7N1riAz0nV0TG/kDuCCdXA?= =?us-ascii?Q?EVaCHfxEe2i47BT4/8ui+0wC84FTXlC6TEKQj59cQN2l8jlCA3ScyLs3c59v?= =?us-ascii?Q?bkcItOm5erCgrXXSi6PzBEZjYzVifbyPuqBKaTuO4XG2nw7YBTpRkTpRgqhW?= =?us-ascii?Q?SVVns3xTQXGG2dxA2stEpFnQ/LnDPhbcjOVW425txfTGAOXzaivxTif2MgBj?= =?us-ascii?Q?cVQNaFmJ3AqRLSoo176PAeLtKnbm5CwcCKrkMBLrXizT2pzFqlE9LUnDqI8J?= =?us-ascii?Q?zZeM547fLo7/L8m3KPmeBv+VuREDbW36i597EqQou7DMxOS05tHl4C48f/DI?= =?us-ascii?Q?H6CHTKi65IqwPai35V3McIJ+rQ968S70spOJzHRq5qm6som8K5fYTEFGSVlz?= =?us-ascii?Q?Myoo0yGJBy3f+DTlg+T1n6fXtMfoX5NYABH+6K3V5SjkVVUKKkNg5Iy7sPBL?= =?us-ascii?Q?EDe+/+azXtJiVpASKWIVcwGULTtZX9l0menpkiawMXbZnYdoqmNpD97I07nr?= =?us-ascii?Q?SJrBPneS9zNs3Ybf1CQ8CGt57/VAamntPsLMFOGuCyBWlM+nZff53KkB4fH5?= =?us-ascii?Q?nGiGkl/TUibInoVOoRvrHs8TxilLYcbKnu1lfguikQ4adBQrG9Lw5xK1OnD2?= =?us-ascii?Q?wuJpVabvNTzYAbgGdSzy6eJX9R0pAtysuYx3dGh5hH5s35L2DsiNyns1zK/h?= =?us-ascii?Q?ZNQBv+ymw7kbe57p6YdoAThO6h5XbxfC5XKHKUadpG3X5XU7EXVJNTJZMDgz?= =?us-ascii?Q?IVKtwpG4PnCAR4YzRAGKQ/oz7iA=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 21:15:37.3827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc926851-bb92-46e0-80a9-08de59323921 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9740 Content-Type: text/plain; charset="utf-8" Introduce support for enabling PLZA on a per-task basis through the resctrl control-group interface. Add an architecture helper to set the PLZA state in the task structure and extend the rdtgroup task handling path to apply PLZA when associating a task with a control group. PLZA can only be enabled for control groups; attempts to enable it for monitoring groups are rejected. Proper memory ordering is enforced to ensure that task closid and rmid updates are visible before determining whether the task is currently running. If the task is active on a CPU, the relevant MSRs are updated immediately; otherwise, PLZA state is programmed on the next context switch. Signed-off-by: Babu Moger --- arch/x86/include/asm/resctrl.h | 5 +++ fs/resctrl/rdtgroup.c | 69 +++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h index 89b38948be1a..2c11787c5253 100644 --- a/arch/x86/include/asm/resctrl.h +++ b/arch/x86/include/asm/resctrl.h @@ -200,6 +200,11 @@ static inline void resctrl_arch_set_cpu_plza(int cpu, = u32 closid, u32 rmid, u32 WRITE_ONCE(per_cpu(pqr_state.plza_rmid, cpu), rmid); } =20 +static inline void resctrl_arch_set_task_plza(struct task_struct *tsk, u32= enable) +{ + WRITE_ONCE(tsk->plza, enable); +} + static inline void resctrl_arch_sched_in(struct task_struct *tsk) { if (static_branch_likely(&rdt_enable_key)) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index a116daa53f17..5ec10f07cbf2 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -706,6 +706,26 @@ static int __rdtgroup_move_task(struct task_struct *ts= k, return 0; } =20 +static int __rdtgroup_plza_task(struct task_struct *tsk, + struct rdtgroup *rdtgrp) +{ + if (rdtgrp->type !=3D RDTCTRL_GROUP) { + rdt_last_cmd_puts("Can't set PLZA on MON group\n"); + return -EINVAL; + } + + resctrl_arch_set_task_plza(tsk, 1); + + /* + * Order the task's plza state stores above before the loads in + * task_curr(). This pairs with the full barrier between the + * rq->curr update and resctrl_arch_sched_in() during context switch. + */ + smp_mb(); + + return 0; +} + static bool is_closid_match(struct task_struct *t, struct rdtgroup *r) { return (resctrl_arch_alloc_capable() && (r->type =3D=3D RDTCTRL_GROUP) && @@ -795,6 +815,35 @@ static int rdtgroup_move_task(pid_t pid, struct rdtgro= up *rdtgrp, return ret; } =20 +static int rdtgroup_plza_task(pid_t pid, struct rdtgroup *rdtgrp, + struct kernfs_open_file *of) +{ + struct task_struct *tsk; + int ret; + + rcu_read_lock(); + if (pid) { + tsk =3D find_task_by_vpid(pid); + if (!tsk) { + rcu_read_unlock(); + rdt_last_cmd_printf("No task %d\n", pid); + return -ESRCH; + } + } else { + tsk =3D current; + } + + get_task_struct(tsk); + rcu_read_unlock(); + + ret =3D rdtgroup_task_write_permission(tsk, of); + if (!ret) + ret =3D __rdtgroup_plza_task(tsk, rdtgrp); + + put_task_struct(tsk); + return ret; +} + static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { @@ -832,7 +881,10 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open= _file *of, break; } =20 - ret =3D rdtgroup_move_task(pid, rdtgrp, of); + if (rdtgrp->plza) + ret =3D rdtgroup_plza_task(pid, rdtgrp, of); + else + ret =3D rdtgroup_move_task(pid, rdtgrp, of); if (ret) { rdt_last_cmd_printf("Error while processing task %d\n", pid); break; @@ -935,6 +987,19 @@ static int rdtgroup_plza_show(struct kernfs_open_file = *of, return ret; } =20 +static void rdt_task_set_plza(struct rdtgroup *r, bool plza) +{ + struct task_struct *p, *t; + + rcu_read_lock(); + for_each_process_thread(p, t) { + if (!rdt_task_match(t, r, r->plza)) + continue; + resctrl_arch_set_task_plza(t, plza); + } + rcu_read_unlock(); +} + static ssize_t rdtgroup_plza_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { @@ -991,6 +1056,7 @@ static ssize_t rdtgroup_plza_write(struct kernfs_open_= file *of, char *buf, =20 /* Enable or disable PLZA state and update per CPU state if there is a ch= ange */ if (enable !=3D rdtgrp->plza) { + rdt_task_set_plza(rdtgrp, enable); resctrl_arch_plza_setup(r, rdtgrp->closid, rdtgrp->mon.rmid); =20 for_each_cpu(cpu, &rdtgrp->cpu_mask) @@ -4209,6 +4275,7 @@ static int rdtgroup_rmdir_ctrl(struct rdtgroup *rdtgr= p, cpumask_var_t tmpmask) int cpu; =20 if (rdtgrp->plza) { + rdt_task_set_plza(rdtgrp, false); for_each_cpu(cpu, &rdtgrp->cpu_mask) resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid, rdtgrp->mon.rmid, false); --=20 2.34.1