public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: robert.richter@caviumnetworks.com (Robert Richter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT and SLIT
Date: Mon, 25 Jan 2016 11:21:48 +0100	[thread overview]
Message-ID: <20160125102148.GE24726@rric.localdomain> (raw)
In-Reply-To: <1453541967-3744-6-git-send-email-guohanjun@huawei.com>

On 23.01.16 17:39:20, Hanjun Guo wrote:
> diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
> new file mode 100644
> index 0000000..f7f7533
> --- /dev/null
> +++ b/arch/arm64/kernel/acpi_numa.c

> +/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
> +int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
> +{
> +	u64 start, end;
> +	int node, pxm;
> +
> +	if (srat_disabled())
> +		return -EINVAL;
> +
> +	if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {

Must be:

	ma->header.length < sizeof(struct acpi_srat_mem_affinity)) {

Allow extensions to struct acpi_srat_mem_affinity in newer versions.

> +		bad_srat();
> +		return -EINVAL;

We need a pr_err() here to avoid that numa setup fails silently due to
bad fw. This applies to all error paths.

See my delta patch below. You can merge it with your patch.

-Robert

> +	}


>From 78945c73e4ec03756a135a75133ed29694a7a0f2 Mon Sep 17 00:00:00 2001
From: Robert Richter <rrichter@cavium.com>
Date: Wed, 11 Nov 2015 09:53:39 +0100
Subject: [PATCH] arm64, acpi, numa: Add error messages for bad SRAT tables

Signed-off-by: Robert Richter <rrichter@cavium.com>
---
 arch/arm64/kernel/acpi_numa.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
index f7f7533761cd..936ad6c43740 100644
--- a/arch/arm64/kernel/acpi_numa.c
+++ b/arch/arm64/kernel/acpi_numa.c
@@ -143,6 +143,8 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
 		return;
 
 	if (pa->header.length < sizeof(struct acpi_srat_gicc_affinity)) {
+		pr_err("SRAT: Invalid SRAT header length: %d\n",
+			pa->header.length);
 		bad_srat();
 		return;
 	}
@@ -166,7 +168,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
 	}
 
 	if (get_mpidr_in_madt(pa->acpi_processor_uid, &mpidr)) {
-		pr_warn("SRAT: PXM %d with ACPI ID %d has no valid MPIDR in MADT\n",
+		pr_err("SRAT: PXM %d with ACPI ID %d has no valid MPIDR in MADT\n",
 			pxm, pa->acpi_processor_uid);
 		bad_srat();
 		return;
@@ -190,7 +192,9 @@ int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	if (srat_disabled())
 		return -EINVAL;
 
-	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);
 		bad_srat();
 		return -EINVAL;
 	}
@@ -216,10 +220,17 @@ int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		(unsigned long long) start, (unsigned long long) end - 1);
 
 	if (numa_add_memblk(node, start, (end - start)) < 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);
 		bad_srat();
 		return -EINVAL;
 	}
 
+	pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
+		node, pxm,
+		(unsigned long long) start, (unsigned long long) end - 1);
+
 	return 0;
 }
 
-- 
2.7.0.rc3

  reply	other threads:[~2016-01-25 10:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23  9:39 [PATCH v3 00/12] ACPI NUMA support for ARM64 Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 01/12] acpi, numa: Use pr_fmt() instead of printk Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 02/12] acpi, numa: Replace ACPI_DEBUG_PRINT() with pr_debug() Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 03/12] acpi, numa: remove duplicate NULL check Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 04/12] acpi, numa: introduce ACPI_HAS_NUMA_ARCH_FIXUP Hanjun Guo
2016-01-23 10:25   ` Robert Richter
2016-01-24  4:56     ` Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT and SLIT Hanjun Guo
2016-01-25 10:21   ` Robert Richter [this message]
2016-01-27  7:12     ` Hanjun Guo
2016-01-27 14:01       ` Robert Richter
2016-01-28  3:16         ` Hanjun Guo
2016-02-01 18:09   ` Robert Richter
2016-02-02 11:30     ` Hanjun Guo
2016-02-02 17:00       ` Lorenzo Pieralisi
2016-03-02 14:10     ` Matthias Brugger
2016-03-02 14:10     ` Matthias Brugger
2016-03-02 14:08   ` Matthias Brugger
2016-03-10  9:50     ` Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 06/12] acpi, numa: Enable ACPI based NUMA on ARM64 Hanjun Guo
2016-01-29 16:37   ` Robert Richter
2016-01-23  9:39 ` [PATCH v3 07/12] acpi, numa: move acpi_numa_slit_init() to common place Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 08/12] arm64, numa: rework numa_add_memblk() Hanjun Guo
2016-01-25  9:34   ` Robert Richter
2016-01-27  6:20     ` Hanjun Guo
2016-03-09 12:27   ` Robert Richter
2016-03-10 10:10     ` Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 09/12] x86, acpi, numa: cleanup acpi_numa_processor_affinity_init() Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 10/12] acpi, numa: move bad_srat() and srat_disabled() to common place Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 11/12] acpi, numa: remove unneeded acpi_numa=1 Hanjun Guo
2016-01-23  9:39 ` [PATCH v3 12/12] acpi, numa: reuse acpi_numa_memory_affinity_init() Hanjun Guo
2016-01-25 10:26   ` Robert Richter
2016-01-27  6:15     ` Hanjun Guo
2016-01-27 14:18       ` Robert Richter
2016-01-28  2:48         ` Hanjun Guo
2016-01-28 13:31           ` Robert Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125102148.GE24726@rric.localdomain \
    --to=robert.richter@caviumnetworks.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox