]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.12/x86-cacheinfo-remove-numa-dependency-fix-for-amd-fam10h-rev-d1.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / x86-cacheinfo-remove-numa-dependency-fix-for-amd-fam10h-rev-d1.patch
1 From f619b3d8427eb57f0134dab75b0d217325c72411 Mon Sep 17 00:00:00 2001
2 From: Borislav Petkov <borislav.petkov@amd.com>
3 Date: Thu, 4 Feb 2010 12:09:07 +0100
4 Subject: x86, cacheinfo: Remove NUMA dependency, fix for AMD Fam10h rev D1
5
6 From: Borislav Petkov <borislav.petkov@amd.com>
7
8 commit f619b3d8427eb57f0134dab75b0d217325c72411 upstream.
9
10 The show/store_cache_disable routines depend unnecessarily on NUMA's
11 cpu_to_node and the disabling of cache indices broke when !CONFIG_NUMA.
12 Remove that dependency by using a helper which is always correct.
13
14 While at it, enable L3 Cache Index disable on rev D1 Istanbuls which
15 sport the feature too.
16
17 Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
18 LKML-Reference: <20100218184339.GG20473@aftab>
19 Signed-off-by: H. Peter Anvin <hpa@zytor.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21
22 ---
23 arch/x86/kernel/cpu/intel_cacheinfo.c | 6 +++---
24 1 file changed, 3 insertions(+), 3 deletions(-)
25
26 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
27 +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
28 @@ -327,7 +327,7 @@ amd_check_l3_disable(int index, struct _
29
30 /* see errata #382 and #388 */
31 if ((boot_cpu_data.x86 == 0x10) &&
32 - ((boot_cpu_data.x86_model < 0x9) ||
33 + ((boot_cpu_data.x86_model < 0x8) ||
34 (boot_cpu_data.x86_mask < 0x1)))
35 return;
36
37 @@ -759,7 +759,7 @@ static ssize_t show_cache_disable(struct
38 unsigned int index)
39 {
40 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
41 - int node = cpu_to_node(cpu);
42 + int node = amd_get_nb_id(cpu);
43 struct pci_dev *dev = node_to_k8_nb_misc(node);
44 unsigned int reg = 0;
45
46 @@ -786,7 +786,7 @@ static ssize_t store_cache_disable(struc
47 const char *buf, size_t count, unsigned int index)
48 {
49 int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
50 - int node = cpu_to_node(cpu);
51 + int node = amd_get_nb_id(cpu);
52 struct pci_dev *dev = node_to_k8_nb_misc(node);
53 unsigned long val = 0;
54