From: "H. Peter Anvin" <hpa@zytor.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
Jeremy Fitzhardinge <jeremy@goop.org>,
Chris Wright <chrisw@sous-sol.org>,
Alok Kataria <akataria@vmware.com>,
Rusty Russell <rusty@rustcorp.com.au>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86, paravirt: BUG_ON on {rd,wr}msr exceptions
Date: Mon, 28 Jul 2014 13:43:36 -0700 [thread overview]
Message-ID: <5961f265-e3d0-4122-87b8-10151e1ee4d6@email.android.com> (raw)
In-Reply-To: <20140728203955.GA4611@thinpad.lan.raisama.net>
As much as I hate adding new pvops, it might be the better answer, especially since those are the real native ops.
On July 28, 2014 1:39:55 PM PDT, Eduardo Habkost <ehabkost@redhat.com> wrote:
>On Mon, Jul 28, 2014 at 12:18:10PM -0700, H. Peter Anvin wrote:
>> On 07/28/2014 12:04 PM, Eduardo Habkost wrote:
>> > When CONFIG_PARAVIRT is enabled, the kernel is ignoring exceptions
>on
>> > the {rd,wr}msr instructions. This makes serious issues (either on
>the
>> > guest kernel, or on the host) be silently ignored, and is different
>from
>> > the native MSR code (which does not ignore the exceptions).
>> >
>> > As paravirt.h already includes linux/bug.h, I don't see what was
>the
>> > original issue preventing BUG_ON from being used.
>> >
>> > Change rdmsr(), wrmsr(), and rdmsrl() to BUG_ON() on errors.
>>
>> How much does this bloat the kernel?
>
>It seems to add 8 bytes to each {wr,rd}msr() call (4 extra
>instructions:
>test, jmp, ud2, jmp).
>
>allyesconfig, paravirt enabled, before:
>
> text data bss dec hex filename
>108368312 23500872 55705600 187574784 b2e2a00
>vmlinux
>
>allyesconfig, paravirt enabled, after:
>
> text data bss dec hex filename
>108384438 23500904 55717888 187603230 b2e991e
>vmlinux
>
>allyesconfig vmlinux is 28446 bytes larger.
>
>An alternative is to add read_msr_unsafe() & write_msr_unsafe() fields
>to pv_cpu_ops, pointing to native_read_msr() & native_write_msr().
--
Sent from my mobile phone. Please pardon brevity and lack of formatting.
prev parent reply other threads:[~2014-07-28 20:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 19:04 Eduardo Habkost
2014-07-28 19:18 ` H. Peter Anvin
2014-07-28 20:39 ` Eduardo Habkost
2014-07-28 20:43 ` H. Peter Anvin [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=5961f265-e3d0-4122-87b8-10151e1ee4d6@email.android.com \
--to=hpa@zytor.com \
--cc=akataria@vmware.com \
--cc=chrisw@sous-sol.org \
--cc=ehabkost@redhat.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.org \
--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
all inboxes | Powered by JetHome®