lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Mar 2007 18:49:30 +1100
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Avi Kivity <avi@...ranet.com>
Cc:	Andi Kleen <ak@....de>, Andrew Morton <akpm@...l.org>,
	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
	kvm-devel <kvm-devel@...ts.sourceforge.net>,
	Jeremy Fitzhardinge <jeremy@...p.org>
Subject: Re: [PATCH] make KVM conform to sucky rdmsr interface

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@...tcorp.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;							\
 	})
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists