2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Peter Dinda <pdinda@northwestern.edu>
11 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
12 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
13 * All rights reserved.
15 * Author: Peter Dinda <pdinda@northwestern.edu>
17 * This is free software. You are permitted to use,
18 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 #include <palacios/svm_halt.h>
27 #include <palacios/vmm_intr.h>
32 #define PrintDebug(fmt, args...)
38 // This should trigger a #GP if cpl!=0, otherwise, yield to host
41 int v3_handle_svm_halt(struct guest_info * info)
44 v3_raise_exception(info, GPF_EXCEPTION);
47 // What we should do is starting waiting on an OS event that will
48 // result in an injection of an interrupt.
50 // What we will hackishly do instead is resume on any event
51 // Plus is this totally GeekOS specific
53 ullong_t yield_start = 0;
54 ullong_t yield_stop = 0;
57 PrintDebug("GeekOS Yield\n");
64 //v3_update_time(info, yield_stop - yield_start);
65 gap = yield_stop - yield_start;
66 v3_raise_irq(info, 0);
68 PrintDebug("GeekOS Yield Done (%d cycles)\n", gap);