UML - Compilation problem on 2.6.22-rc4

From: Arun Raghavan
Date: Fri Jun 15 2007 - 02:56:57 EST


Hello,
I ran into some compilations problems with UML on the 2.6.22-rc4 kernel.
The problem turns up because "paravirt.h" is included in a couple of
headers in asm-i386 without being protected by a "#ifdef CONFIG_PARAVIRT".

I've attached a patch to fix this (i.e. UML compiles and runs fine for
me with these changes). I don't know if this is sufficient for all cases
though (most other uses of the #ifdef include a lengthy #else).

Please keep me in CC as I'm not on the mailing list.

-- Arun
diff -uprN -X /usr/src/linux-2.6.22-rc4/Documentation/dontdiff /usr/src/linux-2.6.22-rc4/include/asm-i386/highmem.h linux-2.6.22-rc4-uml-fix/include/asm-i386/highmem.h
--- /usr/src/linux-2.6.22-rc4/include/asm-i386/highmem.h 2007-06-14 12:12:58.000000000 +0530
+++ linux-2.6.22-rc4-uml-fix/include/asm-i386/highmem.h 2007-06-15 11:34:10.000000000 +0530
@@ -24,7 +24,9 @@
#include <linux/threads.h>
#include <asm/kmap_types.h>
#include <asm/tlbflush.h>
+#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
+#endif

/* declarations for highmem.c */
extern unsigned long highstart_pfn, highend_pfn;
diff -uprN -X /usr/src/linux-2.6.22-rc4/Documentation/dontdiff /usr/src/linux-2.6.22-rc4/include/asm-i386/mmu_context.h linux-2.6.22-rc4-uml-fix/include/asm-i386/mmu_context.h
--- /usr/src/linux-2.6.22-rc4/include/asm-i386/mmu_context.h 2007-06-14 12:12:58.000000000 +0530
+++ linux-2.6.22-rc4-uml-fix/include/asm-i386/mmu_context.h 2007-06-15 11:34:24.000000000 +0530
@@ -5,8 +5,9 @@
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
+#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
-#ifndef CONFIG_PARAVIRT
+#else
#include <asm-generic/mm_hooks.h>

static inline void paravirt_activate_mm(struct mm_struct *prev,