X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_sym_iface.h;h=6c96dab942b3c99162b8b876ea88f838abcb08f9;hb=4290e5f20a4ea5e5f32cb8228ac4d7446dc1021b;hp=5fcb69ab696b93492305748714ecd60e6ed82c86;hpb=e63be432894673d56526c4f1c2cb4fa64daf01d9;p=palacios.git diff --git a/palacios/include/palacios/vmm_sym_iface.h b/palacios/include/palacios/vmm_sym_iface.h index 5fcb69a..6c96dab 100644 --- a/palacios/include/palacios/vmm_sym_iface.h +++ b/palacios/include/palacios/vmm_sym_iface.h @@ -23,7 +23,7 @@ #ifdef __V3VEE__ - +#include @@ -34,35 +34,104 @@ struct v3_sym_interface { union { uint32_t feature_flags; struct { - uint_t cur_proc_valid : 1; - uint_t proc_list_valid : 1; + uint_t pci_map_valid : 1; + uint32_t sym_call_enabled : 1; } __attribute__((packed)); } __attribute__((packed)); - addr_t current_proc; - addr_t proc_list; + union { + uint32_t state_flags; + struct { + uint32_t sym_call_active : 1; + } __attribute__((packed)); + } __attribute__((packed)); + + uint64_t current_proc; + uint64_t proc_list; + + uint8_t pci_pt_map[(4 * 256) / 8]; // we're hardcoding this: (4 busses, 256 max devs) + + + - uint8_t pci_pt_map[256 / 8]; } __attribute__((packed)); + + +struct v3_sym_context { + struct v3_gprs vm_regs; + struct v3_segment cs; + struct v3_segment ss; + uint64_t gs_base; + uint64_t fs_base; + uint64_t rip; + uint64_t flags; + uint8_t cpl; +}; + + + struct v3_sym_state { struct v3_sym_interface * sym_page; addr_t sym_page_pa; - uint_t active; uint64_t guest_pg_addr; + struct { + uint_t active : 1; // activated when symbiotic page MSR is written + uint_t sym_call_active : 1; + uint_t sym_call_returned : 1; + uint_t sym_call_error : 1; + } __attribute__((packed)); + + struct v3_sym_context old_ctx; + + int sym_call_errno; + + uint64_t sym_call_rip; + uint64_t sym_call_cs; + uint64_t sym_call_rsp; + uint64_t sym_call_gs; + uint64_t sym_call_fs; }; int v3_init_sym_iface(struct guest_info * info); +typedef uint64_t sym_arg_t; + +#define v3_sym_call0(info, call_num) \ + v3_sym_call(info, call_num, 0, 0, 0, 0, 0) +#define v3_sym_call1(info, call_num, arg1) \ + v3_sym_call(info, call_num, arg1, 0, 0, 0, 0) +#define v3_sym_call2(info, call_num, arg1, arg2) \ + v3_sym_call(info, call_num, arg1, arg2, 0, 0, 0) +#define v3_sym_call3(info, call_num, arg1, arg2, arg3) \ + v3_sym_call(info, call_num, arg1, arg2, arg3, 0, 0) +#define v3_sym_call4(info, call_num, arg1, arg2, arg3, arg4) \ + v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, 0) +#define v3_sym_call5(info, call_num, arg1, arg2, arg3, arg4, arg5) \ + v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, arg5) + + + + int v3_sym_map_pci_passthrough(struct guest_info * info, uint_t bus, uint_t dev, uint_t fn); int v3_sym_unmap_pci_passthrough(struct guest_info * info, uint_t bus, uint_t dev, uint_t fn); +/* Symcall numbers */ +#define SYMCALL_TEST 1 +#define SYMCALL_MEM_LOOKUP 10 +/* ** */ + +int v3_sym_call(struct guest_info * info, + uint64_t call_num, sym_arg_t * arg0, + sym_arg_t * arg1, sym_arg_t * arg2, + sym_arg_t * arg3, sym_arg_t * arg4); + #endif