Index: local/arch/i386/kernel/alternative.c =================================================================== --- local.orig/arch/i386/kernel/alternative.c 2006-05-11 20:28:56.000000000 +0200 +++ local/arch/i386/kernel/alternative.c 2006-05-11 20:32:24.000000000 +0200 @@ -118,6 +118,8 @@ void apply_alternatives(struct alt_instr } } +#ifdef CONFIG_SMP + static void alternatives_smp_save(struct alt_instr *start, struct alt_instr *end) { struct alt_instr *a; @@ -283,10 +285,13 @@ void alternatives_smp_switch(int smp) spin_unlock_irqrestore(&smp_alt, flags); } +#endif /* CONFIG_SMP */ + void __init alternative_instructions(void) { apply_alternatives(__alt_instructions, __alt_instructions_end); +#ifdef CONFIG_SMP /* switch to patch-once-at-boottime-only mode and free the * tables in case we know the number of CPUs will never ever * change */ @@ -318,4 +323,5 @@ void __init alternative_instructions(voi _text, _etext); alternatives_smp_switch(0); } +#endif } Index: local/arch/i386/kernel/module.c =================================================================== --- local.orig/arch/i386/kernel/module.c 2006-05-11 20:28:56.000000000 +0200 +++ local/arch/i386/kernel/module.c 2006-05-11 20:29:00.000000000 +0200 @@ -112,12 +112,14 @@ int module_finalize(const Elf_Ehdr *hdr, char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { - if (!strcmp(".text", secstrings + s->sh_name)) - text = s; if (!strcmp(".altinstructions", secstrings + s->sh_name)) alt = s; +#ifdef CONFIG_SMP if (!strcmp(".smp_locks", secstrings + s->sh_name)) locks= s; + if (!strcmp(".text", secstrings + s->sh_name)) + text = s; +#endif } if (alt) { @@ -126,16 +128,20 @@ int module_finalize(const Elf_Ehdr *hdr, apply_alternatives(aseg, aseg + alt->sh_size); } if (locks && text) { +#ifdef CONFIG_SMP void *lseg = (void *)locks->sh_addr; void *tseg = (void *)text->sh_addr; alternatives_smp_module_add(me, me->name, lseg, lseg + locks->sh_size, tseg, tseg + text->sh_size); +#endif } return 0; } void module_arch_cleanup(struct module *mod) { +#ifdef CONFIG_SMP alternatives_smp_module_del(mod); +#endif }