mmap: avoid unnecessary anon_vma lock acquisition in vma_adjust()
[linux-2.6/mini2440.git] / arch / ia64 / kvm / vmm.c
blob9eee5c04baccceaaf646d72922d3403cf313e2d5
1 /*
2 * vmm.c: vmm module interface with kvm module
4 * Copyright (c) 2007, Intel Corporation.
6 * Xiantao Zhang (xiantao.zhang@intel.com)
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 * Place - Suite 330, Boston, MA 02111-1307 USA.
23 #include<linux/kernel.h>
24 #include<linux/module.h>
25 #include<asm/fpswa.h>
27 #include "vcpu.h"
29 MODULE_AUTHOR("Intel");
30 MODULE_LICENSE("GPL");
32 extern char kvm_ia64_ivt;
33 extern fpswa_interface_t *vmm_fpswa_interface;
35 long vmm_sanity = 1;
37 struct kvm_vmm_info vmm_info = {
38 .module = THIS_MODULE,
39 .vmm_entry = vmm_entry,
40 .tramp_entry = vmm_trampoline,
41 .vmm_ivt = (unsigned long)&kvm_ia64_ivt,
44 static int __init kvm_vmm_init(void)
47 vmm_fpswa_interface = fpswa_interface;
49 /*Register vmm data to kvm side*/
50 return kvm_init(&vmm_info, 1024, THIS_MODULE);
53 static void __exit kvm_vmm_exit(void)
55 kvm_exit();
56 return ;
59 void vmm_spin_lock(spinlock_t *lock)
61 _vmm_raw_spin_lock(lock);
64 void vmm_spin_unlock(spinlock_t *lock)
66 _vmm_raw_spin_unlock(lock);
69 static void vcpu_debug_exit(struct kvm_vcpu *vcpu)
71 struct exit_ctl_data *p = &vcpu->arch.exit_data;
72 long psr;
74 local_irq_save(psr);
75 p->exit_reason = EXIT_REASON_DEBUG;
76 vmm_transition(vcpu);
77 local_irq_restore(psr);
80 asmlinkage int printk(const char *fmt, ...)
82 struct kvm_vcpu *vcpu = current_vcpu;
83 va_list args;
84 int r;
86 memset(vcpu->arch.log_buf, 0, VMM_LOG_LEN);
87 va_start(args, fmt);
88 r = vsnprintf(vcpu->arch.log_buf, VMM_LOG_LEN, fmt, args);
89 va_end(args);
90 vcpu_debug_exit(vcpu);
91 return r;
94 module_init(kvm_vmm_init)
95 module_exit(kvm_vmm_exit)