瀏覽代碼

[PATCH] paravirt: Allow selected bug checks to be

Allow selected bug checks to be skipped by paravirt kernels.  The two most
important are the F00F workaround (which is either done by the hypervisor,
or not required), and the 'hlt' instruction check, which can break under
some hypervisors.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Rusty Russell 18 年之前
父節點
當前提交
4f205fd45a
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 1 1
      arch/i386/kernel/cpu/intel.c
  2. 4 0
      include/asm-i386/bugs.h

+ 1 - 1
arch/i386/kernel/cpu/intel.c

@@ -107,7 +107,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
 	 * Note that the workaround only should be initialized once...
 	 * Note that the workaround only should be initialized once...
 	 */
 	 */
 	c->f00f_bug = 0;
 	c->f00f_bug = 0;
-	if ( c->x86 == 5 ) {
+	if (!paravirt_enabled() && c->x86 == 5) {
 		static int f00f_workaround_enabled = 0;
 		static int f00f_workaround_enabled = 0;
 
 
 		c->f00f_bug = 1;
 		c->f00f_bug = 1;

+ 4 - 0
include/asm-i386/bugs.h

@@ -21,6 +21,7 @@
 #include <asm/processor.h>
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/i387.h>
 #include <asm/msr.h>
 #include <asm/msr.h>
+#include <asm/paravirt.h>
 
 
 static int __init no_halt(char *s)
 static int __init no_halt(char *s)
 {
 {
@@ -91,6 +92,9 @@ static void __init check_fpu(void)
 
 
 static void __init check_hlt(void)
 static void __init check_hlt(void)
 {
 {
+	if (paravirt_enabled())
+		return;
+
 	printk(KERN_INFO "Checking 'hlt' instruction... ");
 	printk(KERN_INFO "Checking 'hlt' instruction... ");
 	if (!boot_cpu_data.hlt_works_ok) {
 	if (!boot_cpu_data.hlt_works_ok) {
 		printk("disabled\n");
 		printk("disabled\n");