]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[PATCH] vmi: paravirt drop udelay op
authorZachary Amsden <zach@vmware.com>
Mon, 5 Mar 2007 08:30:38 +0000 (00:30 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 5 Mar 2007 15:57:52 +0000 (07:57 -0800)
Not respecting udelay causes problems with any virtual hardware that is passed
through to real hardware.  This can be noticed by any device that interacts
with the real world in real time - like AP startup, which takes real time.  Or
keyboard LEDs, which should blink in real-time.  Or floppy drives, but only
when passed through to a real floppy controller on OSes which can't
sufficiently buffer the floppy commands to emulate a zero latency floppy.  Or
IDE drives, when connecting to a physical CDROM.

This was mostly a hack to get the kernel to boot faster, but it introduced a
number of misvirtualization bugs, and Alan and Pavel argued pretty strongly
against it.  We were the only client, and now want to clean up this cruft.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/i386/kernel/paravirt.c
arch/i386/kernel/smpboot.c
arch/i386/kernel/vmi.c
include/asm-i386/delay.h
include/asm-i386/paravirt.h

index 12e3bc49b83b8223830266a27dc314377b4328a5..871448db1425ffe77a10be780d2fddb6901f2b6c 100644 (file)
@@ -538,7 +538,6 @@ struct paravirt_ops paravirt_ops = {
 
        .set_iopl_mask = native_set_iopl_mask,
        .io_delay = native_io_delay,
-       .const_udelay = __const_udelay,
 
 #ifdef CONFIG_X86_LOCAL_APIC
        .apic_write = native_apic_write,
index 48bfcaa13ecca45c79503f791814c75ed4a5ba54..9b0dd2744c82093e98e9fa8f8b63b61b57cbf768 100644 (file)
  *             Dave Jones      :       Report invalid combinations of Athlon CPUs.
 *              Rusty Russell   :       Hacked into shape for new "hotplug" boot process. */
 
-
-/* SMP boot always wants to use real time delay to allow sufficient time for
- * the APs to come online */
-#define USE_REAL_TIME_DELAY
-
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index bd1037bd124bb24565d27c360bd09fe5c2c748ff..a8aa57e770296b0023da4f898901c788ba6e84aa 100644 (file)
@@ -48,7 +48,6 @@ typedef u64 __attribute__((regparm(2))) (VROMLONGFUNC)(int);
 
 static struct vrom_header *vmi_rom;
 static int license_gplok;
-static int disable_nodelay;
 static int disable_pge;
 static int disable_pse;
 static int disable_sep;
@@ -801,9 +800,6 @@ static inline int __init activate_vmi(void)
 
        para_fill(set_iopl_mask, SetIOPLMask);
        paravirt_ops.io_delay = (void *)vmi_nop;
-       if (!disable_nodelay) {
-               paravirt_ops.const_udelay = (void *)vmi_nop;
-       }
 
        para_fill(set_lazy_mode, SetLazyMode);
 
@@ -947,9 +943,7 @@ static int __init parse_vmi(char *arg)
        if (!arg)
                return -EINVAL;
 
-       if (!strcmp(arg, "disable_nodelay"))
-               disable_nodelay = 1;
-       else if (!strcmp(arg, "disable_pge")) {
+       if (!strcmp(arg, "disable_pge")) {
                clear_bit(X86_FEATURE_PGE, boot_cpu_data.x86_capability);
                disable_pge = 1;
        } else if (!strcmp(arg, "disable_pse")) {
index 32d6678d0bbf2b1815019f1eaec21b60c2f17fee..9ae5e3782ed879dbd13b64df6aacdc186c998af9 100644 (file)
@@ -16,13 +16,6 @@ extern void __ndelay(unsigned long nsecs);
 extern void __const_udelay(unsigned long usecs);
 extern void __delay(unsigned long loops);
 
-#if defined(CONFIG_PARAVIRT) && !defined(USE_REAL_TIME_DELAY)
-#define udelay(n) paravirt_ops.const_udelay((n) * 0x10c7ul)
-
-#define ndelay(n) paravirt_ops.const_udelay((n) * 5ul)
-
-#else /* !PARAVIRT || USE_REAL_TIME_DELAY */
-
 /* 0x10c7 is 2**32 / 1000000 (rounded up) */
 #define udelay(n) (__builtin_constant_p(n) ? \
        ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
@@ -32,7 +25,6 @@ extern void __delay(unsigned long loops);
 #define ndelay(n) (__builtin_constant_p(n) ? \
        ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
        __ndelay(n))
-#endif
 
 void use_tsc_delay(void);
 
index e01d895d7379f8df4147c8804bb00e2e8f1d96cd..1e4226a85263c73d0b270d33a7bb4a97c6d63f2f 100644 (file)
@@ -117,7 +117,6 @@ struct paravirt_ops
        void (*set_iopl_mask)(unsigned mask);
 
        void (*io_delay)(void);
-       void (*const_udelay)(unsigned long loops);
 
 #ifdef CONFIG_X86_LOCAL_APIC
        void (*apic_write)(unsigned long reg, unsigned long v);