Re: [PATCH 2/2] cpu: intel, amd: mask cleared cpuid features

From: Borislav Petkov
Date: Tue Jul 24 2012 - 05:50:31 EST


On Tue, Jul 24, 2012 at 10:14:09AM +0200, Andre Przywara wrote:
> Actually these "strange failures" would be a bug then. If CPUID is
> not there, the feature is not there. Full stop.

That's full of b*llshit and you know it. The feature is not there
*because* some luser has disabled it with a command line option. Or the
distro kernel has done it for some other idiotic reason.

Then this unsuspecting user comes to lkml and complains that cpupower
utils doesn't show boosting information, for example (yep, for that
example, we've erroneously disabled CPUID_8000_0007_EAX[9]).

And then, after a long debugging session someone finally accidentally
looks at the kernel command line options and realizes that it was
disabled there but the cpu actually had it from the get-go. Bummer, all
that wasted time.

And then I can even imagine such tools going the extra mile of checking
f/m/s and telling the user that the cpu actually supports the feature
but someone has disabled it.

And this is just a simple example.

So actually, making it straightforward to disable CPUID feature bits
just for every whim is the bug.

> In the past we had had already some trouble with people ignoring CPUID
> and stating some funny things like: "Every XYZ processor has this
> feature."

You'll get more of those with a feature like that.

> If someone disables MCE, then on purpose. Let the code cope with it.

I'd like to see a real valid reason why someone would even think that.
Except virtualization folks who are crazy anyway, so that doesn't count :).

> And Boris: I don't like this "majority of users" argument. If there is
> some sense in this feature, why not have it (unless it significantly
> hurts the code base)?

Really??! There's some sense in having a coffee machine daemon in the
kernel, for a certain definition of sense and for a certain number of
users. Why not add it to the kernel too then?

Majority of users is majority of users no matter how you look at it!

> Remember, this is Linux: If you want to shoot yourself in the foot, we
> will not prevent you.

Right, and how is giving the user a heavy, well-oiled AK-47 to do that,
user-friendly?

Btw, this was exactly one of the topics last year at the kernel summit:
Linux maintainers should be more conservative and accept new features
only when it really makes sense and there's verifiable usability to the
majority of users.

And this is exactly what I'm questioning: the usability, or rather, the
mis-usability of such a feature.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
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/