public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make set_msr_interception more reliable
@ 2007-07-31 10:42 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2007-07-31 10:42 UTC (permalink / raw)
  To: kvm-devel

set_msr_interception() is used by svm to set up which MSRs should be
intercepted.  It can only fail if someone has changed the code to try
to intercept an MSR without updating the array of ranges.

The return value is ignored anyway: it should just BUG() if it doesn't
work.  (A build-time failure would be better, but that's tricky).

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r cb45615ea038 drivers/kvm/svm.c
--- a/drivers/kvm/svm.c	Wed Jul 25 10:36:31 2007 +1000
+++ b/drivers/kvm/svm.c	Wed Jul 25 10:37:33 2007 +1000
@@ -350,8 +350,8 @@ err_1:
 
 }
 
-static int set_msr_interception(u32 *msrpm, unsigned msr,
-				int read, int write)
+static void set_msr_interception(u32 *msrpm, unsigned msr,
+				 int read, int write)
 {
 	int i;
 
@@ -366,11 +366,10 @@ static int set_msr_interception(u32 *msr
 			u32 mask = ((write) ? 0 : 2) | ((read) ? 0 : 1);
 			*base = (*base & ~(0x3 << msr_shift)) |
 				(mask << msr_shift);
-			return 1;
+			return;
 		}
 	}
-	printk(KERN_DEBUG "%s: not found 0x%x\n", __FUNCTION__, msr);
-	return 0;
+	BUG();
 }
 
 static __init int svm_hardware_setup(void)



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-31 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 10:42 [PATCH] Make set_msr_interception more reliable Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox