From: Jack Lange Date: Mon, 1 Dec 2008 23:28:49 +0000 (-0600) Subject: small fixes X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=9526410ca7474542623aa2e74b2ce001dd7ec55e small fixes --- diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index 6f22cfa..b164213 100644 --- a/palacios/include/palacios/vmm.h +++ b/palacios/include/palacios/vmm.h @@ -24,6 +24,7 @@ #include #include + #ifdef __V3VEE__ //#include diff --git a/palacios/include/palacios/vmm_shadow_paging.h b/palacios/include/palacios/vmm_shadow_paging.h index 962803d..bea54aa 100644 --- a/palacios/include/palacios/vmm_shadow_paging.h +++ b/palacios/include/palacios/vmm_shadow_paging.h @@ -34,13 +34,16 @@ struct shadow_page_state { 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; diff --git a/palacios/include/palacios/vmm_socket.h b/palacios/include/palacios/vmm_socket.h index 5af1c69..bd88682 100644 --- a/palacios/include/palacios/vmm_socket.h +++ b/palacios/include/palacios/vmm_socket.h @@ -42,7 +42,7 @@ 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; \ }) @@ -68,8 +68,24 @@ }) -#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; \ + }) diff --git a/palacios/src/palacios/vmm_paging.c b/palacios/src/palacios/vmm_paging.c index 6f1bc14..a5ef2df 100644 --- a/palacios/src/palacios/vmm_paging.c +++ b/palacios/src/palacios/vmm_paging.c @@ -414,11 +414,8 @@ int v3_check_guest_pt_64(struct guest_info * info, v3_reg_t guest_cr3, addr_t va /* * 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 */ /** diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index d58fed7..a427b13 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -26,6 +26,8 @@ #include #include +#include + #ifndef DEBUG_SHADOW_PAGING #undef PrintDebug #define PrintDebug(fmt, args...) @@ -37,6 +39,26 @@ ***/ +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; +}; +