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, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #ifndef __VMM_SYM_IFACE_H__
22 #define __VMM_SYM_IFACE_H__
26 #include <palacios/vm_guest.h>
30 struct v3_sym_interface {
35 uint32_t feature_flags;
37 uint_t pci_map_valid : 1;
38 uint32_t sym_call_enabled : 1;
39 } __attribute__((packed));
40 } __attribute__((packed));
45 uint32_t sym_call_active : 1;
46 } __attribute__((packed));
47 } __attribute__((packed));
49 uint64_t current_proc;
52 uint8_t pci_pt_map[(4 * 256) / 8]; // we're hardcoding this: (4 busses, 256 max devs)
55 uint64_t sym_call_rip;
57 uint64_t sym_call_rsp;
59 uint64_t sym_call_ret_fn;
61 } __attribute__((packed));
66 struct v3_sym_context {
67 struct v3_gprs vm_regs;
80 struct v3_sym_interface * sym_page;
83 uint64_t guest_pg_addr;
87 uint_t call_pending : 1;
88 uint_t call_active : 1;
89 } __attribute__((packed));
91 struct v3_sym_context old_ctx;
93 int (*notifier)(struct guest_info * info, void * private_data);
99 int v3_init_sym_iface(struct guest_info * info);
103 #define v3_sym_call0(info, call_num, cb, priv) \
104 v3_sym_call(info, call_num, 0, 0, 0, 0, 0, cb, priv)
105 #define v3_sym_call1(info, call_num, arg1, cb, priv) \
106 v3_sym_call(info, call_num, arg1, 0, 0, 0, 0, cb, priv)
107 #define v3_sym_call2(info, call_num, arg1, arg2, cb, priv) \
108 v3_sym_call(info, call_num, arg1, arg2, 0, 0, 0, cb, priv)
109 #define v3_sym_call3(info, call_num, arg1, arg2, arg3, cb, priv) \
110 v3_sym_call(info, call_num, arg1, arg2, arg3, 0, 0, cb, priv)
111 #define v3_sym_call4(info, call_num, arg1, arg2, arg3, arg4, cb, priv) \
112 v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, 0, cb, priv)
113 #define v3_sym_call5(info, call_num, arg1, arg2, arg3, arg4, arg5, cb, priv) \
114 v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, arg5, cb, priv)
119 int v3_sym_map_pci_passthrough(struct guest_info * info, uint_t bus, uint_t dev, uint_t fn);
120 int v3_sym_unmap_pci_passthrough(struct guest_info * info, uint_t bus, uint_t dev, uint_t fn);
123 int v3_sym_call(struct guest_info * info,
124 uint64_t arg0, uint64_t arg1,
125 uint64_t arg2, uint64_t arg3,
126 uint64_t arg4, uint64_t arg5,
127 int (*notifier)(struct guest_info * info, void * private_data),
128 void * private_data);
130 int v3_activate_sym_call(struct guest_info * info);