ia64/xen-unstable
changeset 225:0fd36a1adb1d
bitkeeper revision 1.83 (3e5636c8h7gxJ2TkjvrnmiqkZh15Bg)
cpufeature.h, kernel.c, setup.c, mpparse.c:
Hyperthreading support. We now parse ACPI tables at start of day. Both can be disabled with 'noht' and 'noacpi' cmdline options.
cpufeature.h, kernel.c, setup.c, mpparse.c:
Hyperthreading support. We now parse ACPI tables at start of day. Both can be disabled with 'noht' and 'noacpi' cmdline options.
author | kaf24@labyrinth.cl.cam.ac.uk |
---|---|
date | Fri Feb 21 14:25:12 2003 +0000 (2003-02-21) |
parents | b05b1796e256 |
children | 8554489b6ce4 |
files | xen-2.4.16/arch/i386/mpparse.c xen-2.4.16/arch/i386/setup.c xen-2.4.16/common/kernel.c xen-2.4.16/include/asm-i386/cpufeature.h |
line diff
1.1 --- a/xen-2.4.16/arch/i386/mpparse.c Fri Feb 21 13:31:42 2003 +0000 1.2 +++ b/xen-2.4.16/arch/i386/mpparse.c Fri Feb 21 14:25:12 2003 +0000 1.3 @@ -781,7 +781,7 @@ void __init get_smp_config (void) 1.4 * processor(s) that are provided by the MPS. We attempt to 1.5 * check only if the user provided a commandline override 1.6 */ 1.7 - //XXX Xen config_acpi_tables(); 1.8 + config_acpi_tables(); 1.9 #endif 1.10 1.11 printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
2.1 --- a/xen-2.4.16/arch/i386/setup.c Fri Feb 21 13:31:42 2003 +0000 2.2 +++ b/xen-2.4.16/arch/i386/setup.c Fri Feb 21 14:25:12 2003 +0000 2.3 @@ -103,6 +103,7 @@ static void __init init_amd(struct cpuin 2.4 */ 2.5 void __init identify_cpu(struct cpuinfo_x86 *c) 2.6 { 2.7 + extern int opt_noht, opt_noacpi; 2.8 int junk, i; 2.9 u32 xlvl, tfms; 2.10 2.11 @@ -163,6 +164,12 @@ void __init identify_cpu(struct cpuinfo_ 2.12 panic("Only support Intel processors (P6+)\n"); 2.13 } 2.14 2.15 + if ( opt_noht ) 2.16 + { 2.17 + opt_noacpi = 1; /* Virtual CPUs only appear in ACPI tables. */ 2.18 + clear_bit(X86_FEATURE_HT, &c->x86_capability[0]); 2.19 + } 2.20 + 2.21 printk("CPU caps: %08x %08x %08x %08x\n", 2.22 c->x86_capability[0], 2.23 c->x86_capability[1],
3.1 --- a/xen-2.4.16/common/kernel.c Fri Feb 21 13:31:42 2003 +0000 3.2 +++ b/xen-2.4.16/common/kernel.c Fri Feb 21 14:25:12 2003 +0000 3.3 @@ -45,7 +45,8 @@ unsigned long opt_dom0_ip = 0; 3.4 unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */ 3.5 unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */ 3.6 unsigned char opt_ifname[10] = "eth0"; 3.7 -enum { OPT_IP, OPT_STR, OPT_UINT }; 3.8 +int opt_noht=0, opt_noacpi=0; 3.9 +enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL }; 3.10 static struct { 3.11 unsigned char *name; 3.12 int type; 3.13 @@ -55,6 +56,8 @@ static struct { 3.14 { "dom0_mem", OPT_UINT, &opt_dom0_mem }, 3.15 { "ne_base", OPT_UINT, &opt_ne_base }, 3.16 { "ifname", OPT_STR, &opt_ifname }, 3.17 + { "noht", OPT_BOOL, &opt_noht }, 3.18 + { "noacpi", OPT_BOOL, &opt_noacpi }, 3.19 { NULL, 0, NULL } 3.20 }; 3.21 3.22 @@ -125,27 +128,31 @@ void cmain (unsigned long magic, multibo 3.23 while ( cmdline != NULL ) 3.24 { 3.25 while ( *cmdline == ' ' ) cmdline++; 3.26 - if ( (opt = strchr(cmdline, '=')) == NULL ) break; 3.27 - *opt++ = '\0'; 3.28 - opt_end = strchr(opt, ' '); 3.29 + if ( *cmdline == '\0' ) break; 3.30 + opt_end = strchr(cmdline, ' '); 3.31 if ( opt_end != NULL ) *opt_end++ = '\0'; 3.32 + opt = strchr(cmdline, '='); 3.33 + if ( opt != NULL ) *opt++ = '\0'; 3.34 for ( i = 0; opts[i].name != NULL; i++ ) 3.35 { 3.36 - if ( strcmp(opts[i].name, cmdline ) == 0 ) 3.37 + if ( strcmp(opts[i].name, cmdline ) != 0 ) continue; 3.38 + switch ( opts[i].type ) 3.39 { 3.40 - if ( opts[i].type == OPT_IP ) 3.41 - { 3.42 + case OPT_IP: 3.43 + if ( opt != NULL ) 3.44 *(unsigned long *)opts[i].var = str_to_quad(opt); 3.45 - } 3.46 - else if(opts[i].type == OPT_STR) 3.47 - { 3.48 + break; 3.49 + case OPT_STR: 3.50 + if ( opt != NULL ) 3.51 strcpy(opts[i].var, opt); 3.52 - } 3.53 - else /* opts[i].type == OPT_UINT */ 3.54 - { 3.55 + break; 3.56 + case OPT_UINT: 3.57 + if ( opt != NULL ) 3.58 *(unsigned int *)opts[i].var = 3.59 simple_strtol(opt, (char **)&opt, 0); 3.60 - } 3.61 + break; 3.62 + case OPT_BOOL: 3.63 + *(int *)opts[i].var = 1; 3.64 break; 3.65 } 3.66 }
4.1 --- a/xen-2.4.16/include/asm-i386/cpufeature.h Fri Feb 21 13:31:42 2003 +0000 4.2 +++ b/xen-2.4.16/include/asm-i386/cpufeature.h Fri Feb 21 14:25:12 2003 +0000 4.3 @@ -40,6 +40,7 @@ 4.4 #define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */ 4.5 #define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */ 4.6 #define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */ 4.7 +#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */ 4.8 #define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */ 4.9 #define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */ 4.10 4.11 @@ -63,6 +64,8 @@ 4.12 #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ 4.13 #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ 4.14 4.15 +#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) 4.16 + 4.17 #endif /* __ASM_I386_CPUFEATURE_H */ 4.18 4.19 /*