mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Babu Moger" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Babu Moger <babu.moger@amd.com>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	Reinette Chatre <reinette.chatre@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/cache] x86,fs/resctrl: Detect io_alloc feature
Date: Sat, 22 Nov 2025 15:48:40 -0000	[thread overview]
Message-ID: <176382652022.498.17845526767339022307.tip-bot2@tip-bot2> (raw)
In-Reply-To: <df85a9a6081674fd3ef6b4170920485512ce2ded.1762995456.git.babu.moger@amd.com>

The following commit has been merged into the x86/cache branch of tip:

Commit-ID:     7923ae7698cf9728501974d76d8ea712686281bc
Gitweb:        https://git.kernel.org/tip/7923ae7698cf9728501974d76d8ea712686281bc
Author:        Babu Moger <babu.moger@amd.com>
AuthorDate:    Wed, 12 Nov 2025 18:57:29 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Fri, 21 Nov 2025 22:04:59 +01:00

x86,fs/resctrl: Detect io_alloc feature

AMD's SDCIAE (SDCI Allocation Enforcement) PQE feature enables system software
to control the portions of L3 cache used for direct insertion of data from I/O
devices into the L3 cache.

Introduce a generic resctrl cache resource property "io_alloc_capable" as the
first part of the new "io_alloc" resctrl feature that will support AMD's
SDCIAE. Any architecture can set a cache resource as "io_alloc_capable" if
a portion of the cache can be allocated for I/O traffic.

Set the "io_alloc_capable" property for the L3 cache resource on x86 (AMD)
systems that support SDCIAE.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://patch.msgid.link/df85a9a6081674fd3ef6b4170920485512ce2ded.1762995456.git.babu.moger@amd.com
---
 arch/x86/kernel/cpu/resctrl/core.c | 7 +++++++
 include/linux/resctrl.h            | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 2b2935b..3792ab4 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -274,6 +274,11 @@ static void rdt_get_cdp_config(int level)
 	rdt_resources_all[level].r_resctrl.cdp_capable = true;
 }
 
+static void rdt_set_io_alloc_capable(struct rdt_resource *r)
+{
+	r->cache.io_alloc_capable = true;
+}
+
 static void rdt_get_cdp_l3_config(void)
 {
 	rdt_get_cdp_config(RDT_RESOURCE_L3);
@@ -855,6 +860,8 @@ static __init bool get_rdt_alloc_resources(void)
 		rdt_get_cache_alloc_cfg(1, r);
 		if (rdt_cpu_has(X86_FEATURE_CDP_L3))
 			rdt_get_cdp_l3_config();
+		if (rdt_cpu_has(X86_FEATURE_SDCIAE))
+			rdt_set_io_alloc_capable(r);
 		ret = true;
 	}
 	if (rdt_cpu_has(X86_FEATURE_CAT_L2)) {
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index a7d9271..533f240 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -206,6 +206,8 @@ struct rdt_mon_domain {
  * @arch_has_sparse_bitmasks:	True if a bitmask like f00f is valid.
  * @arch_has_per_cpu_cfg:	True if QOS_CFG register for this cache
  *				level has CPU scope.
+ * @io_alloc_capable:	True if portion of the cache can be configured
+ *			for I/O traffic.
  */
 struct resctrl_cache {
 	unsigned int	cbm_len;
@@ -213,6 +215,7 @@ struct resctrl_cache {
 	unsigned int	shareable_bits;
 	bool		arch_has_sparse_bitmasks;
 	bool		arch_has_per_cpu_cfg;
+	bool		io_alloc_capable;
 };
 
 /**

  reply	other threads:[~2025-11-22 15:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  0:57 [PATCH v12 00/10] x86,fs/resctrl: Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) Babu Moger
2025-11-13  0:57 ` [PATCH v12 01/10] x86/cpufeatures: Add support for L3 Smart Data Cache Injection Allocation Enforcement Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 02/10] x86/resctrl: Add SDCIAE feature in the command line options Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 03/10] x86,fs/resctrl: Detect io_alloc feature Babu Moger
2025-11-22 15:48   ` tip-bot2 for Babu Moger [this message]
2025-11-13  0:57 ` [PATCH v12 04/10] x86,fs/resctrl: Implement "io_alloc" enable/disable handlers Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 05/10] fs/resctrl: Introduce interface to display "io_alloc" support Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 06/10] fs/resctrl: Add user interface to enable/disable io_alloc feature Babu Moger
2025-11-20 18:35   ` Babu Moger
2025-11-21  4:40     ` Reinette Chatre
2025-11-21 14:04       ` Babu Moger
2025-11-21  4:41   ` Reinette Chatre
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 07/10] fs/resctrl: Introduce interface to display io_alloc CBMs Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 08/10] fs/resctrl: Modify struct rdt_parse_data to pass mode and CLOSID Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 09/10] fs/resctrl: Introduce interface to modify io_alloc capacity bitmasks Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-13  0:57 ` [PATCH v12 10/10] fs/resctrl: Update bit_usage to reflect io_alloc Babu Moger
2025-11-22 15:48   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2025-11-21 16:05 ` [PATCH v12 00/10] x86,fs/resctrl: Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) Reinette Chatre
2025-11-21 17:27   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176382652022.498.17845526767339022307.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®