
From: Jeff Dike <jdike@addtoit.com>



Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/um/Kconfig      |   10 +++++++++-
 25-akpm/arch/um/kernel/mem.c |    4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff -puN arch/um/Kconfig~uml-config_highmem-atomicity-fix arch/um/Kconfig
--- 25/arch/um/Kconfig~uml-config_highmem-atomicity-fix	2004-11-17 00:44:12.778321432 -0800
+++ 25-akpm/arch/um/Kconfig	2004-11-17 00:44:12.783320672 -0800
@@ -209,7 +209,15 @@ config KERNEL_HALF_GIGS
 
 config HIGHMEM
 	bool "Highmem support"
-	depends on BROKEN
+	default n
+	help
+	This enables UML's highmem support.  This allows UML to have
+	more physical memory than it can map into its virtual address
+	space.  In tt mode, or with CONFIG_MODE_TT enabled, the limit is a
+	bit less than 512M.  With CONFIG_MODE_TT disabled and
+	CONFIG_LOAD_LOW and CONFIG_STATIC_LINK enabled, the limit is
+	around 2.75G.
+	Enabling this option slows down UML, signficantly in skas mode.
 
 config KERNEL_STACK_ORDER
 	int "Kernel stack size order"
diff -puN arch/um/kernel/mem.c~uml-config_highmem-atomicity-fix arch/um/kernel/mem.c
--- 25/arch/um/kernel/mem.c~uml-config_highmem-atomicity-fix	2004-11-17 00:44:12.779321280 -0800
+++ 25-akpm/arch/um/kernel/mem.c	2004-11-17 00:44:12.783320672 -0800
@@ -68,7 +68,7 @@ void mem_init(void)
 
 	max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
-	highmem_start_page = phys_page(__pa(high_physmem));
+	highmem_start_page = pfn_to_page(phys_to_pfn(__pa(high_physmem)));
 #endif
 
         /* clear the zero-page */
@@ -140,7 +140,7 @@ pte_t *kmap_pte;
 pgprot_t kmap_prot;
 
 #define kmap_get_fixmap_pte(vaddr)					\
-	pte_offset_kernel(pmd_offset(pml4_pgd_offset(pml4_offset_k(vaddr),
+	pte_offset_kernel(pmd_offset(pml4_pgd_offset(pml4_offset_k(vaddr), \
 						     vaddr), (vaddr)), (vaddr))
 
 void __init kmap_init(void)
_
