All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org, KVM list <kvm@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, xen-devel <Xen-devel@lists.xen.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [Xen-devel] [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops
Date: Thu, 17 Sep 2015 11:11:54 -0400	[thread overview]
Message-ID: <55FAD83A.3010307@oracle.com> (raw)
In-Reply-To: <55FA8381.5010604@citrix.com>

On 09/17/2015 05:10 AM, Andrew Cooper wrote:
> On 17/09/15 00:33, Andy Lutomirski wrote:
>> Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently
>> turns all rdmsr and wrmsr operations into the safe variants without
>> any checks that the operations actually succeed.
>>
>> This is IMO awful: it papers over bugs.  In particular, KVM gueests
>> might be unwittingly depending on this behavior because
>> CONFIG_KVM_GUEST currently depends on CONFIG_PARAVIRT.  I'm not
>> aware of any such problems, but applying this series would be a good
>> way to shake them out.
>>
>> Fix it so that the MSR operations work the same on CONFIG_PARAVIRT=n
>> and CONFIG_PARAVIRT=y as long as Xen isn't being used.  The Xen
>> maintainers are welcome to make a similar change on top of this.
> The Xen side of things need some further modification before this would
> be a safe operation to perform.
>
> On the wrmsr side of things alone, this is the list of things Xen
> currently objects to and injects #GP faults for.
>
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 00000000c0000081 from
> 0xe023e00800000000 to 0x0023001000000000.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 00000000c0000082 from
> 0xffff82d0bffff000 to 0xffffffff81560060.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 00000000c0000083 from
> 0xffff82d0bffff020 to 0xffffffff81558100.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 0000000000000174 from
> 0x000000000000e008 to 0x0000000000000010.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 0000000000000175 from
> 0xffff8300ac0f7fc0 to 0x0000000000000000.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 0000000000000176 from
> 0xffff82d08023fd50 to 0xffffffff815616d0.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 00000000c0000083 from
> 0xffff82d0bffff020 to 0xffffffff81561910.
> (XEN) traps.c:2692:d0v0 Domain attempted WRMSR 00000000c0000084 from
> 0x0000000000074700 to 0x0000000000047700.
>
> However, it would be certainly be worth teaching PVops not to play with
> MSRs it doesn't own.

PVops already knows about those. There is even has a comment about how 
we shouldn't touch those MSRs. And yet three lines later we still write 
them.

-boris

      parent reply	other threads:[~2015-09-17 15:11 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 23:33 [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops Andy Lutomirski
2015-09-16 23:33 ` [PATCH 1/3] x86/paravirt: Add _safe to the read_msr and write_msr PV hooks Andy Lutomirski
2015-09-16 23:33 ` Andy Lutomirski
2015-09-16 23:33 ` [PATCH 2/3] x86/paravirt: Add paravirt_{read, write}_msr Andy Lutomirski
2015-09-16 23:33 ` [PATCH 2/3] x86/paravirt: Add paravirt_{read,write}_msr Andy Lutomirski
2015-09-16 23:33 ` [PATCH 3/3] x86/paravirt: Make "unsafe" MSR accesses unsafe even if PARAVIRT=y Andy Lutomirski
2015-09-16 23:33 ` Andy Lutomirski
2015-09-17  7:19 ` [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops Ingo Molnar
2015-09-17  7:19 ` Ingo Molnar
2015-09-17  9:31   ` Borislav Petkov
2015-09-17  9:31   ` Borislav Petkov
2015-09-17 11:22     ` H. Peter Anvin
2015-09-17 11:22     ` H. Peter Anvin
2015-09-17 11:39     ` Paolo Bonzini
2015-09-17 15:27       ` Borislav Petkov
2015-09-17 15:32         ` Andrew Cooper
2015-09-17 15:32         ` [Xen-devel] " Andrew Cooper
2015-09-17 15:37           ` Borislav Petkov
2015-09-17 15:37           ` [Xen-devel] " Borislav Petkov
2015-09-17 15:27       ` Borislav Petkov
2015-09-17 11:39     ` Paolo Bonzini
2015-09-17 15:23   ` Andy Lutomirski
2015-09-17 15:23   ` Andy Lutomirski
2015-09-17 15:27     ` Arjan van de Ven
2015-09-17 15:27     ` Arjan van de Ven
2015-09-17 15:29       ` Paolo Bonzini
2015-09-17 15:31         ` Arjan van de Ven
2015-09-17 15:33           ` Paolo Bonzini
2015-09-17 15:33           ` Paolo Bonzini
2015-09-17 15:31         ` Arjan van de Ven
2015-09-17 15:29       ` Paolo Bonzini
2015-09-17 17:30     ` Ingo Molnar
2015-09-17 18:51       ` Andy Lutomirski
2015-09-17 18:51       ` Andy Lutomirski
2015-09-17 17:30     ` Ingo Molnar
2015-09-17  8:58 ` Peter Zijlstra
2015-09-17  8:58 ` Peter Zijlstra
2015-09-17 11:40   ` Paolo Bonzini
2015-09-17 11:40   ` Paolo Bonzini
2015-09-17 12:27     ` Peter Zijlstra
2015-09-17 15:17       ` Andy Lutomirski
2015-09-17 15:17       ` Andy Lutomirski
2015-09-17 15:17         ` Peter Zijlstra
2015-09-17 15:17         ` Peter Zijlstra
2015-09-17 15:26           ` Andy Lutomirski
2015-09-17 15:26           ` Andy Lutomirski
2015-09-17 15:29             ` Paolo Bonzini
2015-09-17 15:29             ` Paolo Bonzini
2015-09-17 12:27     ` Peter Zijlstra
2015-09-17  9:10 ` Andrew Cooper
2015-09-17  9:10 ` [Xen-devel] " Andrew Cooper
2015-09-17 15:11   ` Boris Ostrovsky
2015-09-17 15:11   ` Boris Ostrovsky [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=55FAD83A.3010307@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Xen-devel@lists.xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=arjan@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.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 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.