ia64/xen-unstable

changeset 16524:3dc3a5feeb60

x86: Sync cpu/common.c with Linux 2.6.18.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Dec 05 09:56:17 2007 +0000 (2007-12-05)
parents 9cc381efbc29
children eb4aa1a07e21
files xen/arch/x86/cpu/common.c
line diff
     1.1 --- a/xen/arch/x86/cpu/common.c	Wed Dec 05 09:46:55 2007 +0000
     1.2 +++ b/xen/arch/x86/cpu/common.c	Wed Dec 05 09:56:17 2007 +0000
     1.3 @@ -17,9 +17,9 @@
     1.4  #define tsc_disable 0
     1.5  #define disable_pse 0
     1.6  
     1.7 -static int cachesize_override __devinitdata = -1;
     1.8 -static int disable_x86_fxsr __devinitdata = 0;
     1.9 -static int disable_x86_serial_nr __devinitdata = 0;
    1.10 +static int cachesize_override __cpuinitdata = -1;
    1.11 +static int disable_x86_fxsr __cpuinitdata;
    1.12 +static int disable_x86_serial_nr __cpuinitdata;
    1.13  
    1.14  struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
    1.15  
    1.16 @@ -44,12 +44,13 @@ static void default_init(struct cpuinfo_
    1.17  
    1.18  static struct cpu_dev default_cpu = {
    1.19  	.c_init	= default_init,
    1.20 +	.c_vendor = "Unknown",
    1.21  };
    1.22  static struct cpu_dev * this_cpu = &default_cpu;
    1.23  
    1.24  integer_param("cachesize", cachesize_override);
    1.25  
    1.26 -int __devinit get_model_name(struct cpuinfo_x86 *c)
    1.27 +int __cpuinit get_model_name(struct cpuinfo_x86 *c)
    1.28  {
    1.29  	unsigned int *v;
    1.30  	char *p, *q;
    1.31 @@ -79,7 +80,7 @@ int __devinit get_model_name(struct cpui
    1.32  }
    1.33  
    1.34  
    1.35 -void __devinit display_cacheinfo(struct cpuinfo_x86 *c)
    1.36 +void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
    1.37  {
    1.38  	unsigned int n, dummy, ecx, edx, l2size;
    1.39  
    1.40 @@ -120,7 +121,7 @@ void __devinit display_cacheinfo(struct 
    1.41  /* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
    1.42  
    1.43  /* Look up CPU names by table lookup. */
    1.44 -static char __devinit *table_lookup_model(struct cpuinfo_x86 *c)
    1.45 +static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)
    1.46  {
    1.47  	struct cpu_model_info *info;
    1.48  
    1.49 @@ -141,10 +142,11 @@ static char __devinit *table_lookup_mode
    1.50  }
    1.51  
    1.52  
    1.53 -static void __devinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
    1.54 +static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
    1.55  {
    1.56  	char *v = c->x86_vendor_id;
    1.57  	int i;
    1.58 +	static int printed;
    1.59  
    1.60  	for (i = 0; i < X86_VENDOR_NUM; i++) {
    1.61  		if (cpu_devs[i]) {
    1.62 @@ -154,10 +156,17 @@ static void __devinit get_cpu_vendor(str
    1.63  				c->x86_vendor = i;
    1.64  				if (!early)
    1.65  					this_cpu = cpu_devs[i];
    1.66 -				break;
    1.67 +				return;
    1.68  			}
    1.69  		}
    1.70  	}
    1.71 +	if (!printed) {
    1.72 +		printed++;
    1.73 +		printk(KERN_ERR "CPU: Vendor unknown, using generic init.\n");
    1.74 +		printk(KERN_ERR "CPU: Your system may be unstable.\n");
    1.75 +	}
    1.76 +	c->x86_vendor = X86_VENDOR_UNKNOWN;
    1.77 +	this_cpu = &default_cpu;
    1.78  }
    1.79  
    1.80  
    1.81 @@ -187,7 +196,7 @@ static inline int flag_is_changeable_p(u
    1.82  
    1.83  
    1.84  /* Probe for the CPUID instruction */
    1.85 -static int __devinit have_cpuid_p(void)
    1.86 +static int __cpuinit have_cpuid_p(void)
    1.87  {
    1.88  	return flag_is_changeable_p(X86_EFLAGS_ID);
    1.89  }
    1.90 @@ -232,7 +241,7 @@ static void __init early_cpu_detect(void
    1.91  	}
    1.92  }
    1.93  
    1.94 -void __devinit generic_identify(struct cpuinfo_x86 * c)
    1.95 +void __cpuinit generic_identify(struct cpuinfo_x86 * c)
    1.96  {
    1.97  	u32 tfms, xlvl;
    1.98  
    1.99 @@ -255,10 +264,10 @@ void __devinit generic_identify(struct c
   1.100  			c->x86_capability[4] = excap;
   1.101  			c->x86 = (tfms >> 8) & 15;
   1.102  			c->x86_model = (tfms >> 4) & 15;
   1.103 -			if (c->x86 == 0xf) {
   1.104 +			if (c->x86 == 0xf)
   1.105  				c->x86 += (tfms >> 20) & 0xff;
   1.106 +			if (c->x86 >= 0x6)
   1.107  				c->x86_model += ((tfms >> 16) & 0xF) << 4;
   1.108 -			} 
   1.109  			c->x86_mask = tfms & 15;
   1.110  			if ( cpu_has(c, X86_FEATURE_CLFLSH) )
   1.111  				c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
   1.112 @@ -286,7 +295,7 @@ void __devinit generic_identify(struct c
   1.113  #endif
   1.114  }
   1.115  
   1.116 -static void __devinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
   1.117 +static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
   1.118  {
   1.119  	if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
   1.120  		/* Disable processor serial number */
   1.121 @@ -309,7 +318,7 @@ boolean_param("noserialnumber", disable_
   1.122  /*
   1.123   * This does the hard work of actually picking apart the CPU stuff...
   1.124   */
   1.125 -void __devinit identify_cpu(struct cpuinfo_x86 *c)
   1.126 +void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
   1.127  {
   1.128  	int i;
   1.129  
   1.130 @@ -446,7 +455,7 @@ static inline u32 phys_pkg_id(u32 cpuid_
   1.131  	return hard_smp_processor_id() >> index_msb;
   1.132  }
   1.133  
   1.134 -void __devinit detect_ht(struct cpuinfo_x86 *c)
   1.135 +void __cpuinit detect_ht(struct cpuinfo_x86 *c)
   1.136  {
   1.137  	u32 	eax, ebx, ecx, edx;
   1.138  	int 	index_msb, core_bits;
   1.139 @@ -493,7 +502,7 @@ void __devinit detect_ht(struct cpuinfo_
   1.140  }
   1.141  #endif
   1.142  
   1.143 -void __devinit print_cpu_info(struct cpuinfo_x86 *c)
   1.144 +void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
   1.145  {
   1.146  	char *vendor = NULL;
   1.147  
   1.148 @@ -516,7 +525,7 @@ void __devinit print_cpu_info(struct cpu
   1.149  		printk("\n");
   1.150  }
   1.151  
   1.152 -cpumask_t cpu_initialized __devinitdata = CPU_MASK_NONE;
   1.153 +cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
   1.154  
   1.155  /* This is hacky. :)
   1.156   * We're emulating future behavior.
   1.157 @@ -551,7 +560,7 @@ void __init early_cpu_init(void)
   1.158   * and IDT. We reload them nevertheless, this function acts as a
   1.159   * 'CPU state barrier', nothing should get across.
   1.160   */
   1.161 -void __devinit cpu_init(void)
   1.162 +void __cpuinit cpu_init(void)
   1.163  {
   1.164  	int cpu = smp_processor_id();
   1.165  	struct tss_struct *t = &init_tss[cpu];