rpms/kernel-xen-2.6/devel linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch, NONE, 1.1 linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch, NONE, 1.1 kernel.spec, 1.30, 1.31

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Mon Apr 7 15:38:46 UTC 2008


Author: ehabkost

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12193

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch 
	linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch 
Log Message:
Add x86_64 pagetable-pinning fixes (bug #440587)


linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch:

--- NEW FILE linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch ---
>From 5ec625248738bb98aa6b89d2e159e03d5fc691f7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 25 Mar 2008 14:36:33 -0300
Subject: [PATCH] pvops-64: Use paravirt_alloc_pd() instead of paravirt_alloc_pt() on some places (MERGEME)

This is needed because we need to differentiate allocation of PTEs vs
PMDs, PUDs and PGDs, for Xen.

This will be really better when we really differentiate all levels,
instead of only PTEs.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgalloc_64.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 771ef03..d774875 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -23,11 +23,11 @@ static pgd_t *__user_pgd(pgd_t *pgd)
 		set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))); \
 		} while (0)
 #define pud_populate(mm, pud, pmd) do { \
-		paravirt_alloc_pt(mm, __pa(pmd) >> PAGE_SHIFT); \
+		paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT); \
 		set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd))); \
 		} while (0)
 #define pgd_populate(mm, pgd, pud) do {\
-		paravirt_alloc_pt(mm, __pa(pud) >> PAGE_SHIFT); \
+		paravirt_alloc_pd(mm, __pa(pud) >> PAGE_SHIFT); \
 		set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))); \
 		set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(pud))); \
 		} while (0)
@@ -49,14 +49,14 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
 	pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
-	paravirt_alloc_pt(mm, __pa(pmd) >> PAGE_SHIFT);
+	paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT);
 	return pmd;
 }
 
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	pud_t *pud = (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
-	paravirt_alloc_pt(mm, __pa(pud) >> PAGE_SHIFT);
+	paravirt_alloc_pd(mm, __pa(pud) >> PAGE_SHIFT);
 	return pud;
 }
 
-- 
1.5.3.4


linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch:

--- NEW FILE linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch ---
>From 890327715cf3b03629e72284ce354ef4d6a76b85 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 25 Mar 2008 14:38:34 -0300
Subject: [PATCH] Xen: pin immediately L1 pagetables  (MERGME)

We need to do this otherwise code writing to the read-only PTE pages
will abort because the hypervisor doesn't know it must emulate a PTE
write.

Should be merged with the coded that disabled the immediate pinning,
in the first place.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 6869972..b57f406 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -764,6 +764,13 @@ static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned l
 			 * being allocated.
 			 */
 			make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
+
+			/* PTE is the only level we are really sure is right,
+			 * by now. The other levels need to be correctly
+			 * indicated by the pvops interface
+			 */
+			if (level == MMUEXT_PIN_L1_TABLE)
+				pin_page(page, PT_PTE);
 		} else
 			/* make sure there are no stray mappings of
 			   this page */
-- 
1.5.3.4



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- kernel.spec	4 Apr 2008 17:23:58 -0000	1.30
+++ kernel.spec	7 Apr 2008 15:38:06 -0000	1.31
@@ -688,6 +688,8 @@
 Patch5017: linux-2.6-xen-0018-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
 Patch5018: linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
 Patch5019: linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
+Patch5020: linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch
+Patch5021: linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch
 # kernel-xen patches end
 
 # Xen hypervisor patches (20000+)
@@ -1246,6 +1248,8 @@
 ApplyPatch linux-2.6-xen-0019-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
 %ifarch x86_64
 ApplyPatch linux-2.6-xen-0020-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
+ApplyPatch linux-2.6-xen-0021-pvops-64-Use-paravirt_alloc_pd-instead-of-paravir.patch
+ApplyPatch linux-2.6-xen-0022-Xen-pin-immediately-L1-pagetables-MERGME.patch
 %endif
 # kernel-xen apply end
 
@@ -1855,6 +1859,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Mon Apr 07 2008 Eduardo Habkost <ehabkost at redhat.com>
+- Add x86_64 pagetable-pinning fixes (bug #440587)
+
 * Fri Apr  4 2008 Mark McLoughlin <markmc at redhat.com>
 - Add patch from armbru to intelligently choose the preferred
   console (#434761)




More information about the fedora-extras-commits mailing list