aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-04-25 06:24:16 -0400
committerIngo Molnar <mingo@kernel.org>2012-04-25 06:24:16 -0400
commitcd32b1616bc79b2f2ce1b1c6164beecfecc2259c (patch)
tree2e91c49b5c2bd927b9b74b7414dbb6839af601e1 /arch/x86
parent89b8835ec865dddd6673a8dd7003581bf2377176 (diff)
parenta720b2dd2470a52345df11dca8d6c1466599f812 (diff)
Merge tag 'l3-fix-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp into x86/urgent
A small L3 cache index disable fix from Srivatsa Bhat which unifies the way the code checks for already disabled indices. ( Pulling it into v3.4 despite the v3.5 tag - the fix is small and we better keep the same code across kernel versions for such user facing interfaces. ) Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c8
-rw-r--r--arch/x86/lib/usercopy.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 73d08ed98a6..b8f3653dddb 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -433,14 +433,14 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot,
433 /* check if @slot is already used or the index is already disabled */ 433 /* check if @slot is already used or the index is already disabled */
434 ret = amd_get_l3_disable_slot(nb, slot); 434 ret = amd_get_l3_disable_slot(nb, slot);
435 if (ret >= 0) 435 if (ret >= 0)
436 return -EINVAL; 436 return -EEXIST;
437 437
438 if (index > nb->l3_cache.indices) 438 if (index > nb->l3_cache.indices)
439 return -EINVAL; 439 return -EINVAL;
440 440
441 /* check whether the other slot has disabled the same index already */ 441 /* check whether the other slot has disabled the same index already */
442 if (index == amd_get_l3_disable_slot(nb, !slot)) 442 if (index == amd_get_l3_disable_slot(nb, !slot))
443 return -EINVAL; 443 return -EEXIST;
444 444
445 amd_l3_disable_index(nb, cpu, slot, index); 445 amd_l3_disable_index(nb, cpu, slot, index);
446 446
@@ -468,8 +468,8 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
468 err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val); 468 err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val);
469 if (err) { 469 if (err) {
470 if (err == -EEXIST) 470 if (err == -EEXIST)
471 printk(KERN_WARNING "L3 disable slot %d in use!\n", 471 pr_warning("L3 slot %d in use/index already disabled!\n",
472 slot); 472 slot);
473 return err; 473 return err;
474 } 474 }
475 return count; 475 return count;
diff --git a/arch/x86/lib/usercopy.c b/arch/x86/lib/usercopy.c
index 57252c928f5..d6ae30bbd7b 100644
--- a/arch/x86/lib/usercopy.c
+++ b/arch/x86/lib/usercopy.c
@@ -57,7 +57,7 @@ static inline unsigned long count_bytes(unsigned long mask)
57 * hit it), 'max' is the address space maximum (and we return 57 * hit it), 'max' is the address space maximum (and we return
58 * -EFAULT if we hit it). 58 * -EFAULT if we hit it).
59 */ 59 */
60static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, long max) 60static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
61{ 61{
62 long res = 0; 62 long res = 0;
63 63
@@ -100,7 +100,7 @@ static inline long do_strncpy_from_user(char *dst, const char __user *src, long
100 * too? If so, that's ok - we got as much as the user asked for. 100 * too? If so, that's ok - we got as much as the user asked for.
101 */ 101 */
102 if (res >= count) 102 if (res >= count)
103 return count; 103 return res;
104 104
105 /* 105 /*
106 * Nope: we hit the address space limit, and we still had more 106 * Nope: we hit the address space limit, and we still had more