aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 01:51:51 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 01:51:51 -0400
commit33526a53600ac887d100e3c9b4be3637ac8ae3a5 (patch)
tree646cb10e5f02bbbd913eafe9dbc1cfa80166f20e /drivers/acpi
parent47ae106d3f37e1fd715975eaf8130e20e171cf52 (diff)
parent786c221a37d3931189d9c9421f63dec92f4d698b (diff)
Merge branch 'x2apic' into release
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/numa.c46
-rw-r--r--drivers/acpi/processor_core.c26
-rw-r--r--drivers/acpi/tables.c30
3 files changed, 101 insertions, 1 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 3a0d8ef25c75..d440ccd27d91 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -131,6 +131,21 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
131#endif /* ACPI_DEBUG_OUTPUT */ 131#endif /* ACPI_DEBUG_OUTPUT */
132 break; 132 break;
133 133
134 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
135#ifdef ACPI_DEBUG_OUTPUT
136 {
137 struct acpi_srat_x2apic_cpu_affinity *p =
138 (struct acpi_srat_x2apic_cpu_affinity *)header;
139 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
140 "SRAT Processor (x2apicid[0x%08x]) in"
141 " proximity domain %d %s\n",
142 p->apic_id,
143 p->proximity_domain,
144 (p->flags & ACPI_SRAT_CPU_ENABLED) ?
145 "enabled" : "disabled"));
146 }
147#endif /* ACPI_DEBUG_OUTPUT */
148 break;
134 default: 149 default:
135 printk(KERN_WARNING PREFIX 150 printk(KERN_WARNING PREFIX
136 "Found unsupported SRAT entry (type = 0x%x)\n", 151 "Found unsupported SRAT entry (type = 0x%x)\n",
@@ -180,8 +195,35 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
180 return 0; 195 return 0;
181} 196}
182 197
198void __init __attribute__ ((weak))
199acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
200{
201 printk(KERN_WARNING PREFIX
202 "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id);
203 return;
204}
205
206
207static int __init
208acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
209 const unsigned long end)
210{
211 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
212
213 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
214 if (!processor_affinity)
215 return -EINVAL;
216
217 acpi_table_print_srat_entry(header);
218
219 /* let architecture-dependent part to do it */
220 acpi_numa_x2apic_affinity_init(processor_affinity);
221
222 return 0;
223}
224
183static int __init 225static int __init
184acpi_parse_processor_affinity(struct acpi_subtable_header * header, 226acpi_parse_processor_affinity(struct acpi_subtable_header *header,
185 const unsigned long end) 227 const unsigned long end)
186{ 228{
187 struct acpi_srat_cpu_affinity *processor_affinity; 229 struct acpi_srat_cpu_affinity *processor_affinity;
@@ -241,6 +283,8 @@ int __init acpi_numa_init(void)
241{ 283{
242 /* SRAT: Static Resource Affinity Table */ 284 /* SRAT: Static Resource Affinity Table */
243 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { 285 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
286 acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
287 acpi_parse_x2apic_affinity, NR_CPUS);
244 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, 288 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
245 acpi_parse_processor_affinity, NR_CPUS); 289 acpi_parse_processor_affinity, NR_CPUS);
246 acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, 290 acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 0cc2fd31e376..775324e34ffa 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -427,6 +427,29 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
427 return 0; 427 return 0;
428} 428}
429 429
430static int map_x2apic_id(struct acpi_subtable_header *entry,
431 int device_declaration, u32 acpi_id, int *apic_id)
432{
433 struct acpi_madt_local_x2apic *apic =
434 (struct acpi_madt_local_x2apic *)entry;
435 u32 tmp = apic->local_apic_id;
436
437 /* Only check enabled APICs*/
438 if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
439 return 0;
440
441 /* Device statement declaration type */
442 if (device_declaration) {
443 if (apic->uid == acpi_id)
444 goto found;
445 }
446
447 return 0;
448found:
449 *apic_id = tmp;
450 return 1;
451}
452
430static int map_lsapic_id(struct acpi_subtable_header *entry, 453static int map_lsapic_id(struct acpi_subtable_header *entry,
431 int device_declaration, u32 acpi_id, int *apic_id) 454 int device_declaration, u32 acpi_id, int *apic_id)
432{ 455{
@@ -476,6 +499,9 @@ static int map_madt_entry(int type, u32 acpi_id)
476 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) { 499 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
477 if (map_lapic_id(header, acpi_id, &apic_id)) 500 if (map_lapic_id(header, acpi_id, &apic_id))
478 break; 501 break;
502 } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
503 if (map_x2apic_id(header, type, acpi_id, &apic_id))
504 break;
479 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 505 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
480 if (map_lsapic_id(header, type, acpi_id, &apic_id)) 506 if (map_lsapic_id(header, type, acpi_id, &apic_id))
481 break; 507 break;
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index a8852952fac4..991c006a301b 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -62,6 +62,18 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
62 } 62 }
63 break; 63 break;
64 64
65 case ACPI_MADT_TYPE_LOCAL_X2APIC:
66 {
67 struct acpi_madt_local_x2apic *p =
68 (struct acpi_madt_local_x2apic *)header;
69 printk(KERN_INFO PREFIX
70 "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
71 p->local_apic_id, p->uid,
72 (p->lapic_flags & ACPI_MADT_ENABLED) ?
73 "enabled" : "disabled");
74 }
75 break;
76
65 case ACPI_MADT_TYPE_IO_APIC: 77 case ACPI_MADT_TYPE_IO_APIC:
66 { 78 {
67 struct acpi_madt_io_apic *p = 79 struct acpi_madt_io_apic *p =
@@ -116,6 +128,24 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
116 } 128 }
117 break; 129 break;
118 130
131 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
132 {
133 u16 polarity, trigger;
134 struct acpi_madt_local_x2apic_nmi *p =
135 (struct acpi_madt_local_x2apic_nmi *)header;
136
137 polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK;
138 trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
139
140 printk(KERN_INFO PREFIX
141 "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
142 p->uid,
143 mps_inti_flags_polarity[polarity],
144 mps_inti_flags_trigger[trigger],
145 p->lint);
146 }
147 break;
148
119 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: 149 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
120 { 150 {
121 struct acpi_madt_local_apic_override *p = 151 struct acpi_madt_local_apic_override *p =