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: Maciek Swiech <dotpyfe@u.northwestern.edu>
15 * Marcel Flores <marcel-flores@u.northwestern.edu>
16 * Zachary Bischof <zbischof@u.northwestern.edu>
17 * Kyle C. Hale <kh@u.northwestern.edu>
19 * This is free software. You are permitted to use,
20 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 // new printing macros
27 // used like TM_ERR(core, ABORT, "couldnt wangle the dangle");
29 #define TM_ERR(core, label, msg, ...) \
31 typeof (core) _core = (core); \
32 PrintError(_core->vm_info, _core, "TM %10s | " msg , #label, ##__VA_ARGS__); \
35 #define TM_DBG(core, label, msg, ...) \
37 typeof (core) _core = (core); \
38 PrintDebug(_core->vm_info, _core, "TM %10s | " msg , #label, ##__VA_ARGS__); \
46 struct list_head op_node;
49 void v3_clear_tm_lists(struct v3_trans_mem * tm);
51 // note memory location touched in the list, avoids duplicate creation
52 int add_mem_op_to_list(struct list_head * list, addr_t guest_addr);
54 // searches for address in the list, returns pointer to elt if found, null
55 struct mem_op * list_contains_guest_addr(struct list_head * list, addr_t guest_addr);
57 // checks for current = 0 in list, updates to new value from staging page
58 int update_list(struct v3_trans_mem * tm, struct list_head * list);
60 // writes value to staging page, sets current = 0
61 int stage_entry(struct v3_trans_mem * tm, struct list_head * list, addr_t guest_addr);
63 // adds entry to list if it doesnt exist, used in copying
64 int copy_add_entry(struct list_head * list, addr_t guest_addr, uint64_t data);
66 // if TM block succesfully finishes, commits the list
67 int commit_list(struct guest_info * core, struct v3_trans_mem * tm);
69 // copy other lists to core's global lists
70 int v3_copy_lists(struct guest_info *core);
72 // set TM_MODE to TM_ON
73 int v3_set_tm(struct v3_trans_mem * tm);
75 // set TM_MODE to TM_OFF, clear data structures
76 int v3_clr_tm(struct v3_trans_mem * tm);
78 // clear the vtlb on a core
79 int v3_clr_vtlb(struct guest_info *core);
81 // set TM_STATE to TM_ABORT
82 int v3_tm_set_abrt(struct v3_trans_mem * tm);
84 // free the staging page of the core
85 int v3_free_staging_page(struct v3_trans_mem * tm);