From: Jack Lange Date: Fri, 17 Oct 2008 00:16:25 +0000 (-0500) Subject: more cleanup X-Git-Tag: 1.0^2~43 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=0899a5c74318e582f3d6ebec52cc744cdb727734 more cleanup 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 --- diff --git a/palacios/include/palacios/vm_guest.h b/palacios/include/palacios/vm_guest.h index c15ffb1..010fc76 100644 --- a/palacios/include/palacios/vm_guest.h +++ b/palacios/include/palacios/vm_guest.h @@ -17,14 +17,13 @@ * 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 #include +#include #include #include #include @@ -33,7 +32,7 @@ #include #include -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; diff --git a/palacios/include/palacios/vmm_paging.h b/palacios/include/palacios/vmm_paging.h index 5351b36..93059e1 100644 --- a/palacios/include/palacios/vmm_paging.h +++ b/palacios/include/palacios/vmm_paging.h @@ -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); diff --git a/palacios/include/palacios/vmm_shadow_paging.h b/palacios/include/palacios/vmm_shadow_paging.h index 07c15f5..cb04d7d 100644 --- a/palacios/include/palacios/vmm_shadow_paging.h +++ b/palacios/include/palacios/vmm_shadow_paging.h @@ -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__ @@ -27,20 +27,19 @@ #include #include + 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__ diff --git a/palacios/include/palacios/vmm_types.h b/palacios/include/palacios/vmm_types.h index 96e5642..ef9e498 100644 --- a/palacios/include/palacios/vmm_types.h +++ b/palacios/include/palacios/vmm_types.h @@ -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 diff --git a/palacios/src/devices/nvram.c b/palacios/src/devices/nvram.c index e53f5c3..15c8dfa 100644 --- a/palacios/src/devices/nvram.c +++ b/palacios/src/devices/nvram.c @@ -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); } } diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c index a7f7924..7e1527c 100644 --- a/palacios/src/palacios/vmm_intr.c +++ b/palacios/src/palacios/vmm_intr.c @@ -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); diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index cca1e0f..cc4ced5 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -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;