Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1382977 > unrolled thread
| Started by | David Daney <ddaney.cavm@gmail.com> |
|---|---|
| First post | 2016-04-20 03:50 +0200 |
| Last post | 2016-04-20 03:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v5 11/14] acpi, numa, srat: Improve SRAT error detection and add messages. David Daney <ddaney.cavm@gmail.com> - 2016-04-20 03:50 +0200
| From | David Daney <ddaney.cavm@gmail.com> |
|---|---|
| Date | 2016-04-20 03:50 +0200 |
| Subject | [PATCH v5 11/14] acpi, numa, srat: Improve SRAT error detection and add messages. |
| Message-ID | <rpPrb-8e3-15@gated-at.bofh.it> |
From: David Daney <david.daney@cavium.com>
Loosely based on code from Robert Richter and Hanjun Guo.
Improve out of range node detection as well as allow for Larger SRAT
entities.
Add printing of nice messages.
Signed-off-by: David Daney <david.daney@cavium.com>
---
drivers/acpi/numa.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 8ba90ad..d244018 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -252,8 +252,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
if (srat_disabled())
goto out_err;
- if (ma->header.length != sizeof(struct acpi_srat_mem_affinity))
+ if (ma->header.length < sizeof(struct acpi_srat_mem_affinity)) {
+ pr_err("SRAT: Unexpected header length: %d\n",
+ ma->header.length);
goto out_err_bad_srat;
+ }
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
goto out_err;
hotpluggable = ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE;
@@ -267,13 +270,17 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
pxm &= 0xff;
node = acpi_map_pxm_to_node(pxm);
- if (node < 0) {
- printk(KERN_ERR "SRAT: Too many proximity domains.\n");
+ if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
+ pr_err("SRAT: Too many proximity domains.\n");
goto out_err_bad_srat;
}
- if (numa_add_memblk(node, start, end) < 0)
+ if (numa_add_memblk(node, start, end) < 0) {
+ pr_err("SRAT: Failed to add memblk to node %u [mem %#010Lx-%#010Lx]\n",
+ node, (unsigned long long) start,
+ (unsigned long long) end - 1);
goto out_err_bad_srat;
+ }
node_set(node, numa_nodes_parsed);
--
1.7.11.7
Back to top | Article view | linux.kernel
csiph-web