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.


cleanup of vmcb structs and names
Jack Lange [Wed, 10 Jun 2009 21:52:09 +0000 (16:52 -0500)]
palacios/include/palacios/svm_io.h
palacios/include/palacios/vmcb.h
palacios/src/palacios/svm_handler.c
palacios/src/palacios/vmcb.c
palacios/src/palacios/vmx.c

index 81dec75..03ce576 100644 (file)
 
 
 struct svm_io_info {
-    uint_t type        : 1       PACKED;  // (0=out, 1=in)
-    uint_t rsvd        : 1       PACKED;  // Must be Zero
-    uint_t str         : 1       PACKED;  // string based io
-    uint_t rep         : 1       PACKED;  // repeated io
-    uint_t sz8         : 1       PACKED;  // 8 bit op size
-    uint_t sz16        : 1       PACKED;  // 16 bit op size
-    uint_t sz32        : 1       PACKED;  // 32 bit op size
-    uint_t addr16      : 1       PACKED;  // 16 bit addr
-    uint_t addr32      : 1       PACKED;  // 32 bit addr
-    uint_t addr64      : 1       PACKED;  // 64 bit addr
-    uint_t rsvd2       : 6       PACKED;  // Should be Zero
-    uint16_t port                PACKED;  // port number
-};
+    uint_t type        : 1;  // (0=out, 1=in)
+    uint_t rsvd        : 1;  // Must be Zero
+    uint_t str         : 1;  // string based io
+    uint_t rep         : 1;  // repeated io
+    uint_t sz8         : 1;  // 8 bit op size
+    uint_t sz16        : 1;  // 16 bit op size
+    uint_t sz32        : 1;  // 32 bit op size
+    uint_t addr16      : 1;  // 16 bit addr
+    uint_t addr32      : 1;  // 32 bit addr
+    uint_t addr64      : 1;  // 64 bit addr
+    uint_t rsvd2       : 6;  // Should be Zero
+    uint16_t port;           // port number
+} __attribute__((packed));
 
 
 int v3_init_svm_io_map(struct guest_info * info);
index d8ee5c8..04dec0a 100644 (file)
 #define GET_VMCB_SAVE_STATE_AREA(page)   (page + VMCB_STATE_SAVE_AREA_OFFSET)
 
 
-#if __TINYC__
-#define PACKED
-#else
-#define PACKED __attribute__((packed))
-#endif
-
 
 typedef void vmcb_t;
 
@@ -386,8 +380,8 @@ typedef struct VMCB_State_Save_Area vmcb_saved_state_t;
 void PrintDebugVMCB(vmcb_t * vmcb);
 
 
-void set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs);
-void get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs);
+void v3_set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs);
+void v3_get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs);
 
 #endif // ! __V3VEE__
 
index 1e96118..3808ac2 100644 (file)
@@ -63,7 +63,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
     info->ctrl_regs.rflags = guest_state->rflags;
     info->ctrl_regs.efer = guest_state->efer;
     
-    get_vmcb_segments((vmcb_t*)(info->vmm_data), &(info->segments));
+    v3_get_vmcb_segments((vmcb_t*)(info->vmm_data), &(info->segments));
     info->cpu_mode = v3_get_vm_cpu_mode(info);
     info->mem_mode = v3_get_vm_mem_mode(info);
 
@@ -466,7 +466,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
     guest_state->rsp = info->vm_regs.rsp;
 
 
-    set_vmcb_segments((vmcb_t*)(info->vmm_data), &(info->segments));
+    v3_set_vmcb_segments((vmcb_t*)(info->vmm_data), &(info->segments));
 
     if (exit_code == VMEXIT_INTR) {
        //PrintDebug("INTR ret IP = %x\n", guest_state->rip);
index 379be02..9152709 100644 (file)
@@ -23,7 +23,7 @@
 
 
 
-void set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
+void v3_set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
     vmcb_seg->selector = seg->selector;
     vmcb_seg->limit = seg->limit;
     vmcb_seg->base = seg->base;
@@ -38,7 +38,7 @@ void set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg)
 }
 
 
-void get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
+void v3_get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
     seg->selector = vmcb_seg->selector;
     seg->limit = vmcb_seg->limit;
     seg->base = vmcb_seg->base;
@@ -53,35 +53,35 @@ void get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg)
 }
 
 
-void set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
+void v3_set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
     vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
 
-    set_vmcb_segment(&(guest_area->cs), &(segs->cs));
-    set_vmcb_segment(&(guest_area->ds), &(segs->ds));
-    set_vmcb_segment(&(guest_area->es), &(segs->es));
-    set_vmcb_segment(&(guest_area->fs), &(segs->fs));
-    set_vmcb_segment(&(guest_area->gs), &(segs->gs));
-    set_vmcb_segment(&(guest_area->ss), &(segs->ss));
-    set_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
-    set_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
-    set_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
-    set_vmcb_segment(&(guest_area->tr), &(segs->tr));
+    v3_set_vmcb_segment(&(guest_area->cs), &(segs->cs));
+    v3_set_vmcb_segment(&(guest_area->ds), &(segs->ds));
+    v3_set_vmcb_segment(&(guest_area->es), &(segs->es));
+    v3_set_vmcb_segment(&(guest_area->fs), &(segs->fs));
+    v3_set_vmcb_segment(&(guest_area->gs), &(segs->gs));
+    v3_set_vmcb_segment(&(guest_area->ss), &(segs->ss));
+    v3_set_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
+    v3_set_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
+    v3_set_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
+    v3_set_vmcb_segment(&(guest_area->tr), &(segs->tr));
 }
 
 
-void get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
+void v3_get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
     vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
 
-    get_vmcb_segment(&(guest_area->cs), &(segs->cs));
-    get_vmcb_segment(&(guest_area->ds), &(segs->ds));
-    get_vmcb_segment(&(guest_area->es), &(segs->es));
-    get_vmcb_segment(&(guest_area->fs), &(segs->fs));
-    get_vmcb_segment(&(guest_area->gs), &(segs->gs));
-    get_vmcb_segment(&(guest_area->ss), &(segs->ss));
-    get_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
-    get_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
-    get_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
-    get_vmcb_segment(&(guest_area->tr), &(segs->tr));
+    v3_get_vmcb_segment(&(guest_area->cs), &(segs->cs));
+    v3_get_vmcb_segment(&(guest_area->ds), &(segs->ds));
+    v3_get_vmcb_segment(&(guest_area->es), &(segs->es));
+    v3_get_vmcb_segment(&(guest_area->fs), &(segs->fs));
+    v3_get_vmcb_segment(&(guest_area->gs), &(segs->gs));
+    v3_get_vmcb_segment(&(guest_area->ss), &(segs->ss));
+    v3_get_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
+    v3_get_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
+    v3_get_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
+    v3_get_vmcb_segment(&(guest_area->tr), &(segs->tr));
 }
 
 
index ba5734b..19f8312 100644 (file)
@@ -50,9 +50,6 @@ extern int Launch_VM(ullong_t vmcsPtr, uint_t eip);
 #define ROMBIOS_DEBUG_PORT    0x403
 
 
-extern struct vmm_os_hooks * os_hooks;
-
-
 static struct VM theVM;
 
 static uint_t GetLinearIP(struct VM *vm)