LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Avi Kivity <avi@qumranet.com>
Cc: Andi Kleen <ak@muc.de>, Andrew Morton <akpm@osdl.org>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kvm-devel <kvm-devel@lists.sourceforge.net>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [PATCH] make KVM conform to sucky rdmsr interface
Date: Thu, 22 Mar 2007 18:49:30 +1100	[thread overview]
Message-ID: <1174549770.2713.121.camel@localhost.localdomain> (raw)
In-Reply-To: <46022E40.8080300@qumranet.com>

On Thu, 2007-03-22 at 09:20 +0200, Avi Kivity wrote:
> My rdmsr_safe (x86_64, i386 is similar/same) is

Erk.  Andrew, please drop that patch, and take this one.

It was actually Jeremy's paravirt cleanup patch which changed the
calling convention of rdmsr_safe() to match rdmsr().

I went "oh it's that fucking rdmsr interface" and "fixed" kvm.

Sorry for the bad patch,
Rusty.
==
rdmsr_safe() takes pointers.  rdmsr() modifies its arguments.  What a
mess.

Fix rdmsr_safe() with !CONFIG_PARAVIRT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r a7f78e8eacc8 include/asm-i386/msr.h
--- a/include/asm-i386/msr.h	Thu Mar 22 12:38:35 2007 +1100
+++ b/include/asm-i386/msr.h	Thu Mar 22 18:40:35 2007 +1100
@@ -96,12 +96,12 @@ static inline void wrmsrl (unsigned long
 	(native_write_msr(msr, ((unsigned long long)val2 << 32) | val1))
 
 /* rdmsr with exception handling */
-#define rdmsr_safe(msr,val1,val2)						\
+#define rdmsr_safe(msr,p1,p2)						\
 	({								\
 		int __err;						\
-		unsigned long long __val = native_read_msr(msr, &__err);	\
-		val1 = __val;						\
-		val2 = __val >> 32;					\
+		unsigned long long __val = native_read_msr(msr, &__err);\
+		(*p1) = __val;						\
+		(*p2) = __val >> 32;					\
 		__err;							\
 	})
 



  reply	other threads:[~2007-03-22  7:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22  2:51 Rusty Russell
2007-03-22  7:20 ` Avi Kivity
2007-03-22  7:49   ` Rusty Russell [this message]
2007-03-22  7:55     ` Jeremy Fitzhardinge
2007-03-22 21:30     ` Andrew Morton
2007-03-22 22:01       ` Jeremy Fitzhardinge
2007-03-23  1:10       ` Rusty Russell

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=1174549770.2713.121.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=avi@qumranet.com \
    --cc=jeremy@goop.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] make KVM conform to sucky rdmsr interface' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).