rpms/kernel-xen-2.6/devel linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch, NONE, 1.1 kernel.spec, 1.37, 1.38

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Tue Apr 15 22:44:28 UTC 2008


Author: ehabkost

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

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch 
Log Message:
Unpin and make pages read-write on pgd_free() (bug #441543)



linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch:

--- NEW FILE linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch ---
>From 9910a788bfc62ff4ef5222552f06471b0e70430f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 15 Apr 2008 18:55:46 -0300
Subject: [PATCH] Xen-64: Unpin and mark PGD as read-write on pgd_free()  (FIXME)

FIXME: This should be made using a paravirt_ops hook.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c           |    2 +-
 arch/x86/xen/mmu.h           |    2 ++
 include/asm-x86/pgalloc_64.h |   11 ++++++++++-
 include/xen/page.h           |    3 +++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 254cae6..11a4543 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -586,7 +586,7 @@ static int unpin_page(struct page *page, enum pt_level level)
 }
 
 /* Release a pagetables pages back as normal RW */
-static void xen_pgd_unpin(pgd_t *pgd)
+void xen_pgd_unpin(pgd_t *pgd)
 {
 	xen_mc_batch();
 
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index b25b8e4..28e5225 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -63,4 +63,6 @@ void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
 void xen_pmd_clear(pmd_t *pmdp);
 #endif
 
+void xen_pgd_unpin(pgd_t *pgd);
+
 #endif	/* _XEN_MMU_H */
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 98b45e6..a22f43a 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -8,6 +8,8 @@
 
 #ifdef CONFIG_XEN
 
+#include <xen/page.h>
+
 extern pud_t level3_user_pgt[512];
 
 /*FIXME: use pvops */
@@ -119,7 +121,14 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 	BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
 	pgd_list_del(pgd);
 
-	/*FIXME: unpin and mark as rw */
+#ifdef CONFIG_XEN
+	/* Unpin and make it read-write again, in the (likely) case
+	 * it was pinned
+	 */
+	xen_pgd_unpin(pgd);
+	make_lowmem_page_readwrite(pgd);
+#endif
+
 	free_pages((unsigned long)pgd, 1);
 }
 
diff --git a/include/xen/page.h b/include/xen/page.h
index 158fb60..1eb4721 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -179,4 +179,7 @@ xmaddr_t arbitrary_virt_to_machine(unsigned long address);
 void make_lowmem_page_readonly(void *vaddr);
 void make_lowmem_page_readwrite(void *vaddr);
 
+extern void xen_pgd_unpin(pgd_t *pgd);
+
+
 #endif /* __XEN_PAGE_H */
-- 
1.5.3.4



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- kernel.spec	15 Apr 2008 22:32:06 -0000	1.37
+++ kernel.spec	15 Apr 2008 22:43:53 -0000	1.38
@@ -826,6 +826,7 @@
 Patch5153: linux-2.6-xen-0154-Mark-init-pages-read-write-again-on-free_init_pages.patch
 Patch5154: linux-2.6-xen-0155-reserve_early-kernel-text-and-data-segments.patch
 Patch5155: linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
+Patch5156: linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch
 # kernel-xen patches end
 
 # Xen hypervisor patches (20000+)
@@ -1524,6 +1525,7 @@
 ApplyPatch linux-2.6-xen-0154-Mark-init-pages-read-write-again-on-free_init_pages.patch
 ApplyPatch linux-2.6-xen-0155-reserve_early-kernel-text-and-data-segments.patch
 ApplyPatch linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
+ApplyPatch linux-2.6-xen-0157-Xen-64-Unpin-and-mark-PGD-as-read-write-on-pgd_free.patch
 %endif
 # kernel-xen apply end
 
@@ -2136,6 +2138,7 @@
 * Tue Apr 15 2008 Eduardo Habkost <ehabkost at redhat.com>
 - Fix free_init_pages() to unmap pages from __START_KERNEL_map
   (bug #441543)
+- Unpin and make pages read-write on pgd_free() (bug #441543)
 
 * Mon Apr 14 2008 Mark McLoughlin <markmc at redhat.com>
 - Rebase to kernel-2.6.25-0.228.rc9.fc9




More information about the fedora-extras-commits mailing list