diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2009-03-30 17:55:30 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-03 20:08:12 -0400 |
commit | 7237d3de78ff89ec2e18eae5fe962d063024fef5 (patch) | |
tree | 07d0196e9e3122546cc0366c686d363423bfe894 /drivers | |
parent | 8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff) |
x86, ACPI: add support for x2apic ACPI extensions
All logical processors with APIC ID values of 255 and greater will have their
APIC reported through Processor X2APIC structure (type-9 entry type) and all
logical processors with APIC ID less than 255 will have their APIC reported
through legacy Processor Local APIC (type-0 entry type) only. This is the
same case even for NMI structure reporting.
The Processor X2APIC Affinity structure provides the association between the
X2APIC ID of a logical processor and the proximity domain to which the logical
processor belongs.
For OSPM, Procssor IDs outside the 0-254 range are to be declared as Device()
objects in the ACPI namespace.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/numa.c | 46 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 26 | ||||
-rw-r--r-- | drivers/acpi/tables.c | 30 |
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 | ||
198 | void __init __attribute__ ((weak)) | ||
199 | acpi_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 | |||
207 | static int __init | ||
208 | acpi_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 | |||
183 | static int __init | 225 | static int __init |
184 | acpi_parse_processor_affinity(struct acpi_subtable_header * header, | 226 | acpi_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 | ||
430 | static 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; | ||
448 | found: | ||
449 | *apic_id = tmp; | ||
450 | return 1; | ||
451 | } | ||
452 | |||
430 | static int map_lsapic_id(struct acpi_subtable_header *entry, | 453 | static 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 = |