public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andre Przywara <andre.przywara@amd.com>,
	Vladimir Davydov <vdavydov@parallels.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andi Kleen <ak@linux.intel.com>,
	Borislav Petkov <borislav.petkov@amd.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andreas Herrmann <andreas.herrmann3@amd.com>
Subject: Re: [PATCH 2/2] cpu: intel, amd: mask cleared cpuid features
Date: Tue, 24 Jul 2012 13:04:53 +0200	[thread overview]
Message-ID: <20120724110453.GA24893@aftab.osrc.amd.com> (raw)
In-Reply-To: <20120724113204.7f48efe6@pyramind.ukuu.org.uk>

On Tue, Jul 24, 2012 at 11:32:04AM +0100, Alan Cox wrote:
> > So actually, making it straightforward to disable CPUID feature bits
> > just for every whim is the bug.
> 
> Sometimes its needed to make stuff work. Expecting user space to go
> digging in odd places

Nah, not odd places. Simply doing "wrmsr... " as root would suffice.

> isn't good either but exposing *both* true/apparent cpuid bits might
> not be a bad idea.

I'm fine with the "might not be a bad idea" thing. I'm saying that it
seems like a bad idea in certain cases...

> > 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 :).
> 
> Which is a very large part of the x86 market. So they most definitely do
> count. Virtualisation is somewhat different though. There you are trying
> to define a subset of the features that all the systems in your
> environment have so you can do migrations. Virtualisation you have rather
> more different control of the cpuid and msrs anyway.

Right and best it would be if *only* virtualization had access to those
MSRs and CPUID bits. IOW, you #GP when accessing them in the normal case
and access is granted when in VMRUN context.

> > Majority of users is majority of users no matter how you look at it!
> 
> That's not a good argument. The majority of users don't have SCSI,
> certain processors and so on ...

or coffee machines ... :-)

> > Right, and how is giving the user a heavy, well-oiled AK-47 to do that,
> > user-friendly?
> 
> It's a point and click interface

Or rather, aim and squeeze :-)

> > And this is exactly what I'm questioning: the usability, or rather, the
> > mis-usability of such a feature.
> 
> What goes with that is "so how do you do it otherwise".

Not much more harder using msr-tools and easily scriptable. See above.

> Distros can certainly add patches for such features if needed but that
> just makes it even more fun to debug.

That's easy: the first question we ask from the bug reporter is (and you
do that too, btw - I've seen you dozens of times :-)) "can you reproduce
it with mainline"?

> Does "bind mount your own cpuid file" cover this ?

Well, AFAICU, the writes to the MSRs are globally visible. If you're
asking whether through bind-mounting your own cpuid file we're making
the process of toggling CPUID bits more involved versus using simply
kernel command line options then this is probably a step in the right
direction IMHO, BUT (!)...

... there's still a software-only solution needed for CPUID leafs which
cannot be toggled through MSR writes simply because there are no such
MSRs.

The solution to that situation could cover all issues without touching
the kernel.

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

      reply	other threads:[~2012-07-24 11:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 16:37 [PATCH 1/2] cpu: common: make clearcpuid option take bits list Vladimir Davydov
2012-07-20 16:37 ` [PATCH 2/2] cpu: intel, amd: mask cleared cpuid features Vladimir Davydov
2012-07-20 17:10   ` Andi Kleen
2012-07-20 17:18     ` H. Peter Anvin
2012-07-25 11:51     ` Vladimir Davydov
2012-07-20 17:20   ` H. Peter Anvin
2012-07-20 18:21     ` Vladimir Davydov
2012-07-20 20:19       ` H. Peter Anvin
2012-07-20 20:37         ` Vladimir Davydov
2012-07-21 10:37   ` Borislav Petkov
2012-07-24  7:06     ` Vladimir Davydov
2012-07-24  7:48       ` Borislav Petkov
2012-07-24  8:14       ` Andre Przywara
2012-07-24  8:29         ` Vladimir Davydov
2012-07-24 10:10           ` Borislav Petkov
2012-07-24 11:09             ` Vladimir Davydov
2012-07-24 12:34               ` Andre Przywara
2012-07-24 12:44                 ` Alan Cox
2012-07-25 10:31                   ` Vladimir Davydov
2012-07-25 10:58                     ` Andre Przywara
2012-07-25 11:02                       ` Vladimir Davydov
2012-07-25 11:17                         ` Andre Przywara
2012-07-25 11:43                           ` Vladimir Davydov
2012-07-25 11:31                     ` Alan Cox
2012-07-25 11:46                       ` Vladimir Davydov
2012-07-25 10:31                 ` Vladimir Davydov
2012-07-25 10:43                   ` Borislav Petkov
2012-07-25 11:39                     ` Vladimir Davydov
2012-07-25  0:57               ` H. Peter Anvin
2012-07-25  6:58                 ` Vladimir Davydov
2012-07-25 14:13                   ` H. Peter Anvin
2012-07-25 11:49                 ` Vladimir Davydov
2012-07-24  9:50         ` Borislav Petkov
2012-07-24 10:32           ` Alan Cox
2012-07-24 11:04             ` Borislav Petkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120724110453.GA24893@aftab.osrc.amd.com \
    --to=bp@amd64.org \
    --cc=ak@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andre.przywara@amd.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=borislav.petkov@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vdavydov@parallels.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox