Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245654
b: refs/heads/master
c: 42be450
h: refs/heads/master
v: v3
  • Loading branch information
Frank Arnold authored and H. Peter Anvin committed May 16, 2011
1 parent 2167112 commit d9c38c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50e7534427283afd997d58481778c07bea79eb63
refs/heads/master: 42be450565b0fc4607fae3e3a7da038d367a23ed
19 changes: 4 additions & 15 deletions trunk/arch/x86/kernel/cpu/intel_cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,27 +453,16 @@ int amd_set_l3_disable_slot(struct amd_l3_cache *l3, int cpu, unsigned slot,
{
int ret = 0;

#define SUBCACHE_MASK (3UL << 20)
#define SUBCACHE_INDEX 0xfff

/*
* check whether this slot is already used or
* the index is already disabled
*/
/* check if @slot is already used or the index is already disabled */
ret = amd_get_l3_disable_slot(l3, slot);
if (ret >= 0)
return -EINVAL;

/*
* check whether the other slot has disabled the
* same index already
*/
if (index == amd_get_l3_disable_slot(l3, !slot))
if (index > l3->indices)
return -EINVAL;

/* do not allow writes outside of allowed bits */
if ((index & ~(SUBCACHE_MASK | SUBCACHE_INDEX)) ||
((index & SUBCACHE_INDEX) > l3->indices))
/* check whether the other slot has disabled the same index already */
if (index == amd_get_l3_disable_slot(l3, !slot))
return -EINVAL;

amd_l3_disable_index(l3, cpu, slot, index);
Expand Down

0 comments on commit d9c38c6

Please sign in to comment.