public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba•org>
To: Olaf Hering <olh@suse•de>
Cc: linuxppc-dev@ozlabs•org
Subject: [PATCH] ppc64: poison invalid cpus
Date: Sat, 11 Feb 2006 22:55:09 +1100	[thread overview]
Message-ID: <20060211115509.GA7922@krispykreme> (raw)
In-Reply-To: <20060210140008.GA11864@suse.de>


Ensure that per cpu access to !possible cpus causes a fault instead of silent
corruption.

Signed-off-by: Anton Blanchard <anton@samba•org>
Signed-off-by: Olaf Hering <olh@suse•de>
---

Thanks Olaf, I had forgotten to send it out.

Index: linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c
===================================================================
--- linux-2.6.16-rc1-git3.orig/arch/powerpc/kernel/setup_64.c
+++ linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c
@@ -670,6 +670,14 @@ void __init setup_per_cpu_areas(void)
 		size = PERCPU_ENOUGH_ROOM;
 #endif
 
+	/*
+	 * Poison invalid cpus, with lots of high bits set this should
+	 * always fault
+	 */
+	for (i = 0; i < NR_CPUS; i++) {
+		paca[i].data_offset = 0xeeeeeeeeeeeeeeeeULL;
+	}
+
 	for_each_cpu(i) {
 		ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
 		if (!ptr)

      reply	other threads:[~2006-02-11 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10 14:00 [PATCH] poison invalid cpus Olaf Hering
2006-02-11 11:55 ` Anton Blanchard [this message]

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=20060211115509.GA7922@krispykreme \
    --to=anton@samba$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=olh@suse$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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