Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 23:32:35 +0000 (15:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 23:32:35 +0000 (15:32 -0800)
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, msr, cpumask: Use struct cpumask rather than the deprecated cpumask_t
  x86, cpuid: Simplify the code in cpuid_open
  x86, cpuid: Remove the bkl from cpuid_open()
  x86, msr: Remove the bkl from msr_open()
  x86: AMD Geode LX optimizations
  x86, msr: Unify rdmsr_on_cpus/wrmsr_on_cpus

1  2 
arch/x86/Kconfig.cpu
arch/x86/kernel/cpuid.c
arch/x86/kernel/msr.c

diff --combined arch/x86/Kconfig.cpu
@@@ -400,19 -400,18 +400,19 @@@ config X86_TS
  
  config X86_CMPXCHG64
        def_bool y
 -      depends on X86_PAE || X86_64
 +      depends on !M386 && !M486
  
  # this should be set for all -march=.. options where the compiler
  # generates cmov.
  config X86_CMOV
        def_bool y
-       depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM)
+       depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
  
  config X86_MINIMUM_CPU_FAMILY
        int
        default "64" if X86_64
        default "6" if X86_32 && X86_P6_NOP
 +      default "5" if X86_32 && X86_CMPXCHG64
        default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK)
        default "3"
  
diff --combined arch/x86/kernel/cpuid.c
@@@ -116,21 -116,16 +116,16 @@@ static int cpuid_open(struct inode *ino
  {
        unsigned int cpu;
        struct cpuinfo_x86 *c;
-       int ret = 0;
-       lock_kernel();
  
        cpu = iminor(file->f_path.dentry->d_inode);
-       if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
-               ret = -ENXIO;   /* No such CPU */
-               goto out;
-       }
+       if (cpu >= nr_cpu_ids || !cpu_online(cpu))
+               return -ENXIO;  /* No such CPU */
        c = &cpu_data(cpu);
        if (c->cpuid_level < 0)
-               ret = -EIO;     /* CPUID not supported */
- out:
-       unlock_kernel();
-       return ret;
+               return -EIO;    /* CPUID not supported */
+       return 0;
  }
  
  /*
@@@ -182,7 -177,7 +177,7 @@@ static struct notifier_block __refdata 
        .notifier_call = cpuid_class_cpu_callback,
  };
  
 -static char *cpuid_nodename(struct device *dev)
 +static char *cpuid_devnode(struct device *dev, mode_t *mode)
  {
        return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt));
  }
@@@ -203,7 -198,7 +198,7 @@@ static int __init cpuid_init(void
                err = PTR_ERR(cpuid_class);
                goto out_chrdev;
        }
 -      cpuid_class->nodename = cpuid_nodename;
 +      cpuid_class->devnode = cpuid_devnode;
        for_each_online_cpu(i) {
                err = cpuid_device_create(i);
                if (err != 0)
diff --combined arch/x86/kernel/msr.c
@@@ -174,21 -174,17 +174,17 @@@ static int msr_open(struct inode *inode
  {
        unsigned int cpu = iminor(file->f_path.dentry->d_inode);
        struct cpuinfo_x86 *c = &cpu_data(cpu);
-       int ret = 0;
  
-       lock_kernel();
        cpu = iminor(file->f_path.dentry->d_inode);
  
-       if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
-               ret = -ENXIO;   /* No such CPU */
-               goto out;
-       }
+       if (cpu >= nr_cpu_ids || !cpu_online(cpu))
+               return -ENXIO;  /* No such CPU */
        c = &cpu_data(cpu);
        if (!cpu_has(c, X86_FEATURE_MSR))
-               ret = -EIO;     /* MSR not supported */
- out:
-       unlock_kernel();
-       return ret;
+               return -EIO;    /* MSR not supported */
+       return 0;
  }
  
  /*
@@@ -241,7 -237,7 +237,7 @@@ static struct notifier_block __refdata 
        .notifier_call = msr_class_cpu_callback,
  };
  
 -static char *msr_nodename(struct device *dev)
 +static char *msr_devnode(struct device *dev, mode_t *mode)
  {
        return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt));
  }
@@@ -262,7 -258,7 +258,7 @@@ static int __init msr_init(void
                err = PTR_ERR(msr_class);
                goto out_chrdev;
        }
 -      msr_class->nodename = msr_nodename;
 +      msr_class->devnode = msr_devnode;
        for_each_online_cpu(i) {
                err = msr_device_create(i);
                if (err != 0)