Re: [patch] SMP alternatives
From: Pavel Machek
Date: Tue Nov 22 2005 - 13:02:13 EST
Hi!
> For testing & benchmarking purposes I've put also in two (temporary)
> sysrq's to switch between UP and SMP bits without booting/shutting down
> the second CPU. That one breaks non-i386 builds which are trivially
> fixable by just dropping the drivers/char/sysrq.c changes ;)
> +/* Replace instructions with better alternatives for this CPU type.
> +
> + This runs before SMP is initialized to avoid SMP problems with
> + self modifying code. This implies that assymetric systems where
> + APs have less capabilities than the boot processor are not handled.
> + Tough. Make sure you disable such features by hand. */
> +void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
> + __u8 *tstart, __u8 *tend)
> +{
> + unsigned char **noptable = intel_nops;
> + struct alt_instr *a;
Some alignment problems here. (Maybe it is okay as a source).
> +struct smp_alt_module {
> + /* what is this ??? */
:-))))))).
> + struct module *mod;
> + char *name;
> +
> + /* our SMP alternatives table */
> + struct alt_instr *astart;
> + struct alt_instr *aend;
> +
> + /* .text segment, needed to avoid patching init code ;) */
> + __u8 *tstart;
> + __u8 *tend;
You should be able to use u8 here.
> + if (0 == strcmp(".text", secstrings + s->sh_name))
> + text = s;
> + if (0 == strcmp(".altinstructions", secstrings + s->sh_name))
> + alt = s;
> + if (0 == strcmp(".smp_altinstructions", secstrings + s->sh_name))
> + smpalt = s;
Can we get if (!strcmp()) here?
Pavel
--
Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/