]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/resctrl: Remove hard-coded memory bandwidth limit
authorBabu Moger <babu.moger@amd.com>
Mon, 15 Jan 2024 22:52:27 +0000 (16:52 -0600)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:19 +0000 (18:19 -0400)
commit655f231bde27f5201b5d35a95bc39f26e34899a3
tree16d7fa443d553bc34f82b39942622d8f84c84c95
parent325956b0173f11e98f90462be4829a8b8b0682ce
x86/resctrl: Remove hard-coded memory bandwidth limit

[ Upstream commit 0976783bb123f30981bc1e7a14d9626a6f63aeac ]

The QOS Memory Bandwidth Enforcement Limit is reported by
CPUID_Fn80000020_EAX_x01 and CPUID_Fn80000020_EAX_x02:

  Bits  Description
  31:0  BW_LEN: Size of the QOS Memory Bandwidth Enforcement Limit.

Newer processors can support higher bandwidth limit than the current
hard-coded value. Remove latter and detect using CPUID instead. Also,
update the register variables eax and edx to match the AMD CPUID
definition.

The CPUID details are documented in the Processor Programming Reference
(PPR) Vol 1.1 for AMD Family 19h Model 11h B1 - 55901 Rev 0.25 in the
Link tag below.

Fixes: 4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature")
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://bugzilla.kernel.org/show_bug.cgi?id=206537
Link: https://lore.kernel.org/r/c26a8ca79d399ed076cf8bf2e9fbc58048808289.1705359148.git.babu.moger@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/resctrl/core.c
arch/x86/kernel/cpu/resctrl/internal.h