Kprof uses an IRQ alarm
[akaros.git] / kern / drivers / dev / vm.c
index 4c2c612..3067594 100644 (file)
@@ -61,6 +61,15 @@ static int vmok = 0;
 static spinlock_t vmidlock[1];
 static struct kref vmid[1] = { {(void *)1, fake_release} };
 
+/* not clear what .h to put these in. Put them here. */
+
+struct litevm *vmx_open(void);
+int vmx_create_vcpu(struct litevm *litevm, int n);
+int vmx_init(void);
+int vm_set_memory_region(struct litevm *litevm,
+                                                struct litevm_memory_region *mem);
+int vm_run(struct litevm *litevm, struct litevm_run *litevm_run);
+
 static inline struct vm *
 QID2VM(struct qid q)
 {
@@ -445,7 +454,9 @@ static long vmwrite(struct chan *c, void *ubuf, long n, int64_t unused)
                                vmr.vcpu = strtoul(cb->f[1], NULL, 0);
                                vmr.emulated = strtoul(cb->f[2], NULL, 0);
                                vmr.mmio_completed = strtoul(cb->f[3], NULL, 0);
+                               disable_irq();
                                ret = vm_run(litevm, &vmr);
+                               enable_irq();
                                printk("vm_run returns %d\n", ret);
                                //print_func_exit();
                                return ret;