All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith M Wesolowski <wesolows@foobazco.org>
To: sparclinux@vger.kernel.org
Subject: [2.4 RFC] Do not allow pkmap and fixmaps to overlap
Date: Tue, 30 Dec 2003 10:37:05 +0000	[thread overview]
Message-ID: <20031230103705.GA1797@foobazco.org> (raw)

On SMP systems, the fixmap and pkmap regions can (will) overlap.
Although x86 has a check for this condition indicating the box will
crash if it exists, I found it trying to track down an unrelated
(non-SMP-specific) bug rather than by directly observing any ill
effects.  Therefore I need some people to test and tell me if this has
any effect (positive or negative).

If you want to understand what's going on here, I have a vaddr map at
http://foobazco.org/~wesolows/sparc-25-virtmap.

I have some more major surgery in mind for 2.6, which is also
affected, but this simple fixup seems more appropriate for 2.4.
Comments?

=== arch/sparc/mm/srmmu.c 1.17 vs edited ==--- 1.17/arch/sparc/mm/srmmu.c	Mon Jul 21 04:57:23 2003
+++ edited/arch/sparc/mm/srmmu.c	Tue Dec 30 02:20:28 2003
@@ -356,8 +356,13 @@
 	srmmu_nocache_end = SRMMU_NOCACHE_VADDR + srmmu_nocache_size;
 	fix_kmap_begin = srmmu_nocache_end;
 	fix_kmap_end = fix_kmap_begin + (KM_TYPE_NR * NR_CPUS - 1) * PAGE_SIZE;
-	pkmap_base = SRMMU_NOCACHE_VADDR + srmmu_nocache_size + 0x40000;
+	pkmap_base = SRMMU_NOCACHE_VADDR + srmmu_nocache_size + 0x400000;
 	pkmap_base_end = pkmap_base + LAST_PKMAP * PAGE_SIZE;
+
+	if (fix_kmap_end >= pkmap_base) {
+		prom_printf("fix_kmap and pkmap areas overlap!\n");
+		prom_halt();
+	}
 
 	/* printk("system memory available = %luk\nnocache ram size = %luk\n",
 		sysmemavail, srmmu_nocache_size / 1024); */


-- 
Keith M Wesolowski <wesolows@foobazco.org> http://foobazco.org/~wesolows
------(( Project Foobazco Coordinator and Network Administrator ))------
	"May Buddha bless all stubborn people!"
				-- Uliassutai Karakorum Blake

                 reply	other threads:[~2003-12-30 10:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20031230103705.GA1797@foobazco.org \
    --to=wesolows@foobazco.org \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.