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/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag
Date: Tue, 24 Jan 2023 09:26:38 -0000 [thread overview]
Message-ID: <167455239836.4906.13232602625549629109.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230113152039.770054-3-babu.moger@amd.com>
The following commit has been merged into the x86/cache branch of tip:
Commit-ID: f334f723a63cfc25789b1cdf70a08ffbaea4bf2e
Gitweb: https://git.kernel.org/tip/f334f723a63cfc25789b1cdf70a08ffbaea4bf2e
Author: Babu Moger <babu.moger@amd.com>
AuthorDate: Fri, 13 Jan 2023 09:20:28 -06:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 23 Jan 2023 17:38:17 +01:00
x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag
Add the new AMD feature X86_FEATURE_SMBA. With it, the QOS enforcement policies
can be applied to external slow memory connected to the host. QOS enforcement is
accomplished by assigning a Class Of Service (COS) to a processor and specifying
allocations or limits for that COS for each resource to be allocated.
This feature is identified by the CPUID function 0x8000_0020_EBX_x0[2]:
L3SBE - L3 external slow memory bandwidth enforcement.
CXL.memory is the only supported "slow" memory device. With SMBA, the hardware
enables bandwidth allocation on the slow memory devices. If there are multiple
slow memory devices in the system, then the throttling logic groups all the slow
sources together and applies the limit on them as a whole.
The presence of the SMBA feature (with CXL.memory) is independent of whether
slow memory device is actually present in the system. If there is no slow memory
in the system, then setting a SMBA limit will have no impact on the performance
of the system.
Presence of CXL memory can be identified by the numactl command:
$numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
node 0 size: 63678 MB node 0 free: 59542 MB
node 1 cpus:
node 1 size: 16122 MB
node 1 free: 15627 MB
node distances:
node 0 1
0: 10 50
1: 50 10
CPU list for CXL memory will be empty. The cpu-cxl node distance is greater than
cpu-to-cpu distances. Node 1 has the CXL memory in this case. CXL memory can
also be identified using ACPI SRAT table and memory maps.
Feature description is available in the specification, "AMD64 Technology
Platform Quality of Service Extensions, Revision: 1.03 Publication # 56375
Revision: 1.03 Issue Date: February 2022" at
https://bugzilla.kernel.org/attachment.cgi?id=301365
See also https://www.amd.com/en/support/tech-docs/amd64-technology-platform-quality-service-extensions
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://lore.kernel.org/r/20230113152039.770054-3-babu.moger@amd.com
---
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/kernel/cpu/scattered.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 6101247..3f5f64b 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -307,6 +307,7 @@
#define X86_FEATURE_SGX_EDECCSSA (11*32+18) /* "" SGX EDECCSSA user leaf function */
#define X86_FEATURE_CALL_DEPTH (11*32+19) /* "" Call depth tracking for RSB stuffing */
#define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */
+#define X86_FEATURE_SMBA (11*32+21) /* "" Slow Memory Bandwidth Allocation */
/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
#define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index f53944f..d925753 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -45,6 +45,7 @@ static const struct cpuid_bit cpuid_bits[] = {
{ X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },
{ X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 },
{ X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 },
+ { X86_FEATURE_SMBA, CPUID_EBX, 2, 0x80000020, 0 },
{ X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 },
{ X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 },
{ 0, 0, 0, 0, 0 }
next prev parent reply other threads:[~2023-01-24 9:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 15:20 [PATCH v12 00/13] x86/resctrl: Support for AMD QoS new features Babu Moger
2023-01-13 15:20 ` [PATCH v12 01/13] x86/resctrl: Replace smp_call_function_many() with on_each_cpu_mask() Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 02/13] x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag Babu Moger
2023-01-24 9:26 ` tip-bot2 for Babu Moger [this message]
2023-01-13 15:20 ` [PATCH v12 03/13] x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 04/13] x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 05/13] x86/resctrl: Include new features in command line options Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 06/13] x86/resctrl: Detect and configure Slow Memory Bandwidth Allocation Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 07/13] x86/resctrl: Add __init attribute to rdt_get_mon_l3_config() Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 08/13] x86/resctrl: Support monitor configuration Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 09/13] x86/resctrl: Add interface to read mbm_total_bytes_config Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 10/13] x86/resctrl: Add interface to read mbm_local_bytes_config Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 11/13] x86/resctrl: Add interface to write mbm_total_bytes_config Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 12/13] x86/resctrl: Add interface to write mbm_local_bytes_config Babu Moger
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-13 15:20 ` [PATCH v12 13/13] Documentation/x86: Update resctrl.rst for new features Babu Moger
2023-01-17 22:11 ` Reinette Chatre
2023-01-24 9:26 ` [tip: x86/cache] " tip-bot2 for Babu Moger
2023-01-17 22:16 ` [PATCH v12 00/13] x86/resctrl: Support for AMD QoS " Reinette Chatre
2023-01-18 16:36 ` Moger, Babu
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=167455239836.4906.13232602625549629109.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®