#include <palacios/vm_guest.h>
#include <palacios/vmm_mem.h>
+
#ifdef __V3VEE__
//#include <palacios/vmm_types.h>
v3_reg_t guest_cr3;
v3_reg_t guest_cr0;
- // these two reflect the top-level page directory
- // of the shadow page table
- // v3_reg_t shadow_cr3;
- // Hash table that ties a CR3 value to a hash table pointer for the PT entries
+
+ // Page table struct lookup table
+ struct hashtable * pt_cache;
+
+ // Guest CR3 to Shadow CR3 Lookup Table
struct hashtable * cr3_cache;
+
+ /* SOON TO BE DEPRECATED */
// Hash table that contains a mapping of guest pte addresses to host pte addresses
struct hashtable * cached_ptes;
addr_t cached_cr3;
extern struct v3_socket_hooks * sock_hooks; \
V3_SOCK sock = 0; \
if ((sock_hooks) && (sock_hooks)->tcp_socket) { \
- sock = (sock_hooks)->tcp_socket(0,0); \
+ sock = (sock_hooks)->tcp_socket(0,0,0); \
} \
sock; \
})
})
-#define V3_Accept_Socket() (-1)
-#define V3_Select_Socket() (-1)
+#define V3_Accept_Socket(sock, ip_ptr) ({ \
+ extern struct v3_socket_hooks * sock_hooks; \
+ int ret = -1; \
+ if ((sock_hooks) && (sock_hooks)->accept) { \
+ ret = (sock_hooks)->accept(sock, ip_ptr); \
+ } \
+ ret; \
+ })
+
+
+#define V3_Select_Socket(rset,wset,eset,tv) ({ \
+ extern struct v3_socket_hooks * sock_hooks; \
+ int ret = -1; \
+ if ((sock_hooks) && (sock_hooks)->select) { \
+ ret = (sock_hooks)->select(rset, wset, eset, tv); \
+ } \
+ ret; \
+ })
/*
* PAGE TABLE LOOKUP FUNCTIONS
*
- *
* The value of entry is a return type:
* Page not present: *entry = 0
- * Large Page: *entry = translated physical address (byte granularity)
- * PTE entry: *entry is the address of the PTE Page
*/
/**
#include <palacios/vmm_decoder.h>
#include <palacios/vmm_ctrl_regs.h>
+#include <palacios/vmm_hashtable.h>
+
#ifndef DEBUG_SHADOW_PAGING
#undef PrintDebug
#define PrintDebug(fmt, args...)
***/
+struct guest_table {
+ addr_t cr3;
+ struct list_head link;
+};
+
+
+struct backptr {
+ addr_t ptr;
+ struct list_head link;
+};
+
+
+struct shadow_page_data {
+ addr_t ptr;
+ addr_t guest_addr;
+
+ struct list_head backptrs;
+ struct list_head guest_tables;
+};
+