WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [Linux PATCH] Fix to hugepages to work around new PWT handli

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] [Linux PATCH] Fix to hugepages to work around new PWT handling
From: Dave McCracken <dcm@xxxxxxxx>
Date: Wed, 09 Jun 2010 09:02:52 -0500
Cc: Xen Developers List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 09 Jun 2010 07:03:45 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:date :message-id:subject; bh=bxxD1JWsuesohxWa/jfR51MdOjkkvfu7sd8CzsGAGlM=; b=IAw1KeidXi+zQtxEI2QlA/S/uGIyTbBdo6z0UufvmnAtRsgZ9qUsASpqDamBYgNCe4 RBfYJOyF3B57ovrzkwe2DC4lAuWCtzqjWFwi/Qlsz6TX4oP3XN2bN5h4+PvINyRZoKqk G8aNMS50HFfKxL/CiKI4NO5JuKPO3HBeE+UuE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:date:message-id:subject; b=IXqXkp6alKnVcq+Z3zWEFLiqTAgF/0qcUhQAIbI0Qzev0m57kpavj14OA/psp/kyRw nnLwOgGJoVhTHeKICjpVQy0rIwepd97RAsTpKRmRaBssktElJrAM8tlI9i9qhk7Bc2AM 2+dvncBhpiYIoleP2W3lyU5y3tCR9MBOsD9Vo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Recent changes to Linux include code to set new flags in the pte,
including _PAGE_PAT and _PAGE_PWT.  That change conflicts with hugepage
using the pte macros to set up its pmd entries.  This patch resolves
that problem.

An additional fix here is to make sure the _PAGE_PRESENT bit is set
before hugepages does a mk_pte(), since Xen depends on that bit to
trigger the pfn->mfn translation.

Signed-off-by: Dave McCracken <dave.mccracken@xxxxxxxxxx>

--------


--- stable-2.6.32.x//arch/x86/include/asm/hugetlb.h     2010-06-04 
12:19:31.000000000 -0500
+++ 2.6.32-hfix//arch/x86/include/asm/hugetlb.h 2010-06-08 12:23:53.000000000 
-0500
@@ -44,7 +44,7 @@ static inline pte_t huge_ptep_get(pte_t
 static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
                                   pte_t *ptep, pte_t pte)
 {
-       set_pmd((pmd_t *)ptep, __pmd(pte_val(pte)));
+       set_pmd((pmd_t *)ptep, native_make_pmd(native_pte_val(pte)));
 }
 
 static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
--- stable-2.6.32.x//mm/hugetlb.c       2010-06-04 12:19:36.000000000 -0500
+++ 2.6.32-hfix//mm/hugetlb.c   2010-06-07 07:11:34.000000000 -0500
@@ -1732,12 +1732,14 @@ static pte_t make_huge_pte(struct vm_are
                                int writable)
 {
        pte_t entry;
+       pgprot_t pgprot;
 
+       pgprot = __pgprot(pgprot_val(vma->vm_page_prot) | _PAGE_PRESENT);
        if (writable) {
                entry =
-                   pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
+                   pte_mkwrite(pte_mkdirty(mk_pte(page, pgprot)));
        } else {
-               entry = huge_pte_wrprotect(mk_pte(page, vma->vm_page_prot));
+               entry = huge_pte_wrprotect(mk_pte(page, pgprot));
        }
        entry = pte_mkyoung(entry);
        entry = pte_mkhuge(entry);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel