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 uint8_t sec_symmod_enabled : 1;
38 } __attribute__((packed));
39 } __attribute__((packed));
41 uint8_t pci_pt_map[(4 * 256) / 8]; // we're hardcoding this: (4 busses, 256 max devs)
43 } __attribute__((packed));
45 struct v3_symspy_local_page {
49 uint32_t symcall_flags;
51 uint32_t sym_call_active : 1;
52 uint32_t sym_call_enabled : 1;
53 } __attribute__((packed));
54 } __attribute__((packed));
55 } __attribute__((packed));
59 struct v3_symspy_global_state {
60 struct v3_symspy_global_page * sym_page;
62 addr_t global_page_pa;
63 uint64_t global_guest_pa;
65 int active; // activated when symbiotic page MSR is written
69 struct v3_symspy_local_state {
70 struct v3_symspy_local_page * local_page;
73 uint64_t local_guest_pa;
75 int active; // activated when symbiotic page MSR is written
81 int v3_init_symspy_vm(struct v3_vm_info * vm, struct v3_symspy_global_state * state);
82 int v3_init_symspy_core(struct guest_info * core, struct v3_symspy_local_state * state);
86 int v3_sym_map_pci_passthrough(struct v3_vm_info * vm, uint_t bus, uint_t dev, uint_t fn);
87 int v3_sym_unmap_pci_passthrough(struct v3_vm_info * vm, uint_t bus, uint_t dev, uint_t fn);
92 struct v3_symspy_global_page * v3_sym_get_symspy_vm(struct v3_vm_info * vm);
93 struct v3_symspy_local_page * v3_sym_get_symspy_core(struct guest_info * core);