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 2E0B6606A31A for ; Wed, 2 Dec 2026 05:03:07 +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=LOkOfH+/; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eQtan60F 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=3i6uzqrWBvBNAdTlFiGNr3xBl0wkwnQRPyPYuREIASE=; b=LOkOfH+/+gyME7cK1HxYWwgOyz wXpiI/9z6OzvfJBuv1WY0p+G6YyGaNi8arwxSc43dUHWnH6RkMymRnYBLjZEbq2e+TRLxuLgZD4bX U+Cx1OL+q4939rBh0f/DEPfSmPwnu7CIwUcDWFU0R/DD9c1458+88AdgQxSMiEHwyoVSEBs72Mpq0 sMtPpOz372aOAcborGWVcMdIvVLJCoeuFdBnQ0qVIp1gV6y/+TTujOKOXwZ3BafCQazpMi6XA+9kt sVWsvG5+q7aGHHbuDDvoJ3U1Vzl3dzE1Hc8lOCTfMr0311GqrOyBWJYWqARvC4cWKGEPs/mpMjPlu SdWrnkBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYcUZ-0000000AGIr-0cUg; Wed, 02 Dec 2026 05:02:55 +0000 Received: from mgamail.intel.com ([198.175.65.12]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYcUV-0000000AGHL-303Q for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 05:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796187772; x=1827723772; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=3i6uzqrWBvBNAdTlFiGNr3xBl0wkwnQRPyPYuREIASE=; b=eQtan60FmWtzcTs1Z7/Lkjmgnt/7Oqvh2PwrOVPSwuBxbQaeXZIrnVTV 7n/DtYae8sUkaEdMKKV0olw5nPf8y1C8Ugv2zE4ytEaE+vzTJwZYC61DO DFwsos8Uu5CFEdxtgDgVjlyWLHsWkLh4Kx9gsGBbehM+7QT5ctbiEYmAF VF0q1Hg2M8+u5pncmXIwUgRHVZcN3WwRu9fqCgyhoLy7AvU0WwVhidRlg ZVj5TyGC6vDrSeT/cvbJPkKzoiFVKKMUEYMGh3gMSXeDP1cGmCV3Slm/4 FqlbCPZ68zguCX3uq4ssB069pLb+D241H0JIz8U6fGAcgqJ5wAGgcjkeo w==; X-CSE-ConnectionGUID: 3DTIvj6xTGePAakkD0eyoQ== X-CSE-MsgGUID: kxuwshY5Rhm2+vTzDzweMA== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5003594" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5003594" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 21:02:51 -0800 X-CSE-ConnectionGUID: nh8eSxQ9T72n3htttLjDeA== X-CSE-MsgGUID: sBu6C8G2RCCDzIZ8WcODkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13918972" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by fmviesa001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 21:02:49 -0800 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx902.amr.corp.intel.com (10.18.126.91) 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 21:02:49 -0800 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) by FMSMSX903.amr.corp.intel.com (10.18.126.92) 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 21:02:49 -0800 Received: from BN8PR05CU002.outbound.protection.outlook.com (52.101.57.46) by edgegateway.intel.com (192.55.55.82) 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 21:02:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sjpPx5AM1+uKXr/kTbN1Zv+cH7UujpW5ONa53i3lSPO+zF0K2Z6p730N2pw14ZdHef5FuAYn1sznJgMMP3g/qAvn4UpI0dH7q9C0i1PFKFRPiD6rdGFwlxJnO0tJ6NKch5knMJj4aLJu3IPcK0pcJ8NdeoKdiNCPizE4Xh/LlGHb8zFkgrXvpSpm0hOlj7wfzeLZAc4sDLaEPMapFmlGi6+LCosAAw6zUFdVdbQI2vQi6dP7xphkO34m69j6lP53K6uvOjmVpxOhV67LJMXb1HmiRuweZxfcTfkxaVMH9z1q2hDry4typ50iEAgITN3huCXeUuj/GQdCLG4MPfRBuA== 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=3i6uzqrWBvBNAdTlFiGNr3xBl0wkwnQRPyPYuREIASE=; b=RxlZGACkEUEucE9QHLS5FZZg/cpE7vvY1JESYQ1hgYSA0cSIjj3IGD+WDSOE7+XrfX8R0+KIHnKaU4+RIg/GUWqSU9uMVkBzQ7L357UEZ6aZuOG6h/v/cYynfMG/QFgVCMxZT7lladonAAcLbU2QNiNvYUj17bjkg+eRrVGmwK8s++oK+uHORmT9GcqvQ4isPcQxrtbYb0jO03YF2d5GTk7G++GZzEPtFdLS5URnII5moTEiFjbPmnmAAoQnuO/8u2hnmdlFsSGZNX3EZET2g4XSx626VX5aA9pKkIoUyjZVR+A/1W0KtuvsLzb14QcYuMopfpNlqhmuzEpQUtX//Q== 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 LY0PR11MB041356.namprd11.prod.outlook.com (2603:10b6:404:215::12) 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 05:02:46 +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 05:02:46 +0000 Message-ID: <24dc23f5-7116-4dd8-9761-a8fee40215be@intel.com> Date: Tue, 1 Dec 2026 21:02:42 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 13/19] x86,fs/resctrl: Add CPU hotplug support for kernel mode To: Babu Moger , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <79684ccf-9b77-4c2c-8f86-0fee306a8745@amd.com> Content-Language: en-US From: Reinette Chatre In-Reply-To: <79684ccf-9b77-4c2c-8f86-0fee306a8745@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW4P222CA0017.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::22) 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_|LY0PR11MB041356:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c68b5ee-a62d-4560-4a7e-08df5031812e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|23010399003|366016|22082099003|10067099003|56012099006|261028144727099003|261102123227099003|261021121427099003|261026121527099003|261022075727099003|261022105027099003|261026140227099003|261009223027099003|5023799004|11063799006|4143699003|18002099003|6133799003; X-Microsoft-Antispam-Message-Info: pWB7lC0vok3ahDdTgIh3skviqBiCAoRsrLdrNPifJ0d0a70zt0nKia58hgdavcf5NHEtC9TQHJz/Rb8cWQ0lDcVZGs6DelxagwDxA8zd9p136zYO0SR7t2lFRtttFdy2CLG+jisdV8lUVPv56MtHlXHOUW9yrkQzySYmcgAXCDTZik1wRLm55ds1HiSMzMw0gzX6nQ8OYsDpHEIG+sopJV/S4Qw9p53pcSGPnGj65Y0XVIySalD6JeHOKWoJkk1v7nC5628j8KrKTjFY/Hs2PX9xaSDHhnXhZjhWipBoZPU/BQEJj9nROQK4katwS5uqWqtBnJgcLbcYRCSrLYTmYBe9Oq4QbnQpLqvBUmbNe5hmcusZp9JMXNOLCR2UBWC+RMCqZ7eVJl6oBu3d+fbxn7IQ+qy+BQJjzBa7e0J+RT3w17bOgObymSsPCEQuNg0y+I+DZ8C9d86ru94m6zZas++uoLjf8b+LPbRH/7KNIq4V/w7T5PW1IDrIrxwPQS+B3BZXr928xvDDBANgGgbyNXYpA45rXO/IH/QmJq8eGLmqmxDvoRNIHqoxphewDovcxUaqvYQGI0R4JdwIU+dbm06fPlEbOeHyCy85Hk41KIzD3bL3bHHUnvBI4yMqe998nmNmuJy9puyGEAC6IKgT+a6E1cJhkpL+QlqF3ULlYj0= 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)(1800799024)(7416014)(376014)(23010399003)(366016)(22082099003)(10067099003)(56012099006)(261028144727099003)(261102123227099003)(261021121427099003)(261026121527099003)(261022075727099003)(261022105027099003)(261026140227099003)(261009223027099003)(5023799004)(11063799006)(4143699003)(18002099003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QkRwNHQ0UWVOc215Znh0T0JSMkl0SFdIZ2NmNzZjNExQWXp5SzZ5OTdYcWlS?= =?utf-8?B?N3luUmlNM0dKTEVDZ044USthUThDUCtkVHIrck1SRDlGRDZZT3VaZmR1YVM3?= =?utf-8?B?S1pNQW1uUVpVQy9XTkFIcXVSY1pqOEo5eUVqK2tacVFZT1Yvc1FuQjdXSGlD?= =?utf-8?B?WDBrazU2c0hyQ214Vlk5TmFDd1o1alhVZUVzVmR6c1dzL2VTZmdrZlJYekJU?= =?utf-8?B?d2hBS1I0VmdCUUE2bWNYTUlKVXlGMzBmUjdGOXBoMURsUFRqTkdmVWNLTnhl?= =?utf-8?B?MXBnNDJhTW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v?= =?utf-8?B?RXdlQXB1TU5PT3k2V1dodldoSkpsN2JyWWxzRUdiYmdRb3NBS1EwSjZFMzNo?= =?utf-8?B?ZmpZdUJMbkFxVHJOWTlSNStUUk93TXJ4ZzU0TVIreDUzcFFDOUJlSTZuLy9J?= =?utf-8?B?Q3FKdXZkd0tSdGgyd3RIb1JybVlYRUxHQzJiU0pUMGtVODJvR2JQb1VGQUVX?= =?utf-8?B?eWk1NUl5NURodlhyNWpLYjVCSUdHTGNnazVndVRYQ0JVV1BtY1Z5ajVNd3pY?= =?utf-8?Q?yWx1wChBmauCH4+s=3D?= X-Exchange-RoutingPolicyChecked: UcLJfAi5oO3CYynBWa/oN24vX3ck5SzSRuNDtFF0qcYANWS1XmPtAnKeIZd3abnl4Fu1zIY5hTNIIVcnW5t5ZaFsu0hsBo+LgnqUSi9ibwS1QHldSj1bBeXtEq/fG99W50uBfemIB4ECysqo3c5jC2c+JtQsIW4f/fdTAX7Y3bV4vR+jWf6W7oz8FDFCKhc74NHv0C2o+wveac6xg0SkHm/0k4GeUNlirR1JuVgrSm45bBfyVW1g3H5aA6bdkOrD35AMnQFwx4BnkKjq75gi5qWNTUVfe9bXKAaBePBTc8qNh4aiw7ikqeqdn1CYzLj8gygwH/bwPzN9SPlY3gd+Eg== X-MS-Exchange-CrossTenant-Network-Message-Id: 8c68b5ee-a62d-4560-4a7e-08df5031812e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB8370.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 05:02:46.2493 (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: OhJb9pMUBBwa9AvwwEN2t1g3xNR9X2Q0Y5BR5hlpNEdOc4EfMN4C3Mfb3QLAQcbnYyjp1uEO6V5mhrtI073XRhObv4nkgxLdTg9W+7kQtCs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LY0PR11MB041356 X-OriginatorOrg: intel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_210251_813320_EE086AD6 X-CRM114-Status: GOOD ( 21.69 ) 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=-12.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_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/16/26 12:08 PM, Babu Moger wrote: > On 11/11/26 16:44, Babu Moger wrote: ... >> diff --git a/arch/x86/kernel/cpu/resctrl/core.c > b/arch/x86/kernel/cpu/resctrl/core.c >> index fc59d66f77de1..33965b760aed0 100644 >> --- a/arch/x86/kernel/cpu/resctrl/core.c >> +++ b/arch/x86/kernel/cpu/resctrl/core.c >> @@ -735,6 +735,9 @@ static void clear_closid_rmid(int cpu) >>      state->cur_closid = RESCTRL_RESERVED_CLOSID; >>      state->cur_rmid = RESCTRL_RESERVED_RMID; >>      wrmsrq(MSR_IA32_PQR_ASSOC, val.q); >> + >> +    if (boot_cpu_has(X86_FEATURE_PLZA)) >> +        wrmsrq(MSR_IA32_PQR_PLZA_ASSOC, 0); >>  } > > Does zeroing MSR_IA32_PQR_PLZA_ASSOC in clear_closid_rmid() clobber the > domain's active PLZA configuration during CPU hotplug? > > When a CPU goes offline while RESCTRL_GLOBAL_ENABLE_PER_CPU is active, > resctrl_arch_offline_cpu() first runs resctrl_offline_cpu() -> > resctrl_kmode_global_offline_cpu(), which clears plza_en while preserving rmid, rmid_en, closid, and closid_en in MSR_IA32_PQR_PLZA_ASSOC (or leaves the MSR untouched if the CPU was not in kmode_cpu_mask). Immediately afterward, resctrl_arch_offline_cpu() calls clear_closid_rmid() and writes 0 to MSR_IA32_PQR_PLZA_ASSOC: > > arch/x86/kernel/cpu/resctrl/core.c:resctrl_arch_offline_cpu() { >     ... >     resctrl_offline_cpu(cpu); > >     mutex_lock(&domain_list_lock); >     for_each_capable_rdt_resource(r) >         domain_remove_cpu(cpu, r); >     mutex_unlock(&domain_list_lock); > >     clear_closid_rmid(cpu); >     ... > } > > That overwrites the MSR value just programmed by > resctrl_kmode_global_offline_cpu() and zeroes rmid, rmid_en, closid, and > closid_en on the offlined CPU while other CPUs in the same QoS domain > still have the active kernel mode configuration programmed, violating the hardware requirement documented for union msr_pqr_plza_assoc that all fields except plza_en must I do not believe any implementation can ensure that offline CPUs have the same configuration as online CPUs. be programmed identically across every CPU in a QoS domain. During CPU online, resctrl_arch_online_cpu() likewise calls clear_closid_rmid() after domain_add_cpu() and before resctrl_online_cpu() takes rdtgroup_mutex to program the active configuration. > ======================================================================= > > Yes. This is an issue. We cannot write 0 to MSR_IA32_PQR_PLZA_ASSOC in hotplug handler. > > Couple of options: > > 1. Introduce the reboot notifier for resctrl and clear MSR_IA32_PQR_PLZA_ASSOC. Reboot notifier is called during kexec reboot. Shouldn't new kernel anyway run all the CPU online handlers that should reconfigure the kernel mode? > > or > > 2. Just clear the PLZA_EN bit in clear_closid_rmid(). >    if (boot_cpu_has(X86_FEATURE_PLZA)) >        msr_clear_bit(MSR_IA32_PQR_PLZA_ASSOC, PLZA_EN); This still leaves all the old fields in place, no? I am considering the following scenario: - User activates global_enable_per_cpu with group A and then switches to inherit_user. - Every online CPU still holds A's CLOSID/RMID in PLZA_ASSOC (plza_en = 0). - Nothing records that system is still configured with A's properties. - A CPU that comes online later gets 0 from clear_closid_rmid(), and resctrl_kmode_global_online_cpu() returns early because the mode is inactive. That CPU now differs from all the others, permanently. - A can later be removed and its CLOSID/RMID reused, while the PLZA_ASSOC still hold them. I think a problem is that rdtgroup_kmode_global_deactivate() deactivates the kernel mode using the now-unused resource group's properties as values and then restores the driver state to defaults. After this, what is programmed on hardware and what is stored in resctrl disagrees. I believe the rule should be "every online CPU holds the current configuration, and only plza_en differs per CPU". To accomplish this I think the deactivate path needs to change to reset to defaults and to program the defaults to *all* online CPUs, not just those associated with the kernel mode. To accomplish this I think there is a need for a new "reset" helper that can be done without a new arch helper and can look something like: static void resctrl_reset_kmode_global(const struct cpumask *mask) { resctrl_arch_configure_kmode_global(mask, RESCTRL_RESERVED_CLOSID, false, RESCTRL_RESERVED_RMID, false, false); } Above helper can be called on all online CPUs when kernel mode is deactivated, and per-CPU on the CPU going offline. The kexec scenarios are not quite clear to me and it will be helpful if the changelog can elaborate what is required here. If, for example, a PLZA enabled kernel boots first and is used, follows by a PLZA disabled kernel, the second kernel will not set RESCTRL_GLOBAL_ENABLE_PER_CPU. In this case there may be a need for the arch driver to do some reset, which is why I *guess* this patch uses boot_cpu_has(). If this is the case there really needs to be more descriptions and comments to explain, perhaps even as a separate commit? Reinette