public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Garloff <kurt@garloff.de>
To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: stable@vger.kernel.org, lenb@kernel.org
Subject: [PATCH 1/3]: Store SRAT revision
Date: Sun, 15 Jan 2012 22:34:07 +0100	[thread overview]
Message-ID: <20120115213407.GU12380@tpkurt2.garloff.de> (raw)
In-Reply-To: <20120115213005.GT12380@tpkurt2.garloff.de>


[-- Attachment #1.1: Type: text/plain, Size: 187 bytes --]

Hi,

This patch stores the SRAT table revision for later consumption
by arch specific __init functions.


This is patch 1/3.
-- 
Kurt Garloff <kurt@garloff.de>  [Koeln/Greven]


[-- Attachment #1.2: acpi_srat-pxm-rev-store.patch --]
[-- Type: text/x-patch, Size: 2074 bytes --]

From: Kurt Garloff <kurt@garloff.de>
Subject: Store SRAT table revision
References: bnc#503038

In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
32bits for these. The new fields were reserved before.
According to the ACPI spec, the OS must disregrard reserved fields.
In order to know whether or not, we must know what version the SRAT
table has.

This patch stores the SRAT table revision for later consumption
by arch specific __init functions.

This is patch 1/3.

Signed-off-by: Kurt Garloff <kurt@garloff.de>

---
 drivers/acpi/numa.c      |    3 +++
 include/acpi/acpi_numa.h |    1 +
 2 files changed, 4 insertions(+)

Index: linux-2.6.git/drivers/acpi/numa.c
===================================================================
--- linux-2.6.git.orig/drivers/acpi/numa.c
+++ linux-2.6.git/drivers/acpi/numa.c
@@ -44,8 +44,10 @@ static int pxm_to_node_map[MAX_PXM_DOMAI
 			= { [0 ... MAX_PXM_DOMAINS - 1] = NUMA_NO_NODE };
 static int node_to_pxm_map[MAX_NUMNODES]
 			= { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
 
+unsigned char acpi_srat_revision __initdata;
+
 int pxm_to_node(int pxm)
 {
 	if (pxm < 0)
 		return NUMA_NO_NODE;
@@ -254,11 +256,15 @@ acpi_parse_memory_affinity(struct acpi_s
 }
 
 static int __init acpi_parse_srat(struct acpi_table_header *table)
 {
+	struct acpi_table_srat *srat;
 	if (!table)
 		return -EINVAL;
 
+  	srat = (struct acpi_table_srat *)table;
+	acpi_srat_revision = srat->header.revision;
+
 	/* Real work done in acpi_table_parse_srat below. */
 
 	return 0;
 }
Index: linux-2.6.git/include/acpi/acpi_numa.h
===================================================================
--- linux-2.6.git.orig/include/acpi/acpi_numa.h
+++ linux-2.6.git/include/acpi/acpi_numa.h
@@ -14,7 +14,8 @@
 extern int pxm_to_node(int);
 extern int node_to_pxm(int);
 extern void __acpi_map_pxm_to_node(int, int);
 extern int acpi_map_pxm_to_node(int);
+extern unsigned char acpi_srat_revision;
 
 #endif				/* CONFIG_ACPI_NUMA */
 #endif				/* __ACP_NUMA_H */

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2012-01-15 21:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 21:30 [PATCH 0/3] ACPI SRAT: Disregard reserved PXM bits Kurt Garloff
2012-01-15 21:34 ` Kurt Garloff [this message]
2012-01-15 21:52   ` [PATCH 1/3]: Store SRAT revision Greg KH
2012-01-17  9:24   ` Len Brown
2012-01-17 13:20     ` Kurt Garloff
2012-01-15 21:36 ` [PATCH 2/3]: x86-64: Handle SRAT v1 and v2 consistently Kurt Garloff
2012-01-15 21:37 ` [PATCH 3/3]: Consider SRAT rev on ia64 Kurt Garloff

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=20120115213407.GU12380@tpkurt2.garloff.de \
    --to=kurt@garloff.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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