Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5392
b: refs/heads/master
c: e2cac78
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jul 29, 2005
1 parent 844b471 commit 7f00f97
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 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: b6a68a16dc15c65fe76acb7502a806ae415cd3e4
refs/heads/master: e2cac78935ff1705e1eb53be28da704d3482b4f5
20 changes: 14 additions & 6 deletions trunk/arch/i386/kernel/cpu/intel_cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_le
cpuid_count(4, index, &eax, &ebx, &ecx, &edx);
cache_eax.full = eax;
if (cache_eax.split.type == CACHE_TYPE_NULL)
return -1;
return -EIO; /* better error ? */

this_leaf->eax.full = eax;
this_leaf->ebx.full = ebx;
Expand Down Expand Up @@ -334,6 +334,7 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
struct _cpuid4_info *this_leaf;
unsigned long j;
int retval;
cpumask_t oldmask;

if (num_cache_leaves == 0)
return -ENOENT;
Expand All @@ -345,19 +346,26 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
memset(cpuid4_info[cpu], 0,
sizeof(struct _cpuid4_info) * num_cache_leaves);

oldmask = current->cpus_allowed;
retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
if (retval)
goto out;

/* Do cpuid and store the results */
retval = 0;
for (j = 0; j < num_cache_leaves; j++) {
this_leaf = CPUID4_INFO_IDX(cpu, j);
retval = cpuid4_cache_lookup(j, this_leaf);
if (unlikely(retval < 0))
goto err_out;
break;
cache_shared_cpu_map_setup(cpu, j);
}
return 0;
set_cpus_allowed(current, oldmask);

err_out:
free_cache_attributes(cpu);
return -ENOMEM;
out:
if (retval)
free_cache_attributes(cpu);
return retval;
}

#ifdef CONFIG_SYSFS
Expand Down

0 comments on commit 7f00f97

Please sign in to comment.