linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Nishanth Aravamudan <nacc@us.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	jlarrew@linux.vnet.ibm.com
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 3/5] powerpc/numa: Add length when creating OF properties via VPHN
Date: Sun, 30 Jan 2011 09:28:04 +1100	[thread overview]
Message-ID: <20110130092804.45c80318@kryten> (raw)
In-Reply-To: <20110130092434.42a887ef@kryten>


The rest of the NUMA code expects an OF associativity property with
the first cell containing the length. Without this fix all topology changes
cause us to misparse the property and put the cpu into node 0.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-2.6/arch/powerpc/mm/numa.c
===================================================================
--- linux-2.6.orig/arch/powerpc/mm/numa.c	2011-01-29 12:45:09.257654450 +1100
+++ linux-2.6/arch/powerpc/mm/numa.c	2011-01-29 12:56:30.854975882 +1100
@@ -1356,8 +1356,11 @@ static int update_cpu_associativity_chan
 	return nr_cpus;
 }
 
-/* 6 64-bit registers unpacked into 12 32-bit associativity values */
-#define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32))
+/*
+ * 6 64-bit registers unpacked into 12 32-bit associativity values. To form
+ * the complete property we have to add the length in the first cell.
+ */
+#define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32) + 1)
 
 /*
  * Convert the associativity domain numbers returned from the hypervisor
@@ -1373,7 +1376,7 @@ static int vphn_unpack_associativity(con
 #define VPHN_FIELD_MSB		(0x8000)
 #define VPHN_FIELD_MASK		(~VPHN_FIELD_MSB)
 
-	for (i = 0; i < VPHN_ASSOC_BUFSIZE; i++) {
+	for (i = 1; i < VPHN_ASSOC_BUFSIZE; i++) {
 		if (*field == VPHN_FIELD_UNUSED) {
 			/* All significant fields processed, and remaining
 			 * fields contain the reserved value of all 1's.
@@ -1398,6 +1401,9 @@ static int vphn_unpack_associativity(con
 		}
 	}
 
+	/* The first cell contains the length of the property */
+	unpacked[0] = nr_assoc_doms;
+
 	return nr_assoc_doms;
 }
 

  parent reply	other threads:[~2011-01-29 22:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18  1:31 2.6.37-git17 virtual IO boot failure Anton Blanchard
2011-01-18 22:47 ` Nishanth Aravamudan
2011-01-19  0:48   ` Nishanth Aravamudan
2011-01-19  6:06     ` Benjamin Herrenschmidt
2011-01-19 22:26       ` Nishanth Aravamudan
2011-01-19  4:06   ` Benjamin Herrenschmidt
2011-01-19  4:37     ` Nishanth Aravamudan
2011-01-19  4:54       ` Benjamin Herrenschmidt
2011-01-29 22:22       ` Anton Blanchard
2011-01-29 22:24         ` [PATCH 1/5] powerpc/numa: Only use active VPHN count fields Anton Blanchard
2011-01-29 22:26           ` [PATCH 2/5] powerpc/numa: Check for all VPHN changes Anton Blanchard
2011-01-29 22:28           ` Anton Blanchard [this message]
2011-01-29 22:35           ` [PATCH 4/5] powerpc/numa: Disable VPHN on dedicated processor partitions Anton Blanchard
2011-01-29 22:37           ` [PATCH 5/5] powerpc/numa: Fix bug in unmap_cpu_from_node Anton Blanchard

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=20110130092804.45c80318@kryten \
    --to=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=jlarrew@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=nacc@us.ibm.com \
    /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).