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".
20 #ifndef __VMM_SYMSPY_H__
21 #define __VMM_SYMSPY_H__
25 #include <palacios/vmm.h>
29 struct v3_symspy_global_page {
33 uint32_t feature_flags;
35 uint8_t pci_map_valid : 1;
36 uint8_t symmod_enabled : 1;
37 } __attribute__((packed));
38 } __attribute__((packed));
40 uint8_t pci_pt_map[(4 * 256) / 8]; // we're hardcoding this: (4 busses, 256 max devs)
42 } __attribute__((packed));
44 struct v3_symspy_local_page {
48 uint32_t symcall_flags;
50 uint32_t sym_call_active : 1;
51 uint32_t sym_call_enabled : 1;
52 } __attribute__((packed));
53 } __attribute__((packed));
54 } __attribute__((packed));
58 struct v3_symspy_global_state {
59 struct v3_symspy_global_page * sym_page;
61 addr_t global_page_pa;
62 uint64_t global_guest_pa;
64 int active; // activated when symbiotic page MSR is written
68 struct v3_symspy_local_state {
69 struct v3_symspy_local_page * local_page;
72 uint64_t local_guest_pa;
74 int active; // activated when symbiotic page MSR is written
80 int v3_init_symspy_vm(struct v3_vm_info * vm, struct v3_symspy_global_state * state);
81 int v3_init_symspy_core(struct guest_info * core, struct v3_symspy_local_state * state);
85 int v3_sym_map_pci_passthrough(struct v3_vm_info * vm, uint_t bus, uint_t dev, uint_t fn);
86 int v3_sym_unmap_pci_passthrough(struct v3_vm_info * vm, uint_t bus, uint_t dev, uint_t fn);
91 struct v3_symspy_global_page * v3_sym_get_symspy_vm(struct v3_vm_info * vm);
92 struct v3_symspy_local_page * v3_sym_get_symspy_core(struct guest_info * core);