public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Bugfix for PPC64 hugepage support
@ 2004-04-01  4:29 David Gibson
  0 siblings, 0 replies; only message in thread
From: David Gibson @ 2004-04-01  4:29 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linuxppc64-dev

Linus, please apply.

Due to a misunderstanding of pmd_offset() the PPC64 hugepage code could
end up looking at bogus pages as if they were PMD pages.

Index: working-2.6/arch/ppc64/mm/hugetlbpage.c
===================================================================
--- working-2.6.orig/arch/ppc64/mm/hugetlbpage.c	2004-03-09 10:50:44.000000000 +1100
+++ working-2.6/arch/ppc64/mm/hugetlbpage.c	2004-04-01 12:53:54.920618632 +1000
@@ -190,6 +190,9 @@
 	BUG_ON(!in_hugepage_area(mm->context, addr));
 
 	pgd = pgd_offset(mm, addr);
+	if (pgd_none(*pgd))
+		return NULL;
+
 	pmd = pmd_offset(pgd, addr);
 
 	/* We shouldn't find a (normal) PTE page pointer here */


-- 
David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-01  4:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-01  4:29 Bugfix for PPC64 hugepage support David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox