diff options
| author | Andi Kleen <ak@suse.de> | 2006-02-03 15:51:26 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-04 19:43:14 -0500 |
| commit | d22fe808449cd3b5bacd5c0d447e3675f9ab7619 (patch) | |
| tree | 25aa14735359aa4fe24a28439efa672850828bbf | |
| parent | 7ded56895c11a656408b6ff21086ae04a6a7cda0 (diff) | |
[PATCH] x86_64: Do more checking in the SRAT header code
- Check if the processor/memory affinity entries are long enough
according to the ACPI 3.0 spec.
- Ignore memory affinity entries that define a zero length region.
All based on BIOS issues found in the field @)
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/x86_64/mm/srat.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 3bd827f5611f..cd25300726fc 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
| @@ -135,7 +135,12 @@ void __init | |||
| 135 | acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) | 135 | acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) |
| 136 | { | 136 | { |
| 137 | int pxm, node; | 137 | int pxm, node; |
| 138 | if (srat_disabled() || pa->flags.enabled == 0) | 138 | if (srat_disabled()) |
| 139 | return; | ||
| 140 | if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) { bad_srat(); | ||
| 141 | return; | ||
| 142 | } | ||
| 143 | if (pa->flags.enabled == 0) | ||
| 139 | return; | 144 | return; |
| 140 | pxm = pa->proximity_domain; | 145 | pxm = pa->proximity_domain; |
| 141 | node = setup_node(pxm); | 146 | node = setup_node(pxm); |
| @@ -159,8 +164,16 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) | |||
| 159 | int node, pxm; | 164 | int node, pxm; |
| 160 | int i; | 165 | int i; |
| 161 | 166 | ||
| 162 | if (srat_disabled() || ma->flags.enabled == 0) | 167 | if (srat_disabled()) |
| 163 | return; | 168 | return; |
| 169 | if (ma->header.length != sizeof(struct acpi_table_memory_affinity)) { | ||
| 170 | bad_srat(); | ||
| 171 | return; | ||
| 172 | } | ||
| 173 | if (ma->flags.enabled == 0) | ||
| 174 | return; | ||
| 175 | start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32); | ||
| 176 | end = start + (ma->length_lo | ((u64)ma->length_hi << 32)); | ||
| 164 | pxm = ma->proximity_domain; | 177 | pxm = ma->proximity_domain; |
| 165 | node = setup_node(pxm); | 178 | node = setup_node(pxm); |
| 166 | if (node < 0) { | 179 | if (node < 0) { |
| @@ -168,8 +181,6 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) | |||
| 168 | bad_srat(); | 181 | bad_srat(); |
| 169 | return; | 182 | return; |
| 170 | } | 183 | } |
| 171 | start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32); | ||
| 172 | end = start + (ma->length_lo | ((u64)ma->length_hi << 32)); | ||
| 173 | /* It is fine to add this area to the nodes data it will be used later*/ | 184 | /* It is fine to add this area to the nodes data it will be used later*/ |
| 174 | if (ma->flags.hot_pluggable == 1) | 185 | if (ma->flags.hot_pluggable == 1) |
| 175 | printk(KERN_INFO "SRAT: hot plug zone found %lx - %lx \n", | 186 | printk(KERN_INFO "SRAT: hot plug zone found %lx - %lx \n", |
