From: Paolo Bonzini <pbonzini@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: KVM list <kvm@vger.kernel.org>, Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: Should KVM_GUEST stop depending on PARAVIRT?
Date: Tue, 28 Jul 2015 11:57:57 +0200 [thread overview]
Message-ID: <55B75225.8080505@redhat.com> (raw)
In-Reply-To: <CALCETrUcdY0_Uz9ScE=_86jcV-8NeYS51CyePnwNekZttNNwqw@mail.gmail.com>
On 27/07/2015 20:45, Andy Lutomirski wrote:
> On Mon, Jul 27, 2015 at 11:30 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 27/07/2015 19:51, Andy Lutomirski wrote:
>>>>> I think I'm missing something. Does KVM_GUEST hook read_msr and
>>>>> write_msr? I don't see it.
>>>>
>>>> PARAVIRT does, and it's the main reason why you'd want PARAVIRT for a
>>>> KVM guest.
>>>
>>> Still confused. On a KVM guest (with PARAVIRT=y), doesn't read_msr do
>>> exactly the same thing it does on native, albeit with more indirection
>>> and patching involved?
>>
>> With PARAVIRT=y it never #GPs:
>>
>> .read_msr = native_read_msr_safe,
>> .write_msr = native_write_msr_safe,
>>
>> I don't remember if it's this way on bare-metal too.
>
> Oh, whoops, I missed the "_safe". IMO that's just a bug, and I guess
> KVM relies on it?
>
> ISTM the host should be fixed so that a non-PARAVIRT guest won't crash
> when using perf (if it indeed currently crashes)
It does.
> and/or the perf code
> should be fixed to work without this bug^Wfeature.
You can call it even feature^Wbug, I won't take it personal. :) It does
not prevent scary messages (such as "intel_rapl: no valid rapl domains
found in package 0") in the logs for example. See
https://bugzilla.redhat.com/show_bug.cgi?id=1178491 for a discussion
about such scary messages.
Unfortunately, fixing the host vs. fixing the guest is an arms race.
Fixing the host would entail adding support for a shitload of
non-architectural MSRs. Most of the time there is not even any correct
value that you can report for those MSRs (what's the FSB speed of a
virtual machine or its power consumption?) so there is nontrivial risk
that the guest code would anyway break or keep logging scary messages;
in which case we're back to square 1.
Fixing the guest (perf and thermal and cpufreq and whatever) code isn't
any better. First of all, I wouldn't be surprised if maintainers
opposed the "fixes" (see the above BZ for an example, and see PeterZ's
love of KVM and "virt crap" for a hint). Second, it would break again
with all new processors, assuming that the patches are accepted in the
first place.
So while the _safe hack is a hack and does result in scary messages
sometimes, we cannot really do much better than it just by modifying the
drivers, and at least the arms race is avoided. Perhaps one alternative
is to disable the thermal and cpufreq subsystems altogether if running
on a virt platform?
Paolo
> Then KVM_GUEST kernels could be de-bloated by dropping PARAVIRT.
>
> Hi Arjan- A quick and dirty measurement suggests that this would save
> 2-3 ms when booting a KVM_GUEST=y kernel under KVM by turning
> apply_paravirt into a noop.
>
> --Andy
>
next prev parent reply other threads:[~2015-07-28 9:58 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 [this message]
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
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=55B75225.8080505@redhat.com \
--to=pbonzini@redhat.com \
--cc=arjan@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=luto@amacapital.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.