kvm: Add missing include and EXPORT_SYMBOL_GPL
Subsystems (3)
PATCH 1/1 kvm: Add missing include and EXPORT_SYMBOL_GPL
When CONFIG_KVM=m my build with 3.8-rc4-nohz3 breaks like this:
ERROR: "guest_enter" [arch/x86/kvm/kvm.ko] undefined!
ERROR: "guest_exit" [arch/x86/kvm/kvm.ko] undefined!
Fix this by removing the CONFIG_KVM ifdefs and adding missing EXPORT_SYMBOL_GPL for:
+ guest_enter() and guest_exit()
+ vtime_guest_enter() and vtime_guest_exit()
Also add missing includes:
+ Add <linux/export.h> to kernel/context_tracking.c
+ Add <linux/vtime.h> to include/linux/kvm_host.h
This issue was introduced with commit 8eebafe9be58 ("kvm: Prepare to add generic guest entry/exit callbacks").
With some help of funny X86 hackerz!
Tested on a Ubuntu/precise AMD64 with 'CONFIG_KVM=m'.
[ vUNKNOWN: Without the magic "i" hack. -dileks ]
--- include/linux/kvm_host.h | 1 + kernel/context_tracking.c | 7 +++---- kernel/sched/cputime.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
include/linux/kvm_host.h +1 -0
@@ -23,6 +23,7 @@#include <linux/ratelimit.h> #include <linux/err.h> #include <linux/irqflags.h> +#include <linux/vtime.h> #include <asm/signal.h> #include <linux/kvm.h>
kernel/context_tracking.c +3 -4
@@ -19,7 +19,7 @@#include <linux/rcupdate.h> #include <linux/sched.h> #include <linux/hardirq.h> - +#include <linux/export.h> DEFINE_PER_CPU(struct context_tracking, context_tracking) = {#ifdef CONFIG_CONTEXT_TRACKING_FORCE
@@ -103,7 +103,6 @@ void user_exit(void)local_irq_restore (flags); } -#ifdef CONFIG_KVM void guest_enter (void ) {if (vtime_accounting_enabled ())
@@ -111,6 +110,7 @@ void guest_enter(void)else __guest_enter (); } +EXPORT_SYMBOL_GPL (guest_enter);void guest_exit (void ) {
@@ -119,8 +119,7 @@ void guest_exit(void)else __guest_exit (); } -#endif - +EXPORT_SYMBOL_GPL (guest_exit);/** * context_tracking_task_switch - context switch the syscall callbacks
kernel/sched/cputime.c +2 -2
@@ -677,7 +677,6 @@ void vtime_user_enter(struct task_struct *tsk)write_sequnlock (&tsk->vtime_seqlock); } -#ifdef CONFIG_KVM void vtime_guest_enter (struct task_struct *tsk) {write_seqlock (&tsk->vtime_seqlock);
@@ -685,6 +684,7 @@ void vtime_guest_enter(struct task_struct *tsk) current->flags |=PF_VCPU ;write_sequnlock (&tsk->vtime_seqlock); } +EXPORT_SYMBOL_GPL (vtime_guest_enter);void vtime_guest_exit (struct task_struct *tsk) {
@@ -693,7 +693,7 @@ void vtime_guest_exit(struct task_struct *tsk) current->flags &= ~PF_VCPU ;write_sequnlock (&tsk->vtime_seqlock); } -#endif +EXPORT_SYMBOL_GPL (vtime_guest_exit);void vtime_account_idle (struct task_struct *tsk) {
Signature · 1 line
1.8.1.1