* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Fix D-cache corruption in mremap [SPARC64]: Make smp_processor_id() functional before start_kernel()
···10#include <linux/config.h>11#include <linux/version.h>12#include <linux/errno.h>13+#include <linux/threads.h>14#include <asm/thread_info.h>15#include <asm/asi.h>16#include <asm/pstate.h>···492 mov %l6, %o1 ! OpenPROM stack493 call prom_init494 mov %l7, %o0 ! OpenPROM cif handler495+496+ /* Initialize current_thread_info()->cpu as early as possible.497+ * In order to do that accurately we have to patch up the get_cpuid()498+ * assembler sequences. And that, in turn, requires that we know499+ * if we are on a Starfire box or not. While we're here, patch up500+ * the sun4v sequences as well.501+ */502+ call check_if_starfire503+ nop504+ call per_cpu_patch505+ nop506+ call sun4v_patch507+ nop508+509+#ifdef CONFIG_SMP510+ call hard_smp_processor_id511+ nop512+ cmp %o0, NR_CPUS513+ blu,pt %xcc, 1f514+ nop515+ call boot_cpu_id_too_large516+ nop517+ /* Not reached... */518+519+1:520+#else521+ mov 0, %o0522+#endif523+ stb %o0, [%g6 + TI_CPU]524525 /* Off we go.... */526 call start_kernel
+11-12
arch/sparc64/kernel/setup.c
···220221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };222223-static void __init per_cpu_patch(void)224{225 struct cpuid_patch_entry *p;226 unsigned long ver;···280 }281}282283-static void __init sun4v_patch(void)284{285 struct sun4v_1insn_patch_entry *p1;286 struct sun4v_2insn_patch_entry *p2;···315 }316}317000000000318void __init setup_arch(char **cmdline_p)319{320 /* Initialize PROM console and command line. */···340#elif defined(CONFIG_PROM_CONSOLE)341 conswitchp = &prom_con;342#endif343-344- /* Work out if we are starfire early on */345- check_if_starfire();346-347- /* Now we know enough to patch the get_cpuid sequences348- * used by trap code.349- */350- per_cpu_patch();351-352- sun4v_patch();353354 boot_flags_init(*cmdline_p);355