All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH] vmalloc fix
Date: Wed, 21 Jan 2004 14:58:56 +1100	[thread overview]
Message-ID: <20040121035856.GA4372@krispykreme> (raw)


Hi,

Paul wrote a patch to use some of the rmap infrastructure to flush TLB
entries on ppc64. When testing it we found a problem in vmalloc where it
sets up the pte -> address mapping incorrectly. We clear the top bits of
the address but then forget to pass in the full address to
pte_alloc_kernel. The end result is the address in page->index is
truncated.

I fixed it in a similar way to how zeromap_pmd_range etc does it. Im
guessing no one uses the rmap hooks on vmalloc pages yet, so havent seen
this problem.

Anton

===== mm/vmalloc.c 1.29 vs edited =====
--- 1.29/mm/vmalloc.c	Wed Oct  8 12:53:44 2003
+++ edited/mm/vmalloc.c	Wed Jan 21 14:48:23 2004
@@ -114,15 +114,16 @@
 			       unsigned long size, pgprot_t prot,
 			       struct page ***pages)
 {
-	unsigned long end;
+	unsigned long base, end;
 
+	base = address & PGDIR_MASK;
 	address &= ~PGDIR_MASK;
 	end = address + size;
 	if (end > PGDIR_SIZE)
 		end = PGDIR_SIZE;
 
 	do {
-		pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
+		pte_t * pte = pte_alloc_kernel(&init_mm, pmd, base + address);
 		if (!pte)
 			return -ENOMEM;
 		if (map_area_pte(pte, address, end - address, prot, pages))

                 reply	other threads:[~2004-01-21  4:03 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=20040121035856.GA4372@krispykreme \
    --to=anton@samba.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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.