Skip to content

Commit 74c75f5

Browse files
committed
Merge branch 'x86-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: cpu_index build fix x86/voyager: fix missing cpu_index initialisation x86/voyager: fix compile breakage caused by dc1e35c x86: fix /dev/mem mmap breakage when PAT is disabled x86/voyager: fix compile breakage casued by x86: move prefill_possible_map calling early x86: use CONFIG_X86_SMP instead of CONFIG_SMP x86/voyager: fix boot breakage caused by x86: boot secondary cpus through initial_code x86, uv: fix compile error in uv_hub.h i386/PAE: fix pud_page() x86: remove debug code from arch_add_memory() x86: start annotating early ioremap pointers with __iomem x86: two trivial sparse annotations x86: fix init_memory_mapping for [dc000000 - e0000000) - v2
2 parents 0b23e30 + 1c4acdb commit 74c75f5

14 files changed

Lines changed: 85 additions & 40 deletions

File tree

‎arch/x86/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ config SMP
231231

232232
If you don't know what to do here, say N.
233233

234+
config X86_HAS_BOOT_CPU_ID
235+
def_bool y
236+
depends on X86_VOYAGER
237+
234238
config X86_FIND_SMP_CONFIG
235239
def_bool y
236240
depends on X86_MPPARSE || X86_VOYAGER

‎arch/x86/include/asm/io.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size);
8282
extern void early_ioremap_init(void);
8383
extern void early_ioremap_clear(void);
8484
extern void early_ioremap_reset(void);
85-
extern void *early_ioremap(unsigned long offset, unsigned long size);
86-
extern void *early_memremap(unsigned long offset, unsigned long size);
87-
extern void early_iounmap(void *addr, unsigned long size);
85+
extern void __iomem *early_ioremap(unsigned long offset, unsigned long size);
86+
extern void __iomem *early_memremap(unsigned long offset, unsigned long size);
87+
extern void early_iounmap(void __iomem *addr, unsigned long size);
8888
extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
8989

9090

‎arch/x86/include/asm/pgtable-3level.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ static inline void pud_clear(pud_t *pudp)
120120
write_cr3(pgd);
121121
}
122122

123-
#define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK))
123+
#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
124124

125125
#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK))
126126

127127

128128
/* Find an entry in the second-level page table.. */
129-
#define pmd_offset(pud, address) ((pmd_t *)pud_page(*(pud)) + \
129+
#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \
130130
pmd_index(address))
131131

132132
#ifdef CONFIG_SMP

‎arch/x86/include/asm/smp.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,11 @@ static inline int hard_smp_processor_id(void)
225225

226226
#endif /* CONFIG_X86_LOCAL_APIC */
227227

228+
#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
229+
extern unsigned char boot_cpu_id;
230+
#else
231+
#define boot_cpu_id 0
232+
#endif
233+
228234
#endif /* __ASSEMBLY__ */
229235
#endif /* _ASM_X86_SMP_H */

‎arch/x86/include/asm/uv/uv_hub.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/numa.h>
1515
#include <linux/percpu.h>
16+
#include <linux/timer.h>
1617
#include <asm/types.h>
1718
#include <asm/percpu.h>
1819

‎arch/x86/kernel/cpu/addon_cpuid_features.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
6969
*/
7070
void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
7171
{
72-
#ifdef CONFIG_SMP
72+
#ifdef CONFIG_X86_SMP
7373
unsigned int eax, ebx, ecx, edx, sub_index;
7474
unsigned int ht_mask_width, core_plus_mask_width;
7575
unsigned int core_select_mask, core_level_siblings;

‎arch/x86/kernel/cpu/common.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
549549
this_cpu->c_early_init(c);
550550

551551
validate_pat_support(c);
552+
553+
#ifdef CONFIG_SMP
554+
c->cpu_index = boot_cpu_id;
555+
#endif
552556
}
553557

554558
void __init early_cpu_init(void)
@@ -1134,7 +1138,7 @@ void __cpuinit cpu_init(void)
11341138
/*
11351139
* Boot processor to setup the FP and extended state context info.
11361140
*/
1137-
if (!smp_processor_id())
1141+
if (smp_processor_id() == boot_cpu_id)
11381142
init_thread_xstate();
11391143

11401144
xsave_init();

‎arch/x86/kernel/tsc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ __cpuinit int unsynchronized_tsc(void)
759759
if (!cpu_has_tsc || tsc_unstable)
760760
return 1;
761761

762-
#ifdef CONFIG_SMP
762+
#ifdef CONFIG_X86_SMP
763763
if (apic_is_clustered_box())
764764
return 1;
765765
#endif

‎arch/x86/kernel/vsmp_64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf,
7878

7979
static void __init set_vsmp_pv_ops(void)
8080
{
81-
void *address;
81+
void __iomem *address;
8282
unsigned int cap, ctl, cfg;
8383

8484
/* set vSMP magic bits to indicate vSMP capable kernel */

‎arch/x86/mach-voyager/voyager_smp.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static void ack_vic_irq(unsigned int irq);
9090
static void vic_enable_cpi(void);
9191
static void do_boot_cpu(__u8 cpuid);
9292
static void do_quad_bootstrap(void);
93+
static void initialize_secondary(void);
9394

9495
int hard_smp_processor_id(void);
9596
int safe_smp_processor_id(void);
@@ -344,6 +345,12 @@ static void do_quad_bootstrap(void)
344345
}
345346
}
346347

348+
void prefill_possible_map(void)
349+
{
350+
/* This is empty on voyager because we need a much
351+
* earlier detection which is done in find_smp_config */
352+
}
353+
347354
/* Set up all the basic stuff: read the SMP config and make all the
348355
* SMP information reflect only the boot cpu. All others will be
349356
* brought on-line later. */
@@ -413,6 +420,7 @@ void __init smp_store_cpu_info(int id)
413420
struct cpuinfo_x86 *c = &cpu_data(id);
414421

415422
*c = boot_cpu_data;
423+
c->cpu_index = id;
416424

417425
identify_secondary_cpu(c);
418426
}
@@ -650,6 +658,8 @@ void __init smp_boot_cpus(void)
650658
smp_tune_scheduling();
651659
*/
652660
smp_store_cpu_info(boot_cpu_id);
661+
/* setup the jump vector */
662+
initial_code = (unsigned long)initialize_secondary;
653663
printk("CPU%d: ", boot_cpu_id);
654664
print_cpu_info(&cpu_data(boot_cpu_id));
655665

@@ -702,7 +712,7 @@ void __init smp_boot_cpus(void)
702712

703713
/* Reload the secondary CPUs task structure (this function does not
704714
* return ) */
705-
void __init initialize_secondary(void)
715+
static void __init initialize_secondary(void)
706716
{
707717
#if 0
708718
// AC kernels only

0 commit comments

Comments
 (0)