From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7118F606A322 for ; Wed, 2 Dec 2026 04:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EqrOJvYW; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SNDQ8Bvw DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:CC:To: Subject:Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=hz7buV8ONwxp4v7M1neIoCrsKesIzs8morOWeI2kIJw=; b=EqrOJvYWSEA0zdUOzXdIddh+5C Gi85wSXKhG2fRMnvOAt6U1TJ+CEVm7rKKwFDVGbWNAfe7aingf9dbM459QK5T1BBRvFUazht86mmC 8Q4S1UWHUnush6iopFOISfpeQALgzEA40Oiwbw1k2Ho/aXH6jWvPQUK3lLBwh9giSgJ1YB2Im0zYK ttcy+gnqYkZydDmDRO5ISuVBR6RDfNDmwRB2DwWgTE/bDXrAevSj/UQ+b8iPfP3kkzJYn26+Z0Pxw asWz+SY0EGUTbYauWLjwFkdQTu9/YSmNeuqDxJqKHBxN3BXKp8FmJP/gVzADxzacB8LBPR1HHEbEm GogfCI4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYcGQ-0000000AD1S-188W; Wed, 02 Dec 2026 04:48:18 +0000 Received: from mgamail.intel.com ([192.198.163.17]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYcGN-0000000AD10-3O2a for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 04:48:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796186896; x=1827722896; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=hz7buV8ONwxp4v7M1neIoCrsKesIzs8morOWeI2kIJw=; b=SNDQ8BvwoEdA4H8N85LLTk75IIalt6d73YsNiDn0ajKcuosLIbF7lCR7 OYL1NuOvV0sWhGgzCXJSys72ZlHHbp1nQ8myncXIX8bANk2tH4HYBI9/7 CcWJBRxPEzw9y3rBbCWeYCK3vSw0bH4F0vmpNYs2975i1b95gMs3JUt5+ qUhB7JBUC9tn4DNd4VyzUebCRq1pzM2Uza6x821hc1k3ROKvZqeZWUh82 wTfcjisNUCdUKIoRLKMaFf7hTsGFUQ/TQDP70/KV4Pv6ec5Rlo77HhqVA b7pWFjjKVddQzf+uMXZYOKNhTUqlZJGQDxcgjT+Ax8FJX8LlOzrxnFppT g==; X-CSE-ConnectionGUID: U2rm7fBwSD61pXXh4YZrWg== X-CSE-MsgGUID: /ycAIeZ9TkyreNIjW+fLZQ== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5099147" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5099147" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 20:48:13 -0800 X-CSE-ConnectionGUID: jV668M0BS5mwM377GxjRxw== X-CSE-MsgGUID: guYCUxbvRcOEtDRRaVvMOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13294432" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by orviesa003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 20:48:12 -0800 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 20:48:11 -0800 Received: from ORSEDG901.ED.cps.intel.com (10.7.248.11) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Tue, 1 Dec 2026 20:48:11 -0800 Received: from BYAPR05CU005.outbound.protection.outlook.com (52.101.85.7) by edgegateway.intel.com (134.134.137.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 20:48:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mH6ADlXg83eyfK2X5aLuyNpmQ7F522+4c8Fz13uUrd3cVKZbhOrRiuIFiPXC+6Ggh7RO6nsSQ7ncmcycTTBPqr8uPab15Sx2kZbvsc+f8YSPZl/vCKT8n+jSGD1RXaVWrKXelrSB7UfEMDxOez0aPIE1mZJrxHeS8SCWNaNG5gPqdJpc/J68PGeEOGADt32UVV7goOTOLl3oFFBYa19+EBB9Zifc7+kUgk9NJkuyRwhwHlEEk5jloOKbrtA5HvwU0llslAGp3X9VcIJKsRBuLDm8BrzwJf2oxw+690ed97uB+zrGQ34DUPQQtF0YJee+eskYfNu3a2Y0/M1g7SqotQ== 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=hz7buV8ONwxp4v7M1neIoCrsKesIzs8morOWeI2kIJw=; b=eQt4s5YAqVQhnAKDi8/VobNIYqz3ADEkKEXnwrXrjVll7d1whrYcKjIPvJ86Ak9HtBiM8jyfH4x0FCPW+/+7pVyFYL5+ku3sttrbyTxnp+cIinU8aKVaNK66X09VbGc3wOsR11D2jj4EvAi6gpg9xUcZYlr+PhhPBbVo0fYTHeD0W+KNdDj/jVtY5hp5Grg679AeQxEBcHit7nr2Y3N8ESKYvtzBSE7iBjzCqhiLqAVghoFW3c37sLGt/pOkwBw1PwwpGtXZ4wDTtnoPQV4snXGmV5GeiUNeZIyv9d72zDsF6AHGC75aQF2etI8tXt59B9BQvdeeuwCIlNOy39Glsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB8370.namprd11.prod.outlook.com (2603:10b6:a03:540::20) by PH9PR11MB821391.namprd11.prod.outlook.com (2603:10b6:510:3e6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 04:48:09 +0000 Received: from SJ2PR11MB8370.namprd11.prod.outlook.com ([fe80::b6cf:ce77:3cdf:7cc]) by SJ2PR11MB8370.namprd11.prod.outlook.com ([fe80::b6cf:ce77:3cdf:7cc%7]) with mapi id 15.21.0688.009; Wed, 2 Dec 2026 04:48:09 +0000 Message-ID: Date: Tue, 1 Dec 2026 20:48:04 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 05/19] arm,x86,fs/resctrl: Introduce arch hook to program global per-CPU kernel mode To: Babu Moger , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: From: Reinette Chatre Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR04CA0222.namprd04.prod.outlook.com (2603:10b6:303:87::17) To SJ2PR11MB8370.namprd11.prod.outlook.com (2603:10b6:a03:540::20) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB8370:EE_|PH9PR11MB821391:EE_ X-MS-Office365-Filtering-Correlation-Id: d3ac99b9-f085-4071-5cb4-08df502f7639 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|11063799006|4143699003|6133799003|261009223027099003|260925021311599003|56012099006|260925021911599003|260925022911599003|10067099003|261028144727099003|261102123227099003|261026121527099003|261026140227099003|261021121427099003|261022105027099003|261022075727099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: dByrxG8VLb5kvRZzA1/YrRQ07nByugll4GmZZFlLCO/1VsVaIGVPQAYQt7VNUrBQgXK75bhiUH1sCk/odke5jmZWHWbWgAM7A8KLh7KzV4MqcSw0Gi9lPmqnhhQ1UosY8WF62oVNgVFxo/Z2tZogSvlUKOaCSuuVYUn35bd4h7xH/xUU8ccCF4CzJ46LlmN1ac/z2/417GP5OOmZ7TYQt4cR3ouIsKDt5vgQzJUJGVW3tJrg1qU7friKJcWeQcLyuRyxqFuj5SCJ+nSzHVWOcoKkZYbN7gA7Csizx+jBqmcNEOO3FeXh+YHzudTm60nxOjeVta+HWH0fFbQG/N9TLAP72ih9UbmCCNULsUhTnZTr9VhvHWCXPxDpythDtvbdrDiPIeL0ln8GnMxgDhmBliWphSDCZwBw8zJOVGtojdHRDs/ifEDXDI0Gtg8LlPZeX2+BBBmdInGHFN1AFQ/no5vIavzqciFM5aq/ZkXh5pQSUR8ro4izxohb7xlOQDzBVj2k8rG9LbXzapmKoRAxf3S5m1MH65NDDpZP3fId1ZvKaMTYvtSDjY29IAdSpVmQT0w1fz0ujwYXezWHtoOMXIBunjnDGiS4WCguzdANam0xFqFXKj6SRwTkZTowJCecRolkBB4zC9WueVEQgN1SrX7FgGlXwSc4ufXzwluLYZY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB8370.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016)(23010399003)(11063799006)(4143699003)(6133799003)(261009223027099003)(260925021311599003)(56012099006)(260925021911599003)(260925022911599003)(10067099003)(261028144727099003)(261102123227099003)(261026121527099003)(261026140227099003)(261021121427099003)(261022105027099003)(261022075727099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bFhMQXlNY2d3ZXdSanJpNVlsalFKaFVVenNacUV4cnhQMkREYTNQYmlidFB0?= =?utf-8?B?V1MvWlh0TmNOcE1zV0RieDRPTVBCSDJGVk5BSlhiMk83UENZdG5BWmROMWZh?= =?utf-8?B?V3FUTVBQcnlNQXFRQU56ckoxQUd3ZTJQMGZhUGR4dGJaRlBocElhcnF0RmFV?= =?utf-8?B?c1dQSVZNUnhCNjR0UmswQmNFV3h4WmVXQ2oxVGN2QkhqKytRekxucFlzYmtJ?= =?utf-8?B?Z0pIZzFJdng1ZjlBWFpoWThDQmVNZjVEMXl4dHJBYWhidFZnRzczVEhkaW1V?= =?utf-8?B?anBQSXgvT1EyWFdwVGdWRTdIUElOQlNuWmszSlA5Z3BCR2wyN3dCMmFFVkow?= =?utf-8?B?UmRqaHNYcHJDTGdtMFR1Q2N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= =?utf-8?B?dnkzRVVNell0VWxjRDZqalpSZWhaWEUrc2F3NTBoRGh5a1dCVTJVejEyLzNy?= =?utf-8?B?ZVJCazN0VThORStDKzRIYzdaSGFnUFJSVjJDM1B4SXp0Z2oyUWlKZ2x3N3Nj?= =?utf-8?B?ZUtCaGF6U2JaQVRVOUljbGk2emJ6bUNQeVZBUU5aWlU4cDRObndhWmRwSVcz?= =?utf-8?Q?lyqQyN9snPeLj01E=3D?= X-Exchange-RoutingPolicyChecked: H8MNslBYJ1GlloAX1xPDG4lOXNjOWQlBoA0+dED6u2EpTzZD594jbUfHY+MpSKUUgG87x2inKCyc3pWKKFi+qYatgPcveKzqCBjl1To5eJ8POWrqnoTbhXbZGYrwD5jgC8Wd7MPosKNz/+MEcbL0oNa/AD9VpsMyPDlLaG/P/MBxckM+1xl/vKILLmIR2oN0P4ZLUf1yaNT8/VN9mXS5C+pX0UIvhrQn50MbEZB+jwA1nfJ+/+tijlRKcBbK/pStvEq/tD5YVNiNnSSP/q3lA8IojpdkYMnO7q/8GjWZ5v7ElnV7SVej9i95MCszcBHFHTx+6S3ZmraxhWdNNhPUWQ== X-MS-Exchange-CrossTenant-Network-Message-Id: d3ac99b9-f085-4071-5cb4-08df502f7639 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB8370.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 04:48:09.2851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6wpyjmuAl44/KERiHRNBGixIAHu9+QmNzCO0xvgST/uyCdR/uYgTjbwKr6QVomu5UOUTf+cKvFrUy+IxD8LIaKlMlzK1LhgVkqz7lj2IPNs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH9PR11MB821391 X-OriginatorOrg: intel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_204815_864722_E168B642 X-CRM114-Status: GOOD ( 27.23 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Babu, On 11/11/26 2:43 PM, Babu Moger wrote: > RESCTRL_GLOBAL_ENABLE_PER_CPU enables a CPU to use a different CLOSID "RESCTRL_GLOBAL_ENABLE_PER_CPU" -> "RESCTRL_GLOBAL_ENABLE_PER_CPU kernel mode"? > and/or RMID association when executing in kernel mode than those used in Please drop "association". > user mode. On x86, this mode corresponds to PLZA (Privilege Level Zero > Association). > > PLZA is programmed per-CPU through MSR_IA32_PQR_PLZA_ASSOC, which contains > the kernel mode CLOSID and RMID, an enable bit for each, and a bit that > enables PLZA on the CPU. All fields except the PLZA enable bit must be > programmed identically on every CPU in a domain. Above just duplicates part of patch #3 changelog? > > The mode is enabled independently on each CPU, so the filesystem must > program hardware when the mode is activated, when CPUs are added or > removed, and when it is deactivated. CLOSID and RMID can be programmed > independently, so the architecture callback provides separate enable > options for each. > > Add resctrl_arch_configure_kmode_global() with an x86 PLZA implementation > and an empty MPAM stub for ARM systems that do not support this mode. There seems to be an ordering issue above, above paragraph introduces the arch helper but the paragraph before it already refers to what it provides. How about something like: The RESCTRL_GLOBAL_ENABLE_PER_CPU kernel mode runs all kernel work on the CPUs where it is enabled with the CLOSID and/or RMID of a single resource group. Whether kernel work uses the group's CLOSID, its RMID, or both is selected separately. resctrl fs decides when the mode is activated and deactivated, and on which CPUs it is enabled, but programming the hardware is architecture specific. Add resctrl_arch_configure_kmode_global() for resctrl fs to request enabling or disabling the mode on a set of CPUs with the CLOSID and RMID of the backing resource group, and whether each of them is used. Implement it on x86 by programming PLZA on each of the CPUs. Provide an empty stub for MPAM, which does not support this mode. > > Signed-off-by: Babu Moger > --- ... > --- > arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 38 +++++++++++++++++++++++ > drivers/resctrl/mpam_resctrl.c | 7 +++++ > include/linux/resctrl.h | 28 +++++++++++++++++ > 3 files changed, 73 insertions(+) > > diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c > index 62044489b052..79b6fdcbc553 100644 > --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c > +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c > @@ -137,3 +137,41 @@ int resctrl_arch_io_alloc_enable(struct rdt_resource *r, bool enable) > > return 0; > } > + > +static void resctrl_kmode_set_one_amd(void *arg) > +{ > + union msr_pqr_plza_assoc *plza = arg; > + > + wrmsrq(MSR_IA32_PQR_PLZA_ASSOC, plza->full); > +} > + > +/* > + * resctrl_arch_configure_kmode_global - Program Privilege Level Zero > + * Association (PLZA). > + * @cpu_mask: CPUs whose MSR_IA32_PQR_PLZA_ASSOC should be updated. > + * @closid: CLOSID programmed into MSR_IA32_PQR_PLZA_ASSOC. Always > + * written; required even when @assign_ctrl is false. > + * @assign_ctrl: Whether PLZA should program the kernel mode CLOSID. > + * @rmid: RMID programmed into MSR_IA32_PQR_PLZA_ASSOC. Always > + * written; required even when @assign_mon is false. > + * @assign_mon: Whether PLZA should program the kernel mode RMID. > + * @enable: Whether PLZA should program the kernel mode. arch should always do programming whether @enable is true or false, no? > + * > + * Program PLZA on @cpu_mask for %RESCTRL_GLOBAL_ENABLE_PER_CPU. See > + * union msr_pqr_plza_assoc for the hardware field meanings. > + */ > +void resctrl_arch_configure_kmode_global(const struct cpumask *cpu_mask, > + u32 closid, bool assign_ctrl, > + u32 rmid, bool assign_mon, > + bool enable) > +{ > + union msr_pqr_plza_assoc plza = { 0 }; > + > + plza.split.rmid = rmid; > + plza.split.rmid_en = assign_mon; > + plza.split.closid = closid; > + plza.split.closid_en = assign_ctrl; > + plza.split.plza_en = enable; > + > + on_each_cpu_mask(cpu_mask, resctrl_kmode_set_one_amd, &plza, 1); > +} > diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c > index 5468367776e2..548bfb336be5 100644 > --- a/drivers/resctrl/mpam_resctrl.c > +++ b/drivers/resctrl/mpam_resctrl.c > @@ -139,6 +139,13 @@ bool resctrl_arch_get_io_alloc_enabled(struct rdt_resource *r) > return false; > } > > +void resctrl_arch_configure_kmode_global(const struct cpumask *cpu_mask, > + u32 closid, bool assign_ctrl, > + u32 rmid, bool assign_mon, > + bool enable) > +{ > +} > + > void resctrl_arch_pre_mount(void) > { > } > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h > index 6f3e57ec4aa3..e43415ae6e0e 100644 > --- a/include/linux/resctrl.h > +++ b/include/linux/resctrl.h > @@ -741,6 +741,34 @@ enum resctrl_kernel_mode { > > #define RESCTRL_NUM_KERNEL_MODES (RESCTRL_KMODE_LAST + 1) > > +/** > + * resctrl_arch_configure_kmode_global() - Program RESCTRL_GLOBAL_ENABLE_PER_CPU > + * > + * @cpu_mask: Online CPUs on which to update the CLOSID and/or RMID. This configures many more, should it be " ... on which to configure %RESCTRL_GLOBAL_ENABLE_PER_CPU."? > + * @closid: CLOSID of the resource group backing %RESCTRL_GLOBAL_ENABLE_PER_CPU > + * mode. Always provided, even when @assign_ctrl is false. > + * @assign_ctrl: true to update the @closid for kernel mode; false to inherit the > + * CLOSID from the user task. > + * @rmid: RMID of the resource group backing %RESCTRL_GLOBAL_ENABLE_PER_CPU > + * mode. Always provided, even when @assign_mon is false. > + * @assign_mon: true to update the @rmid for kernel mode; false to inherit the > + * RMID from the user task. > + * @enable: true to enable %RESCTRL_GLOBAL_ENABLE_PER_CPU on CPUs in @cpu_mask; > + * false to disable @RESCTRL_GLOBAL_ENABLE_PER_CPU and reset the @RESCTRL_GLOBAL_ENABLE_PER_CPU -> %RESCTRL_GLOBAL_ENABLE_PER_CPU ? > + * kernel mode to %RESCTRL_INHERIT_USER. > + * > + * The callback programs %RESCTRL_GLOBAL_ENABLE_PER_CPU. A configuration starts > + * when %RESCTRL_GLOBAL_ENABLE_PER_CPU is activated and ends when the mode is > + * deactivated or userspace changes the backing resource group, @assign_ctrl, or > + * @assign_mon. Each call for a given configuration uses the same @closid, > + * @assign_ctrl, @rmid, and @assign_mon; only @cpu_mask and @enable differ. > + * Before a configuration ends, it is disabled on every CPU where it is enabled. Above establishes the contract between resctrl filesystem and architecture. Please keep this in mind as the CPU hotplug discussion (patch #13) evolves since that may result in a change of this contract. > + */ > +void resctrl_arch_configure_kmode_global(const struct cpumask *cpu_mask, > + u32 closid, bool assign_ctrl, > + u32 rmid, bool assign_mon, > + bool enable); > + > extern unsigned int resctrl_rmid_realloc_threshold; > extern unsigned int resctrl_rmid_realloc_limit; > Reinette