From: Mark Fortescue <mark@mtfhpc.demon.co.uk>
To: David Miller <davem@davemloft.net>
Cc: aaw@google.com, akpm@linux-foundation.org,
linux-arch@vger.kernel.org, sparclinux@vger.kernel.org,
wli@holomorphy.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] Re: [SPARC32] NULL pointer derefference
Date: Tue, 31 Jul 2007 08:55:20 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0707310831080.4116@mtfhpc.demon.co.uk> (raw)
In-Reply-To: <20070730.234252.74747206.davem@davemloft.net>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 891 bytes --]
Hi David,
I have formulated a patch that prevents the update_mmu_cache from doing
enything if there is no context available. This apears to have no
immediate, undesirable side effects.
This worked better than the alternative of setting up a context to work with.
Can you for see any issues in doing this?
If not, can you check+apply the attached (un-mangled) patch.
diff -ruNpd linux-2.6/arch/sparc/mm/sun4c.c linux-test/arch/sparc/mm/sun4c.c
--- linux-2.6/arch/sparc/mm/sun4c.c 2007-07-30 03:19:15.000000000 +0100
+++ linux-test/arch/sparc/mm/sun4c.c 2007-07-31 08:28:13.000000000 +0100
@@ -1999,6 +2029,9 @@ void sun4c_update_mmu_cache(struct vm_ar
unsigned long flags;
int pseg;
+ if (vma->vm_mm->context == NO_CONTEXT)
+ return;
+
local_irq_save(flags);
address &= PAGE_MASK;
if ((pseg = sun4c_get_segmap(address)) == invalid_segment) {
Regards
Mark Fortescue.
[-- Attachment #2: Type: TEXT/PLAIN, Size: 1184 bytes --]
From: Mark Fortescue <mark@mtfhpc.demon.co.uk>
This deals with a sun4c issue caused by commit b6a2fea39318e43fee84fa7b0b90d68bed92d2ba:
mm: variable length argument support.
The new way the code works means that sun4c_update_mmu_cache gets called before a context
has been selected, which results in invalid operation of the underling mm code.
Simply ignoring update requests when there is no valid context solves the problem.
Signed-off-by Mark Fortescue <mark@mtfhpc.demon.co.uk>
---
This worked better than the alternative of setting up a context to work with.
I definatly need to spend some time writting up the sun4c MMU and how Linux code uses it.
diff -ruNpd -x '.[a-z]*' linux-2.6/arch/sparc/mm/sun4c.c linux-test/arch/sparc/mm/sun4c.c
--- linux-2.6/arch/sparc/mm/sun4c.c 2007-07-30 03:19:15.000000000 +0100
+++ linux-test/arch/sparc/mm/sun4c.c 2007-07-31 08:28:13.000000000 +0100
@@ -1999,6 +2029,9 @@ void sun4c_update_mmu_cache(struct vm_ar
unsigned long flags;
int pseg;
+ if (vma->vm_mm->context == NO_CONTEXT)
+ return;
+
local_irq_save(flags);
address &= PAGE_MASK;
if ((pseg = sun4c_get_segmap(address)) == invalid_segment) {
next prev parent reply other threads:[~2007-07-31 7:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-30 2:18 Mark Fortescue
2007-07-30 4:19 ` David Miller, Mark Fortescue
2007-07-30 10:39 ` Mark Fortescue
2007-07-31 5:35 ` Mark Fortescue
2007-07-31 6:42 ` David Miller, Mark Fortescue
2007-07-31 7:55 ` Mark Fortescue [this message]
2007-07-31 9:02 ` [PATCH] " David Miller, Mark Fortescue
2007-07-31 5:10 ` Ollie Wild
2007-07-31 6:54 ` Mark Fortescue
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=Pine.LNX.4.61.0707310831080.4116@mtfhpc.demon.co.uk \
--to=mark@mtfhpc.demon.co.uk \
--cc=aaw@google.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sparclinux@vger.kernel.org \
--cc=wli@holomorphy.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