Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


more cleanup
Jack Lange [Fri, 17 Oct 2008 00:16:25 +0000 (19:16 -0500)]
removed interrupt control function pointers from struct guest_info
moved v3_reg_t typedef to vmm_types.h
removed paging_mode_t typedef from shadow paging implementation

palacios/include/palacios/vm_guest.h
palacios/include/palacios/vmm_paging.h
palacios/include/palacios/vmm_shadow_paging.h
palacios/include/palacios/vmm_types.h
palacios/src/devices/nvram.c
palacios/src/palacios/vmm_intr.c
palacios/src/palacios/vmm_shadow_paging.c

index c15ffb1..010fc76 100644 (file)
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-#ifndef __VM_GUEST_H
-#define __VM_GUEST_H
+#ifndef __VM_GUEST_H__
+#define __VM_GUEST_H__
 
 #ifdef __V3VEE__
 
-
-#include <palacios/vmm_mem.h>
 #include <palacios/vmm_types.h>
+#include <palacios/vmm_mem.h>
 #include <palacios/vmm_io.h>
 #include <palacios/vmm_shadow_paging.h>
 #include <palacios/vmm_intr.h>
@@ -33,7 +32,7 @@
 #include <palacios/vmm_emulator.h>
 #include <palacios/vmm_host_events.h>
 
-typedef ullong_t v3_reg_t;
+
 
 
 
@@ -104,12 +103,6 @@ struct vmm_io_map;
 struct emulation_state;
 struct v3_intr_state;
 
-struct vm_ctrl_ops {
-  int (*raise_irq)(struct guest_info * info, int irq);
-  int (*lower_irq)(struct guest_info * info, int irq);
-};
-
-
 
 
 typedef enum {SHADOW_PAGING, NESTED_PAGING} v3_paging_mode_t;
@@ -155,8 +148,6 @@ struct guest_info {
   struct v3_dbg_regs dbg_regs;
   struct v3_segments segments;
 
-  struct vm_ctrl_ops vm_ops;
-
   struct emulation_state emulator;
 
   v3_vm_operating_mode_t run_state;
index 5351b36..93059e1 100644 (file)
@@ -18,8 +18,8 @@
  */
 
 
-#ifndef __VMM_PAGING_H
-#define __VMM_PAGING_H
+#ifndef __VMM_PAGING_H__
+#define __VMM_PAGING_H__
 
 
 #ifdef __V3VEE__
@@ -146,7 +146,7 @@ the host state in the vmcs before entering the guest.
 #define PT32_GUEST_PT 0x2
 
 
-#endif
+
 
 /* PDE 32 bit PAGE STRUCTURES */
 typedef enum {PDE32_ENTRY_NOT_PRESENT, PDE32_ENTRY_PTE32, PDE32_ENTRY_LARGE_PAGE} pde32_entry_type_t;
@@ -284,8 +284,6 @@ typedef struct pf_error_code {
   uint_t rsvd              : 27;
 } pf_error_t;
 
-typedef enum { PDE32 } paging_mode_t;
-
 
 
 
@@ -320,7 +318,6 @@ pde32_t * create_passthrough_pde32_pts(struct guest_info * guest_info);
 void PrintDebugPageTables(pde32_t * pde);
 
 
-#ifdef __V3VEE__
 
 
 void PrintPT32(addr_t starting_address, pte32_t * pte);
index 07c15f5..cb04d7d 100644 (file)
@@ -17,8 +17,8 @@
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-#ifndef __VMM_SHADOW_PAGING_H
-#define __VMM_SHADOW_PAGING_H
+#ifndef __VMM_SHADOW_PAGING_H__
+#define __VMM_SHADOW_PAGING_H__
 
 
 #ifdef __V3VEE__
 #include <palacios/vmm_paging.h>
 #include <palacios/vmm_hashtable.h>
 
+
 struct shadow_page_state {
 
   // these two reflect the top-level page directory
   // of the guest page table
-  paging_mode_t           guest_mode;
-  ullong_t                guest_cr3;         // points to guest's current page table
+  v3_reg_t                guest_cr3;         // points to guest's current page table
 
   // Should this be here??
-  ullong_t guest_cr0;
+  v3_reg_t guest_cr0;
 
   // these two reflect the top-level page directory 
   // of the shadow page table
-  paging_mode_t           shadow_mode;
-  ullong_t                shadow_cr3;
+  v3_reg_t                shadow_cr3;
 
 
   // Hash table that ties a CR3 value to a hash table pointer for the PT entries
@@ -69,7 +68,7 @@ int v3_handle_shadow_invlpg(struct guest_info * info);
 
 
 
-int v3_replace_shdw_page(struct guest_info * info, addr_t location, void * new_page, void* old_page);
+int v3_replace_shdw_page(struct guest_info * info, addr_t location, void * new_page, void * old_page);
 int v3_replace_shdw_page32(struct guest_info * info, addr_t location, pte32_t * new_page, pte32_t * old_page); 
 
 #endif // ! __V3VEE__
index 96e5642..ef9e498 100644 (file)
@@ -62,7 +62,7 @@ typedef unsigned char uint8_t;
 typedef char sint8_t;
 
 typedef ulong_t addr_t;
-
+typedef ullong_t v3_reg_t;
 #endif // ! __V3VEE__
 
 #endif
index e53f5c3..15c8dfa 100644 (file)
@@ -409,7 +409,7 @@ static void update_time(struct vm_device * dev, uint_t period_us) {
   // Interrupt associated VM, if needed
   if (statc->irq) { 
     PrintDebug("nvram: injecting interrupt\n");
-    dev->vm->vm_ops.raise_irq(dev->vm, NVRAM_RTC_IRQ);
+    v3_raise_irq(dev->vm, NVRAM_RTC_IRQ);
   }
 }
 
index a7f7924..7e1527c 100644 (file)
@@ -37,9 +37,6 @@ void v3_init_interrupt_state(struct guest_info * info) {
   info->intr_state.excp_error_code = 0;
 
   memset((uchar_t *)(info->intr_state.hooks), 0, sizeof(struct v3_irq_hook *) * 256);
-
-  info->vm_ops.raise_irq = &v3_raise_irq;
-  info->vm_ops.lower_irq = &v3_lower_irq; 
 }
 
 void v3_set_intr_controller(struct guest_info * info, struct intr_ctrl_ops * ops, void * state) {
@@ -209,7 +206,7 @@ int v3_raise_irq(struct guest_info * info, int irq) {
   return 0;
 }
 
+
 
 int v3_intr_pending(struct guest_info * info) {
   struct v3_intr_state * intr_state = &(info->intr_state);
index cca1e0f..cc4ced5 100644 (file)
@@ -78,8 +78,6 @@ static int handle_shadow_pagefault32(struct guest_info * info, addr_t fault_addr
 
 int v3_init_shadow_page_state(struct guest_info * info) {
   struct shadow_page_state * state = &(info->shdw_pg_state);
-  state->guest_mode = PDE32;
-  state->shadow_mode = PDE32;
   
   state->guest_cr3 = 0;
   state->shadow_cr3 = 0;