From: Hugh Dickins <hugh@veritas.com>
To: "Richard B. Johnson" <linux-os@analogic.com>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: Linux-2.6.12 memory mapping broken
Date: Tue, 21 Jun 2005 20:57:03 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0506212041000.7385@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0506201548150.5317@chaos.analogic.com>
On Mon, 20 Jun 2005, Richard B. Johnson wrote:
>
> To the memory expert that made the massive changes to mm/memory.c:
>
> Code in linux-2.6.12 fails with the following (remap_pfn_range
> gets the exact same values):
>
> UNIQUE.dma.len = 04001fe0
> vma->vm_end-vma->vm_start=04002000
> About to execute remap_pfn_range
> vma->vm_start = 20000000
> base address = 30003000
> length = 04001fe0 >> PAGE_SHIFT
> vma->vm_page_prot = 0000003f
> ------------[ cut here ]------------
> kernel BUG at mm/memory.c:1112!
>
> I can test any patches.
You are right, and it's my fault. May I wriggle a little and point
out that your length is unusual, and even you seem confused whether
you want to map 0x4001 or 0x4002 pages? But the blame lies with me.
Please try this patch, which I'll send to Andrew and -stable if you
can confirm that it fixes your problem. remap_pfn_range is, I believe
(and shall recheck), the only exported interface vulnerable to this
loop-termination issue.
Thanks,
Hugh
--- 2.6.12/mm/memory.c 2005-06-17 20:48:29.000000000 +0100
+++ linux/mm/memory.c 2005-06-21 20:31:42.000000000 +0100
@@ -1164,7 +1164,7 @@ int remap_pfn_range(struct vm_area_struc
{
pgd_t *pgd;
unsigned long next;
- unsigned long end = addr + size;
+ unsigned long end = addr + PAGE_ALIGN(size);
struct mm_struct *mm = vma->vm_mm;
int err;
next prev parent reply other threads:[~2005-06-21 19:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-20 19:53 Richard B. Johnson
2005-06-20 20:43 ` David S. Miller
2005-06-20 21:03 ` Richard B. Johnson
2005-06-21 0:46 ` Dave Jones
2005-06-21 19:57 ` Hugh Dickins [this message]
2005-06-21 20:35 ` Richard B. Johnson
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.0506212041000.7385@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.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
all inboxes | Powered by JetHome®