Gerd Hoffmann wrote: [ depending on CONFIG_SMP ] >> Okay, thanks. Yes, I agree such would make sense. > > Patch below. It simply returns in case the tables are empty and nothing > is do to, thus avoids printing the confusing message. It does avoid the message but well, that's also _all_ it avoids. Why do you want to do it this way? If I apply the attached, things compile and work fine which seems to confirm that, yes, all this smp_alternatives code is simply dead baggage on !CONFIG_SMP. Yes, the #ifdef in arch/i386/kernel/module.c is a bit clumsy. Just proof of concept, might be abstracted out a bit better. It does lose most of alternatives.c which would seem to be good thing. Unless I'm missing some points, I believe this code should not be compiled in for !CONFIG_SMP. One other point, although probably not a relevant one. Your changes in module_finalize() potentially change behaviour. It used to be: for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { void *seg; if (strcmp(".altinstructions", secstrings + s->sh_name)) continue; seg = (void *)s->sh_addr; apply_alternatives(seg, seg + s->sh_size); } which means that any .altinstructions section would be patched. It's now: for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { ... if (!strcmp(".altinstructions", secstrings + s->sh_name)) alt = s; ... } if (alt) { /* patch .altinstructions */ void *aseg = (void *)alt->sh_addr; apply_alternatives(aseg, aseg + alt->sh_size); } which means that only the last such section would. I suppose there's only one such section anyway, but not seeing a break in the original does make me wonder if this was originally done on purpose. Rene.