VirtualBox

Changeset 135 in vbox for trunk


Ignore:
Timestamp:
Jan 18, 2007 2:41:11 PM (18 years ago)
Author:
vboxsync
Message:

Slightly relaxed NMI check (see #1602)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r82 r135  
    280280     *             the nmi_watchdog variable.
    281281     */
     282#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
     283    /*
     284     * Permanent IO_APIC mode active? No way to handle this!
     285     */
     286    if (nmi_watchdog == NMI_IO_APIC)
     287    {
     288        printk(KERN_ERR DEVICE_NAME
     289               ": NMI watchdog in IO_APIC mode active -- refused to load the kernel module!\n"
     290                        DEVICE_NAME
     291               ": Please disable the NMI watchdog by specifying 'nmi_watchdog=0' at kernel\n"
     292                        DEVICE_NAME
     293               ": command line.\n");
     294        return -EINVAL;
     295    }
     296
     297    /*
     298     * See arch/i386/kernel/nmi.c on >= 2.6.19: -1 means it can never enabled again
     299     */
     300    atomic_set(&nmi_active, -1);
     301    printk(KERN_INFO DEVICE_NAME ": Trying to deactivate NMI watchdog permanently...\n");
     302
     303    /*
     304     * Now fall through and see if it actually was enabled before. If so, fail
     305     * as we cannot deactivate it cleanly from here.
     306     */
     307#  else /* < 2.6.19 */
     308    /*
     309     * Older 2.6 kernels: nmi_watchdog is not initalized by default
     310     */
    282311    if (nmi_watchdog != NMI_NONE)
    283312        goto nmi_activated;
    284 # endif
     313#  endif
     314# endif /* >= 2.6.0 */
    285315
    286316    /*
     
    303333            if ((GET_APIC_DELIVERY_MODE(v) == APIC_MODE_NMI) && !(v & APIC_LVT_MASKED))
    304334            {
     335# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
     336                printk(KERN_ERR DEVICE_NAME
     337                ": NMI watchdog either active or at least initialized. Please disable the NMI\n"
     338                                DEVICE_NAME
     339                ": watchdog by specifying 'nmi_watchdog=0' at kernel command line.\n");
     340                return -EINVAL;
     341# else /* < 2.6.19 */
     342#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
    305343nmi_activated:
    306                 printk(KERN_ERR DEVICE_NAME ": NMI watchdog active -- refused to load the kernel module! Please disable\n"
    307                                 DEVICE_NAME ": the NMI watchdog by specifying 'nmi_watchdog=0' at kernel command line.\n");
     344#  endif
     345                printk(KERN_ERR DEVICE_NAME
     346                ": NMI watchdog active -- refused to load the kernel module! Please disable\n"
     347                                DEVICE_NAME
     348                ": the NMI watchdog by specifying 'nmi_watchdog=0' at kernel command line.\n");
    308349                return -EINVAL;
     350# endif /* >= 2.6.19 */
    309351            }
    310352        }
    311353    }
    312 #endif
     354# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
     355    printk(KERN_INFO DEVICE_NAME ": Successfully done.\n");
     356# endif /* >= 2.6.19 */
     357#endif /* CONFIG_X86_LOCAL_APIC */
    313358
    314359#ifdef CONFIG_VBOXDRV_AS_MISC
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette