~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/x86/kernel/cpu/common.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
}
255
255
#endif
256
256
 
 
257
static int disable_smep __cpuinitdata;
 
258
static __init int setup_disable_smep(char *arg)
 
259
{
 
260
        disable_smep = 1;
 
261
        return 1;
 
262
}
 
263
__setup("nosmep", setup_disable_smep);
 
264
 
 
265
static __cpuinit void setup_smep(struct cpuinfo_x86 *c)
 
266
{
 
267
        if (cpu_has(c, X86_FEATURE_SMEP)) {
 
268
                if (unlikely(disable_smep)) {
 
269
                        setup_clear_cpu_cap(X86_FEATURE_SMEP);
 
270
                        clear_in_cr4(X86_CR4_SMEP);
 
271
                } else
 
272
                        set_in_cr4(X86_CR4_SMEP);
 
273
        }
 
274
}
 
275
 
257
276
/*
258
277
 * Some CPU features depend on higher CPUID levels, which may not always
259
278
 * be available due to CPUID level capping or broken virtualization
458
477
        if (smp_num_siblings <= 1)
459
478
                goto out;
460
479
 
461
 
        if (smp_num_siblings > nr_cpu_ids) {
462
 
                pr_warning("CPU: Unsupported number of siblings %d",
463
 
                           smp_num_siblings);
464
 
                smp_num_siblings = 1;
465
 
                return;
466
 
        }
467
 
 
468
480
        index_msb = get_count_order(smp_num_siblings);
469
481
        c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
470
482
 
565
577
 
566
578
                cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
567
579
 
568
 
                if (eax > 0)
569
 
                        c->x86_capability[9] = ebx;
 
580
                c->x86_capability[9] = ebx;
570
581
        }
571
582
 
572
583
        /* AMD-defined flags: level 0x80000001 */
668
679
        c->cpu_index = 0;
669
680
#endif
670
681
        filter_cpuid_features(c, false);
 
682
 
 
683
        setup_smep(c);
671
684
}
672
685
 
673
686
void __init early_cpu_init(void)
675
688
        const struct cpu_dev *const *cdev;
676
689
        int count = 0;
677
690
 
678
 
#ifdef PROCESSOR_SELECT
 
691
#ifdef CONFIG_PROCESSOR_SELECT
679
692
        printk(KERN_INFO "KERNEL supported cpus:\n");
680
693
#endif
681
694
 
687
700
                cpu_devs[count] = cpudev;
688
701
                count++;
689
702
 
690
 
#ifdef PROCESSOR_SELECT
 
703
#ifdef CONFIG_PROCESSOR_SELECT
691
704
                {
692
705
                        unsigned int j;
693
706
 
753
766
#endif
754
767
        }
755
768
 
 
769
        setup_smep(c);
 
770
 
756
771
        get_model_name(c); /* Default name */
757
772
 
758
773
        detect_nopl(c);
885
900
 
886
901
        select_idle_routine(c);
887
902
 
888
 
#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
 
903
#ifdef CONFIG_NUMA
889
904
        numa_add_cpu(smp_processor_id());
890
905
#endif
891
906
}
903
918
void __init identify_boot_cpu(void)
904
919
{
905
920
        identify_cpu(&boot_cpu_data);
906
 
        init_c1e_mask();
 
921
        init_amd_e400_c1e_mask();
907
922
#ifdef CONFIG_X86_32
908
923
        sysenter_setup();
909
924
        enable_sep_cpu();
1085
1100
 * debugging, no special alignment required.
1086
1101
 */
1087
1102
DEFINE_PER_CPU(struct orig_ist, orig_ist);
1088
 
EXPORT_PER_CPU_SYMBOL_GPL(orig_ist);
1089
1103
 
1090
1104
#else   /* CONFIG_X86_64 */
1091
1105