Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311837 Details for
Bug 455434
x86: fix PAE pmd_bad bootup warning
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Upstream fix for this issue
1319 (text/plain), 7.50 KB, created by
Prarit Bhargava
on 2008-07-15 14:18:08 UTC
(
hide
)
Description:
Upstream fix for this issue
Filename:
MIME Type:
Creator:
Prarit Bhargava
Created:
2008-07-15 14:18:08 UTC
Size:
7.50 KB
patch
obsolete
>Return-path: <git-commits-head-owner@vger.kernel.org> >Envelope-to: arjan@infradead.org >Delivery-date: Tue, 06 May 2008 22:00:43 +0000 >Received: from vger.kernel.org ([209.132.176.167]) > by pentafluge.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) > id 1JtVDH-0004Gy-AY > for arjan@infradead.org; Tue, 06 May 2008 22:00:43 +0000 >Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand > id S1757222AbYEFWA1 (ORCPT <rfc822;arjan@infradead.org>); > Tue, 6 May 2008 18:00:27 -0400 >Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932112AbYEFWA0 > (ORCPT <rfc822;git-commits-head-outgoing>); > Tue, 6 May 2008 18:00:26 -0400 >Received: from hera.kernel.org ([140.211.167.34]:52176 "EHLO hera.kernel.org" > rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP > id S1765802AbYEFWAV (ORCPT > <rfc822;git-commits-head@vger.kernel.org>); > Tue, 6 May 2008 18:00:21 -0400 >Received: from hera.kernel.org (IDENT:U2FsdGVkX1+WH4EmmkIZPlTTz7DLCA5ZtnciZ6l4xBU@localhost [127.0.0.1]) > by hera.kernel.org (8.13.8/8.13.8) with ESMTP id m46M090o017415 > (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) > for <git-commits-head@vger.kernel.org>; Tue, 6 May 2008 22:00:09 GMT >Received: (from dwmw2@localhost) > by hera.kernel.org (8.13.8/8.13.1/Submit) id m46M01DA017182 > for git-commits-head@vger.kernel.org; Tue, 6 May 2008 22:00:01 GMT >Date: Tue, 6 May 2008 22:00:01 GMT >Message-Id: <200805062200.m46M01DA017182@hera.kernel.org> >From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org> >To: git-commits-head@vger.kernel.org >Subject: x86: fix PAE pmd_bad bootup warning >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >X-Git-Commit: aeed5fce37196e09b4dac3a1c00d8b7122e040ce >X-Git-Parent: bb78be8397d3b0900af3d717672218ee3ea07985 >X-Spam-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00, > UNPARSEABLE_RELAY autolearn=ham version=3.2.3 >X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on hera.kernel.org >Sender: git-commits-head-owner@vger.kernel.org >Precedence: bulk >List-ID: <git-commits-head.vger.kernel.org> >X-Mailing-List: git-commits-head@vger.kernel.org > >Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aeed5fce37196e09b4dac3a1c00d8b7122e040ce >Commit: aeed5fce37196e09b4dac3a1c00d8b7122e040ce >Parent: bb78be8397d3b0900af3d717672218ee3ea07985 >Author: Hugh Dickins <hugh@veritas.com> >AuthorDate: Tue May 6 20:49:23 2008 +0100 >Committer: Linus Torvalds <torvalds@linux-foundation.org> >CommitDate: Tue May 6 13:08:58 2008 -0700 > > x86: fix PAE pmd_bad bootup warning > > Fix warning from pmd_bad() at bootup on a HIGHMEM64G HIGHPTE x86_32. > > That came from 9fc34113f6880b215cbea4e7017fc818700384c2 x86: debug pmd_bad(); > but we understand now that the typecasting was wrong for PAE in the previous > version: pagetable pages above 4GB looked bad and stopped Arjan from booting. > > And revert that cded932b75ab0a5f9181ee3da34a0a488d1a14fd x86: fix pmd_bad > and pud_bad to support huge pages. It was the wrong way round: we shouldn't > weaken every pmd_bad and pud_bad check to let huge pages slip through - in > part they check that we _don't_ have a huge page where it's not expected. > > Put the x86 pmd_bad() and pud_bad() definitions back to what they have long > been: they can be improved (x86_32 should use PTE_MASK, to stop PAE thinking > junk in the upper word is good; and x86_64 should follow x86_32's stricter > comparison, to stop thinking any subset of required bits is good); but that > should be a later patch. > > Fix Hans' good observation that follow_page() will never find pmd_huge() > because that would have already failed the pmd_bad test: test pmd_huge in > between the pmd_none and pmd_bad tests. Tighten x86's pmd_huge() check? > No, once it's a hugepage entry, it can get quite far from a good pmd: for > example, PROT_NONE leaves it with only ACCESSED of the KERN_PGTABLE bits. > > However... though follow_page() contains this and another test for huge > pages, so it's nice to keep it working on them, where does it actually get > called on a huge page? get_user_pages() checks is_vm_hugetlb_page(vma) to > to call alternative hugetlb processing, as does unmap_vmas() and others. > > Signed-off-by: Hugh Dickins <hugh@veritas.com> > Earlier-version-tested-by: Ingo Molnar <mingo@elte.hu> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Jeff Chua <jeff.chua.linux@gmail.com> > Cc: Hans Rosenfeld <hans.rosenfeld@amd.com> > Cc: Arjan van de Ven <arjan@linux.intel.com> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> >--- > arch/x86/mm/pgtable_32.c | 7 ------- > include/asm-x86/pgtable_32.h | 9 +-------- > include/asm-x86/pgtable_64.h | 6 ++---- > mm/memory.c | 5 ++++- > 4 files changed, 7 insertions(+), 20 deletions(-) > >diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c >index 9ee007b..369cf06 100644 >--- a/arch/x86/mm/pgtable_32.c >+++ b/arch/x86/mm/pgtable_32.c >@@ -172,10 +172,3 @@ void reserve_top_address(unsigned long reserve) > __FIXADDR_TOP = -reserve - PAGE_SIZE; > __VMALLOC_RESERVE += reserve; > } >- >-int pmd_bad(pmd_t pmd) >-{ >- WARN_ON_ONCE(pmd_bad_v1(pmd) != pmd_bad_v2(pmd)); >- >- return pmd_bad_v1(pmd); >-} >diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h >index 577ab79..d7f0403 100644 >--- a/include/asm-x86/pgtable_32.h >+++ b/include/asm-x86/pgtable_32.h >@@ -88,14 +88,7 @@ extern unsigned long pg0[]; > /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ > #define pmd_none(x) (!(unsigned long)pmd_val((x))) > #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT) >- >-extern int pmd_bad(pmd_t pmd); >- >-#define pmd_bad_v1(x) \ >- (_KERNPG_TABLE != (pmd_val((x)) & ~(PAGE_MASK | _PAGE_USER))) >-#define pmd_bad_v2(x) \ >- (_KERNPG_TABLE != (pmd_val((x)) & ~(PAGE_MASK | _PAGE_USER | \ >- _PAGE_PSE | _PAGE_NX))) >+#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) > > #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) > >diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h >index a3bbf87..efe83dc 100644 >--- a/include/asm-x86/pgtable_64.h >+++ b/include/asm-x86/pgtable_64.h >@@ -158,14 +158,12 @@ static inline unsigned long pgd_bad(pgd_t pgd) > > static inline unsigned long pud_bad(pud_t pud) > { >- return pud_val(pud) & >- ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX); >+ return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER); > } > > static inline unsigned long pmd_bad(pmd_t pmd) > { >- return pmd_val(pmd) & >- ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX); >+ return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER); > } > > #define pte_none(x) (!pte_val((x))) >diff --git a/mm/memory.c b/mm/memory.c >index bbab1e3..48c122d 100644 >--- a/mm/memory.c >+++ b/mm/memory.c >@@ -969,7 +969,7 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, > goto no_page_table; > > pmd = pmd_offset(pud, address); >- if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) >+ if (pmd_none(*pmd)) > goto no_page_table; > > if (pmd_huge(*pmd)) { >@@ -978,6 +978,9 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, > goto out; > } > >+ if (unlikely(pmd_bad(*pmd))) >+ goto no_page_table; >+ > ptep = pte_offset_map_lock(mm, pmd, address, &ptl); > if (!ptep) > goto out; >-- >To unsubscribe from this list: send the line "unsubscribe git-commits-head" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 455434
: 311837 |
312348