stable.vger.kernel.org archive mirror
 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, Len Brown <lenb@kernel.org>
Subject: [PATCH 2/3]: x86-64: Handle SRAT v1 and v2 consistently
Date: Sun, 15 Jan 2012 22:36:10 +0100	[thread overview]
Message-ID: <20120115213610.GV12380@tpkurt2.garloff.de> (raw)
In-Reply-To: <20120115213005.GT12380@tpkurt2.garloff.de>


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

Hi,

x86-64 was rather inconsistent prior to this patch; it used 8 bits 
for the pxm field in cpu_affinity, but 32 bits in mem_affinity.
This patch makes it consistent: Either use 8 bits consistently (SRAT
rev 1 or lower) or 32 bits (SRAT rev 2 or higher).

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


[-- Attachment #1.2: acpi_srat-pxm-rev-x86-64.patch --]
[-- Type: text/x-patch, Size: 1654 bytes --]

From: Kurt Garloff <kurt@garloff.de>
Subject: Use SRAT table rev to use 8bit or 32bit PXM fields (x86/x86-64)
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.

x86/x86-64 was rather inconsistent prior to this patch; it used 8 bits 
for the pxm field in cpu_affinity, but 32 bits in mem_affinity.
This patch makes it consistent: Either use 8 bits consistently (SRAT
rev 1 or lower) or 32 bits (SRAT rev 2 or higher).

This is patch 2/3.

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

---
 arch/x86/mm/srat.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6.git/arch/x86/mm/srat.c
===================================================================
--- linux-2.6.git.orig/arch/x86/mm/srat.c
+++ linux-2.6.git/arch/x86/mm/srat.c
@@ -108,8 +108,10 @@ acpi_numa_processor_affinity_init(struct
 	}
 	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
 		return;
 	pxm = pa->proximity_domain_lo;
+	if (acpi_srat_revision >= 2)
+		pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8;
 	node = setup_node(pxm);
 	if (node < 0) {
 		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
@@ -159,8 +161,10 @@ acpi_numa_memory_affinity_init(struct ac
 		return;
 	start = ma->base_address;
 	end = start + ma->length;
 	pxm = ma->proximity_domain;
+	if (acpi_srat_revision <= 1)
+		pxm &= 0xff;
 	node = setup_node(pxm);
 	if (node < 0) {
 		printk(KERN_ERR "SRAT: Too many proximity domains.\n");
 		bad_srat();

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

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

Thread overview: 5+ 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 ` [PATCH 1/3]: Store SRAT revision Kurt Garloff
2012-01-15 21:52   ` Greg KH
2012-01-15 21:36 ` Kurt Garloff [this message]
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=20120115213610.GV12380@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;
as well as URLs for NNTP newsgroup(s).