From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: swapping with MMU Notifiers V2 Date: Thu, 31 Jan 2008 19:56:29 +0100 Message-ID: <20080131185629.GP7185@v2.random> References: <20080129145021.GJ7233@v2.random> <20080130185735.GS7233@v2.random> <47A16F99.8060502@qumranet.com> <20080131101519.GG7185@v2.random> <47A1A43D.6020203@qumranet.com> <20080131125842.GL7185@v2.random> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <20080131125842.GL7185-lysg2Xt5kKMAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Thu, Jan 31, 2008 at 01:58:42PM +0100, Andrea Arcangeli wrote: > It might also be something stale in the buildsystem (perhaps a distcc > of ccache glitch?), I also cleared 1G of ccache just to be sure in My build problem might have been related to the fact the kvm-userland/kernel/include directory isn't used by the kernel build system while building the external module. I did the kvm modifications to the kvm.git, synching from kvm.git to kvm-userland.git and then building the external module against a third tree that happen to have the kvm_* headers too but slightly different. I thought the kvm-userland/kernel/include directory was used but apparently it isn't anymore because the way it gets priority is a bit fragile. This seems to fix things but it's certainly not more robust, it just happens to build and run fine so far. I hope there's a better way to make it work ;) Signed-off-by: Andrea Arcangeli diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h index 052d561..96f61d8 100644 --- a/kernel/external-module-compat.h +++ b/kernel/external-module-compat.h @@ -10,8 +10,62 @@ #include #include #include -#include "include/linux/kvm.h" + +#ifndef CONFIG_PREEMPT_NOTIFIERS +#include +#define CONFIG_PREEMPT_NOTIFIERS +#define CONFIG_PREEMPT_NOTIFIERS_COMPAT + +struct preempt_notifier; + +struct preempt_ops { + void (*sched_in)(struct preempt_notifier *notifier, int cpu); + void (*sched_out)(struct preempt_notifier *notifier, + struct task_struct *next); +}; + +struct preempt_notifier { + struct list_head link; + struct task_struct *tsk; + struct preempt_ops *ops; +}; + +void preempt_notifier_register(struct preempt_notifier *notifier); +void preempt_notifier_unregister(struct preempt_notifier *notifier); + +static inline void preempt_notifier_init(struct preempt_notifier *notifier, + struct preempt_ops *ops) +{ + notifier->ops = ops; +} + +void start_special_insn(void); +void end_special_insn(void); +void in_special_section(void); +void special_reload_dr7(void); + +void preempt_notifier_sys_init(void); +void preempt_notifier_sys_exit(void); + +#else + +static inline void start_special_insn(void) {} +static inline void end_special_insn(void) {} +static inline void in_special_section(void) {} +static inline void special_reload_dr7(void) {} + +static inline void preempt_notifier_sys_init(void) {} +static inline void preempt_notifier_sys_exit(void) {} + +#endif + +#include "include/asm/kvm_para.h" +#include "include/asm/kvm.h" +#include "include/linux/kvm_types.h" #include "include/linux/kvm_para.h" +#include "include/linux/kvm.h" +#include "include/asm/kvm_host.h" +#include "include/linux/kvm_host.h" #include #include #include @@ -347,53 +401,6 @@ static inline unsigned long long __kvm_cmpxchg64(volatile void *ptr, #endif -#ifndef CONFIG_PREEMPT_NOTIFIERS -#define CONFIG_PREEMPT_NOTIFIERS -#define CONFIG_PREEMPT_NOTIFIERS_COMPAT - -struct preempt_notifier; - -struct preempt_ops { - void (*sched_in)(struct preempt_notifier *notifier, int cpu); - void (*sched_out)(struct preempt_notifier *notifier, - struct task_struct *next); -}; - -struct preempt_notifier { - struct list_head link; - struct task_struct *tsk; - struct preempt_ops *ops; -}; - -void preempt_notifier_register(struct preempt_notifier *notifier); -void preempt_notifier_unregister(struct preempt_notifier *notifier); - -static inline void preempt_notifier_init(struct preempt_notifier *notifier, - struct preempt_ops *ops) -{ - notifier->ops = ops; -} - -void start_special_insn(void); -void end_special_insn(void); -void in_special_section(void); -void special_reload_dr7(void); - -void preempt_notifier_sys_init(void); -void preempt_notifier_sys_exit(void); - -#else - -static inline void start_special_insn(void) {} -static inline void end_special_insn(void) {} -static inline void in_special_section(void) {} -static inline void special_reload_dr7(void) {} - -static inline void preempt_notifier_sys_init(void) {} -static inline void preempt_notifier_sys_exit(void) {} - -#endif - /* HRTIMER_MODE_ABS started life with a different name */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) #define HRTIMER_MODE_ABS HRTIMER_ABS ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/