Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, mce: Clean up thermal init by introducing intel_thermal_supported() x86, mce: Thermal monitoring depends on APIC being enabled x86: Gart: fix breakage due to IOMMU initialization cleanup x86: Move swiotlb initialization before dma32_free_bootmem x86: Fix build warning in arch/x86/mm/mmio-mod.c x86: Remove usedac in feature-removal-schedule.txt x86: Fix duplicated UV BAU interrupt vector nvram: Fix write beyond end condition; prove to gcc copy is safe mm: Adjust do_pages_stat() so gcc can see copy_from_user() is safe x86: Limit the number of processor bootup messages x86: Remove enabling x2apic message for every CPU doc: Add documentation for bootloader_{type,version} x86, msr: Add support for non-contiguous cpumasks x86: Use find_e820() instead of hard coded trampoline address x86, AMD: Fix stale cpuid4_info shared_map data in shared_cpu_map cpumasks Trivial percpu-naming-introduced conflicts in arch/x86/kernel/cpu/intel_cacheinfo.c
This commit is contained in:
@@ -7,7 +7,6 @@ struct msr_info {
|
||||
u32 msr_no;
|
||||
struct msr reg;
|
||||
struct msr *msrs;
|
||||
int off;
|
||||
int err;
|
||||
};
|
||||
|
||||
@@ -18,7 +17,7 @@ static void __rdmsr_on_cpu(void *info)
|
||||
int this_cpu = raw_smp_processor_id();
|
||||
|
||||
if (rv->msrs)
|
||||
reg = &rv->msrs[this_cpu - rv->off];
|
||||
reg = per_cpu_ptr(rv->msrs, this_cpu);
|
||||
else
|
||||
reg = &rv->reg;
|
||||
|
||||
@@ -32,7 +31,7 @@ static void __wrmsr_on_cpu(void *info)
|
||||
int this_cpu = raw_smp_processor_id();
|
||||
|
||||
if (rv->msrs)
|
||||
reg = &rv->msrs[this_cpu - rv->off];
|
||||
reg = per_cpu_ptr(rv->msrs, this_cpu);
|
||||
else
|
||||
reg = &rv->reg;
|
||||
|
||||
@@ -80,7 +79,6 @@ static void __rwmsr_on_cpus(const struct cpumask *mask, u32 msr_no,
|
||||
|
||||
memset(&rv, 0, sizeof(rv));
|
||||
|
||||
rv.off = cpumask_first(mask);
|
||||
rv.msrs = msrs;
|
||||
rv.msr_no = msr_no;
|
||||
|
||||
@@ -120,6 +118,26 @@ void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs)
|
||||
}
|
||||
EXPORT_SYMBOL(wrmsr_on_cpus);
|
||||
|
||||
struct msr *msrs_alloc(void)
|
||||
{
|
||||
struct msr *msrs = NULL;
|
||||
|
||||
msrs = alloc_percpu(struct msr);
|
||||
if (!msrs) {
|
||||
pr_warning("%s: error allocating msrs\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return msrs;
|
||||
}
|
||||
EXPORT_SYMBOL(msrs_alloc);
|
||||
|
||||
void msrs_free(struct msr *msrs)
|
||||
{
|
||||
free_percpu(msrs);
|
||||
}
|
||||
EXPORT_SYMBOL(msrs_free);
|
||||
|
||||
/* These "safe" variants are slower and should be used when the target MSR
|
||||
may not actually exist. */
|
||||
static void __rdmsr_safe_on_cpu(void *info)
|
||||
|
Reference in New Issue
Block a user