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] [patch 09/21] Xen-paravirt: Allow paravirt backend to select

To: Andi Kleen <ak@xxxxxx>
Subject: [Xen-devel] [patch 09/21] Xen-paravirt: Allow paravirt backend to select PGD allocation alignment
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 15 Feb 2007 18:24:58 -0800
Cc: Zachary Amsden <zach@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 15 Feb 2007 18:29:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070216022449.739760547@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Xen requires pgds to be page-aligned, so make this a parameter which
can be set in the paravirt_ops structure.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>

--
 arch/i386/kernel/paravirt.c |    1 +
 arch/i386/mm/init.c         |    2 +-
 include/asm-i386/paravirt.h |    5 ++++-
 include/asm-i386/pgtable.h  |    6 ++++++
 4 files changed, 12 insertions(+), 2 deletions(-)

===================================================================
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -573,6 +573,7 @@ struct paravirt_ops paravirt_ops = {
        .paravirt_enabled = 0,
        .kernel_rpl = 0,
        .shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
+       .pgd_alignment = sizeof(pgd_t) * PTRS_PER_PGD,
 
        .patch = native_patch,
        .banner = default_banner,
===================================================================
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -745,7 +745,7 @@ void __init pgtable_cache_init(void)
        }
        pgd_cache = kmem_cache_create("pgd",
                                      PTRS_PER_PGD*sizeof(pgd_t),
-                                     PTRS_PER_PGD*sizeof(pgd_t),
+                                     PGD_ALIGNMENT,
                                      0, NULL, NULL);
        if (!pgd_cache)
                panic("pgtable_cache_init(): Cannot create pgd cache");
===================================================================
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -33,9 +33,12 @@ struct mm_struct;
 struct mm_struct;
 struct paravirt_ops
 {
+       int paravirt_enabled;
        unsigned int kernel_rpl;
+
        int shared_kernel_pmd;
-       int paravirt_enabled;
+       int pgd_alignment;
+
        const char *name;
 
        /*
===================================================================
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -270,6 +270,12 @@ static inline void vmalloc_sync_all(void
 #define pte_update_defer(mm, addr, ptep)       do { } while (0)
 #endif
 
+#ifdef CONFIG_PARAVIRT
+#define PGD_ALIGNMENT  (paravirt_ops.pgd_alignment)
+#else
+#define PGD_ALIGNMENT  (sizeof(pgd_t) * PTRS_PER_PGD)
+#endif
+
 /*
  * We only update the dirty/accessed state if we set
  * the dirty bit by hand in the kernel, since the hardware

-- 


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

<Prev in Thread] Current Thread [Next in Thread>