From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 BD6362DCC1F for ; Sun, 2 Aug 2026 16:15:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785687347; cv=none; b=skUW3AyrHggyP/ta/Eo2O/2aIRaOA49c71Cn0OtbBLrNCE7eifr/+wB7UaTFVjT1azeKmfg0S5+cDx7XH7iAamJxYlkMIgsdpL5wC5tcE4VOX1r5brNc/DTQfUfnsVA3aZz8l3DhlO1cXxEXAk/hLRYbuC4t1X2wUKvN+593BDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785687347; c=relaxed/simple; bh=p+bEwVmT6GttoMAiLTG1Q4R/bMAzEQEeiM8PJ+YWp6c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l6GDOmWF2cFdF1wbOsf0exyptoSNaoi9suKtyuthLUR3kN7qinXkJscLsnOAID20ddw8w7I+D+LQKTy6BNsKCFdLo9DBsdyNu87IWiDBxS4Q2IZPz8ZWQm9zM/VT/U2QxnaKeiR9h+a2pT4eqEZD6pntc/XzrFaA0H/KU+hw3XQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DlId9Hg4; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DlId9Hg4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785687346; x=1817223346; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p+bEwVmT6GttoMAiLTG1Q4R/bMAzEQEeiM8PJ+YWp6c=; b=DlId9Hg4B0wy4bhAe36+yzfP7niNyd1yVebstda8QgRVTzPqq5hL3BsZ Uys5rmrTd7w+653VDQKsWYfTbCLPHmwdYqhtPgSy47x0fzl+qwxlhCovw n0HIviVLDWm+TEW/y2gARBEHRfEknK50x72wjT2E0SJlpfWFc5kTlWOt3 QREIKgB2hNNqrpKdLvUu3uNLE6ANDb3lXMzjAkI5oVQPsNEOusbdVX5s4 OkJUZ5irr6TqV/R8e2u2erKoVSLkgV9TuSjUBkUpnmiYtUVX04H2Jm/ys zeLU9dxOifiB9Nfau70ybjF219fz/fR9A2eK9wsIPamypxkvhw1R1RxGg A==; X-CSE-ConnectionGUID: 9PuGFt8GQuO+m2cA6xl43A== X-CSE-MsgGUID: he28pvK/RSeNSrtr368wsw== X-IronPort-AV: E=McAfee;i="6800,10657,11863"; a="97612377" X-IronPort-AV: E=Sophos;i="6.25,200,1779174000"; d="scan'208";a="97612377" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2026 09:15:45 -0700 X-CSE-ConnectionGUID: Ngw6A4PTT5qdpkGf46f0XA== X-CSE-MsgGUID: 62xjjWOgTI2X2EHIlwuPdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,200,1779174000"; d="scan'208";a="261068739" Received: from chenyu-dev.sh.intel.com ([10.239.62.107]) by orviesa007.jf.intel.com with ESMTP; 02 Aug 2026 09:15:43 -0700 From: Chen Yu To: Reinette Chatre , Tony Luck Cc: Ben Horgan , "James Morse" , Dave Martin , Babu Moger , Fenghua Yu , Borislav Petkov , Thomas Gleixner , "Dave Hansen" , Peter Newman , chen.yu@linux.dev, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 14/31] x86/resctrl: Add emulation controller list to resctrl_ctrl Date: Mon, 3 Aug 2026 00:06:01 +0800 Message-Id: X-Mailer: git-send-email 2.25.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: 8bit There is a requirement to emulate Controller A using a set of other controllers. The purpose is to either supply hierarchy information in the schema info directory or emulate legacy controllers via the new controllers for backward compatibility. A legacy controller can be emulated by more than one controller. For example, on region aware platforms the legacy MBA control is emulated by the MAX control of every available memory region. Track the emulating controllers on a list anchored at resctrl_ctrl::emul, linked via resctrl_ctrl::emul_entry. Signed-off-by: Chen Yu --- arch/x86/kernel/cpu/resctrl/core.c | 4 ++++ include/linux/resctrl.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index f0e30f22576c..a7322f0ebaea 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -167,6 +167,7 @@ static inline void cache_alloc_hsw_probe(void) hw_ctrl->r_ctrl.type = RESCTRL_CTRL_BITMAP; hw_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF; INIT_LIST_HEAD(&hw_ctrl->r_ctrl.domains); + INIT_LIST_HEAD(&hw_ctrl->r_ctrl.emul); hw_ctrl->r_ctrl.bitmap.cbm_len = 20; hw_ctrl->r_ctrl.bitmap.shareable_bits = 0xc0000; hw_ctrl->r_ctrl.bitmap.min_cbm_bits = 2; @@ -205,6 +206,7 @@ static __init bool __get_mem_config_intel(struct rdt_resource *r) hw_ctrl->r_ctrl.type = RESCTRL_CTRL_SCALAR; hw_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF; INIT_LIST_HEAD(&hw_ctrl->r_ctrl.domains); + INIT_LIST_HEAD(&hw_ctrl->r_ctrl.emul); hw_ctrl->r_ctrl.scalar.max_bw = MAX_MBA_BW; hw_ctrl->r_ctrl.scalar.min_bw = MAX_MBA_BW - max_delay; @@ -260,6 +262,7 @@ static __init bool __rdt_get_mem_config_amd(struct rdt_resource *r) hw_ctrl->r_ctrl.type = RESCTRL_CTRL_SCALAR; hw_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF; INIT_LIST_HEAD(&hw_ctrl->r_ctrl.domains); + INIT_LIST_HEAD(&hw_ctrl->r_ctrl.emul); hw_ctrl->r_ctrl.scalar.max_bw = BIT(eax); @@ -313,6 +316,7 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt_resource *r) hw_ctrl->r_ctrl.type = RESCTRL_CTRL_BITMAP; hw_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF; INIT_LIST_HEAD(&hw_ctrl->r_ctrl.domains); + INIT_LIST_HEAD(&hw_ctrl->r_ctrl.emul); hw_ctrl->r_ctrl.bitmap.cbm_len = eax.split.cbm_len + 1; default_ctrl = BIT_MASK(eax.split.cbm_len + 1) - 1; diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index b2af0664cce7..e8da30a71e13 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -378,6 +378,8 @@ enum resctrl_ctrl_name { * visibility via the resource_schemata info directory. * @bitmap: Bitmap control properties. * @scalar: Scalar control properties. + * @emul: List of controls that emulate the current control. + * @emul_entry: List entry of the emulated control's resctrl_ctrl::emul. */ struct resctrl_ctrl { struct list_head entry; @@ -390,6 +392,8 @@ struct resctrl_ctrl { struct resctrl_ctrl_bitmap bitmap; struct resctrl_ctrl_scalar scalar; }; + struct list_head emul; + struct list_head emul_entry; }; /** -- 2.43.0