Skip to content

Commit 3024e4a

Browse files
committed
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: oprofile: don't set counter width from cpuid on Core2 x86: fix init_memory_mapping() to handle small ranges
2 parents f2a4165 + 780eef9 commit 3024e4a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

arch/x86/mm/init_64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
714714
pos = start_pfn << PAGE_SHIFT;
715715
end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
716716
<< (PMD_SHIFT - PAGE_SHIFT);
717+
if (end_pfn > (end >> PAGE_SHIFT))
718+
end_pfn = end >> PAGE_SHIFT;
717719
if (start_pfn < end_pfn) {
718720
nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
719721
pos = end_pfn << PAGE_SHIFT;

arch/x86/oprofile/op_model_ppro.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
7878
if (cpu_has_arch_perfmon) {
7979
union cpuid10_eax eax;
8080
eax.full = cpuid_eax(0xa);
81-
if (counter_width < eax.split.bit_width)
82-
counter_width = eax.split.bit_width;
81+
82+
/*
83+
* For Core2 (family 6, model 15), don't reset the
84+
* counter width:
85+
*/
86+
if (!(eax.split.version_id == 0 &&
87+
current_cpu_data.x86 == 6 &&
88+
current_cpu_data.x86_model == 15)) {
89+
90+
if (counter_width < eax.split.bit_width)
91+
counter_width = eax.split.bit_width;
92+
}
8393
}
8494

8595
/* clear all counters */

0 commit comments

Comments
 (0)