lkml.org 
[lkml]   [2005]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/10] Cr4 is valid on some 486s
Linus Torvalds wrote:

>On Fri, 11 Nov 2005, Zachary Amsden wrote:
>
>
>>Agree nested exceptions are evil. But where is this called from execption
>>context?
>>
>>
>
>We have really nice ways of handling these things, so we should just use
>them.
>
>For example, you can do
>
> static inline void read_cr4(void)
> {
> unsigned long cr4;
> alternative_input("xorl %0,%0",
> "movl %%cr4,%0",
> X86_FEATURE_CR4,
> "r" (cr4));
> return cr4;
> }
>
>and then just add that feature-flag discovery early on in boot (it needs
>to be pretty early, since the alternative instruction rewriting happens
>early).
>
>We have several "calculated" features already. Things like X86_FEATURE_P4
>etc.
>
>

Yes, this is fine, but is it worth writing the feature discovery code?
I suppose it doesn't matter, as it gets jettisoned after init. I guess
it is just preference.

Considering run time code size, the alternative approach wins, has no
extra branches, and is just nicer. The faulting technique requires two
extra dwords of space that can not be jettisonned. So obviously, I must
do it (the alternative approach).

Could we consider doing the same with LOCK prefix for SMP kernels booted
on UP? Evil grin.

Zach
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-11 21:16    [W:0.159 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site