Re: [PATCH 1/10] Cr4 is valid on some 486s

From: Linus Torvalds
Date: Mon Nov 14 2005 - 14:26:20 EST




On Mon, 14 Nov 2005, Gerd Knorr wrote:
>
> Throwing another patch into the discussion ;)

Ouch, this one is really ugly.

If you want to go this way, then you should instead add an X86_FEATURE_SMP
that gets cleared on UP and on SMP with just one core (and detect when CPU
hotplug ain't gonna happen ;), and then do

#ifdef CONFIG_SMP
#define smp_alternative(x,y) alternative(x,y,X86_FEATURE_SMP)
#else
#define smp_alternative(x,y) asm(x)
#endif

or something similar, instead of creating a totally new infrastructure to
do the thing that "alternative()" already does.

(Yeah, the above doesn't really work, since usually the SMP form is the
longer one, and "alternative()" wants the long complex one first. So maybe
the x86 feature needs to be "X86_FEATURE_UP" instead, since it's now a
"feature" to only have one core ;)

Linus
-
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/