]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/asm-i386/bugs.h
[PATCH] paravirt: Allow selected bug checks to be
[mirror_ubuntu-bionic-kernel.git] / include / asm-i386 / bugs.h
index ea54540638d211f2bb99fc4693e603a664b48dad..38f1aebbbdb5f5587df51976e13fd1f352fd36eb 100644 (file)
@@ -8,9 +8,6 @@
  *        <rreilova@ececs.uc.edu>
  *     - Channing Corn (tests & fixes),
  *     - Andrew D. Balsa (code cleanup).
- *
- *  Pentium III FXSR, SSE support
- *     Gareth Hughes <gareth@valinux.com>, May 2000
  */
 
 /*
  *     void check_bugs(void);
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/msr.h>
+#include <asm/paravirt.h>
 
 static int __init no_halt(char *s)
 {
@@ -76,25 +73,7 @@ static void __init check_fpu(void)
                return;
        }
 
-/* Enable FXSR and company _before_ testing for FP problems. */
-       /*
-        * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
-        */
-       if (offsetof(struct task_struct, thread.i387.fxsave) & 15) {
-               extern void __buggy_fxsr_alignment(void);
-               __buggy_fxsr_alignment();
-       }
-       if (cpu_has_fxsr) {
-               printk(KERN_INFO "Enabling fast FPU save and restore... ");
-               set_in_cr4(X86_CR4_OSFXSR);
-               printk("done.\n");
-       }
-       if (cpu_has_xmm) {
-               printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... ");
-               set_in_cr4(X86_CR4_OSXMMEXCPT);
-               printk("done.\n");
-       }
-
+/* trap_init() enabled FXSR and company _before_ testing for FP problems here. */
        /* Test for the divl bug.. */
        __asm__("fninit\n\t"
                "fldl %1\n\t"
@@ -113,6 +92,9 @@ static void __init check_fpu(void)
 
 static void __init check_hlt(void)
 {
+       if (paravirt_enabled())
+               return;
+
        printk(KERN_INFO "Checking 'hlt' instruction... ");
        if (!boot_cpu_data.hlt_works_ok) {
                printk("disabled\n");
@@ -211,6 +193,6 @@ static void __init check_bugs(void)
        check_fpu();
        check_hlt();
        check_popad();
-       system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
+       init_utsname()->machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
        alternative_instructions(); 
 }