Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	KVM list <kvm@vger.kernel.org>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: Should KVM_GUEST stop depending on PARAVIRT?
Date: Wed, 29 Jul 2015 11:19:20 +0200	[thread overview]
Message-ID: <20150729091920.GK19282@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CALCETrWK-b5jERGVDT4Xts3MnzcWiCgqD7vFJLrM8w5SLo8SYg@mail.gmail.com>

On Tue, Jul 28, 2015 at 05:23:22PM -0700, Andy Lutomirski wrote:
> 
> PeterZ, can we fix this for real instead of relying on
> CONFIG_PARAVIRT=y accidentally turning all msr accesses into "safe"
> accesses?  We have the CPUID "hypervisor" bit, but I still don't fully
> understand the problem.

So a whole bunch of PMU drivers already probe the MSRs at init time
using a combination of rdmsrl_safe() and wrmsrl_safe() to see if:

 1) its there at all
 2) if its there, it 'works' like it ought to

See for example: arch/x86/kernel/cpu/perf_event.c:check_hw_exists().

I have no problem using the _safe() methods to probe MSRs in init
routines and failing the init of the driver etc.

What I do object to is sprinkling _safe() all over the driver itself and
creating horrid error paths all over (yes, people have proposed crazy
things like that).

Another example is the LBR probing in
arch/x86/kernel/cpu/perf_event_intel.c:intel_pmu_init(). This is the one
people wanted to use _safe() crud for all throughout the driver, instead
of simply disabling the LBR at init time.


As to the 'bug' at hand, I really don't see the problem. The RAPL driver
says there's no valid RAPL domains, this is true, there aren't any on
the virtual machine, so what?



  parent reply	other threads:[~2015-07-29  9:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 17:33 Should KVM_GUEST stop depending on PARAVIRT? Andy Lutomirski
2015-07-27 13:59 ` Paolo Bonzini
2015-07-27 15:56   ` Andy Lutomirski
2015-07-27 17:49     ` Paolo Bonzini
2015-07-27 17:51       ` Andy Lutomirski
2015-07-27 18:30         ` Paolo Bonzini
2015-07-27 18:45           ` Andy Lutomirski
2015-07-27 19:04             ` Arjan van de Ven
2015-07-28  9:57             ` Paolo Bonzini
2015-07-29  0:23               ` Andy Lutomirski
2015-07-29  4:49                 ` Venkatesh Srinivas
2015-07-29  8:27                   ` Paolo Bonzini
2015-07-29  9:19                 ` Peter Zijlstra [this message]
2015-07-29  9:24                   ` Paolo Bonzini
2015-07-29  9:40                     ` Peter Zijlstra
2015-07-29  9:41                       ` Paolo Bonzini
2015-07-30  0:14                         ` Andy Lutomirski

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=20150729091920.GK19282@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arjan@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=pbonzini@redhat.com \
    /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