rpms/kernel/devel linux-2.6-xen-compile-fixes.patch,1.3,1.4

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 23 23:51:10 UTC 2006


Author: quintela

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17220

Modified Files:
	linux-2.6-xen-compile-fixes.patch 
Log Message:
fix x86_64 xen build

linux-2.6-xen-compile-fixes.patch:
 arch/i386/kernel/acpi/boot-xen.c                             |    3 
 linux-2.6.15.ia64/fs/Kconfig                                 |    1 
 linux-2.6.15.xen/arch/i386/kernel/Makefile                   |    3 
 linux-2.6.15.xen/arch/i386/kernel/smp-xen.c                  |    1 
 linux-2.6.15.xen/arch/i386/mm/init-xen.c                     |    1 
 linux-2.6.15.xen/arch/x86_64/kernel/pmtimer.c                |    2 
 linux-2.6.15.xen/arch/x86_64/kernel/process-xen.c            |    6 -
 linux-2.6.15.xen/arch/x86_64/mm/fault-xen.c                  |    2 
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/desc.h        |   14 ++
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/mmu.h         |    7 +
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/pgalloc.h     |    1 
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/processor.h   |    7 +
 linux-2.6.15.xen/include/asm-i386/mach-xen/asm/swiotlb.h     |    1 
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgalloc.h   |    7 +
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/pgtable.h   |    2 
 linux-2.6.15.xen/include/asm-x86_64/mach-xen/asm/processor.h |    2 
 linux-2.6.16.noarch/arch/i386/mm/init-xen.c                  |    8 -
 linux-2.6.16.noarch/arch/i386/mm/pgtable-xen.c               |    4 
 linux-2.6.16.noarch/arch/x86_64/mm/init-xen.c                |    6 -
 linux-2.6.16.noarch/arch/x86_64/mm/pageattr-xen.c            |   63 ++++-------
 linux-2.6.16.noarch/drivers/xen/balloon/balloon.c            |    2 
 linux-2.6.16.noarch/drivers/xen/netback/netback.c            |    4 
 22 files changed, 86 insertions(+), 61 deletions(-)

Index: linux-2.6-xen-compile-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-xen-compile-fixes.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-xen-compile-fixes.patch	23 Mar 2006 21:21:22 -0000	1.3
+++ linux-2.6-xen-compile-fixes.patch	23 Mar 2006 23:51:08 -0000	1.4
@@ -354,3 +354,119 @@
  		SetPageForeign(page, netif_page_release);
  	}
  
+diff -uNp linux-2.6.16.noarch/arch/x86_64/mm/pageattr-xen.c.orig linux-2.6.16.noarch/arch/x86_64/mm/pageattr-xen.c
+--- linux-2.6.16.noarch/arch/x86_64/mm/pageattr-xen.c.orig	2006-03-23 22:18:23.000000000 +0100
++++ linux-2.6.16.noarch/arch/x86_64/mm/pageattr-xen.c	2006-03-24 00:15:24.000000000 +0100
+@@ -199,6 +199,13 @@ static struct page *split_large_page(uns
+ 	pte_t *pbase;
+ 	if (!base) 
+ 		return NULL;
++	/*
++	 * page_private is used to track the number of entries in
++	 * the page table page have non standard attributes.
++	 */
++	SetPagePrivate(base);
++	page_private(base) = 0;
++
+ 	address = __pa(address);
+ 	addr = address & LARGE_PAGE_MASK; 
+ 	pbase = (pte_t *)page_address(base);
+@@ -231,26 +238,12 @@ static inline void flush_map(unsigned lo
+ 	on_each_cpu(flush_kernel_map, (void *)address, 1, 1);
+ }
+ 
+-struct deferred_page { 
+-	struct deferred_page *next; 
+-	struct page *fpage;
+-	unsigned long address;
+-}; 
+-static struct deferred_page *df_list; /* protected by init_mm.mmap_sem */
++static struct page *deferred_pages; /* protected by init_mm.mmap_sem */
+ 
+-static inline void save_page(unsigned long address, struct page *fpage)
++static inline void save_page(struct page *fpage)
+ {
+-	struct deferred_page *df;
+-	df = kmalloc(sizeof(struct deferred_page), GFP_KERNEL); 
+-	if (!df) {
+-		flush_map(address);
+-		__free_page(fpage);
+-	} else { 
+-		df->next = df_list;
+-		df->fpage = fpage;
+-		df->address = address;
+-		df_list = df;
+-	} 			
++	fpage->lru.next = (struct list_head *)deferred_pages;
++	deferred_pages = fpage;
+ }
+ 
+ /* 
+@@ -292,8 +285,8 @@ __change_page_attr(unsigned long address
+ 			set_pte(kpte, pfn_pte(pfn, prot));
+ 		} else {
+  			/*
+- 			 * split_large_page will take the reference for this change_page_attr
+- 			 * on the split page.
++			 * split_large_page will take the reference for this
++			 * change_page_attr on the split page.
+  			 */
+ 
+ 			struct page *split;
+@@ -305,10 +298,11 @@ __change_page_attr(unsigned long address
+ 			set_pte(kpte,mk_pte(split, ref_prot2));
+ 			kpte_page = split;
+ 		}	
+-		get_page(kpte_page);
++		page_private(kpte_page)++;
+ 	} else if ((kpte_flags & _PAGE_PSE) == 0) { 
+ 		set_pte(kpte, pfn_pte(pfn, ref_prot));
+-		__put_page(kpte_page);
++		BUG_ON(page_private(kpte_page) == 0);
++		page_private(kpte_page)--;
+ 	} else
+ 		BUG();
+ 
+@@ -324,13 +318,9 @@ __change_page_attr(unsigned long address
+ #else
+ 	if (!PageReserved(kpte_page))
+ #endif
+-		switch (page_count(kpte_page)) {
+-		case 1:
+-			save_page(address, kpte_page); 		     
++		if (page_private(kpte_page) == 0) {
++			save_page(kpte_page);
+ 			revert_page(address, ref_prot);
+-			break;
+-		case 0:
+-			BUG(); /* memleak and failed 2M page regeneration */
+ 	 	}
+ 	return 0;
+ } 
+@@ -383,17 +373,18 @@ int change_page_attr(struct page *page, 
+ 
+ void global_flush_tlb(void)
+ { 
+-	struct deferred_page *df, *next_df;
++	struct page *dpage;
+ 
+ 	down_read(&init_mm.mmap_sem);
+-	df = xchg(&df_list, NULL);
++	dpage = xchg(&deferred_pages, NULL);
+ 	up_read(&init_mm.mmap_sem);
+-	flush_map((df && !df->next) ? df->address : 0);
+-	for (; df; df = next_df) { 
+-		next_df = df->next;
+-		if (df->fpage) 
+-			__free_page(df->fpage);
+-		kfree(df);
++
++	flush_map((dpage && !dpage->lru.next) ? (unsigned long)page_address(dpage) : 0);
++	while (dpage) {
++		struct page *tmp = dpage;
++		dpage = (struct page *)dpage->lru.next;
++		ClearPagePrivate(tmp);
++		__free_page(tmp);
+ 	} 
+ } 
+ 




More information about the fedora-cvs-commits mailing list