* 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>
#include <palacios/vmm_emulator.h>
#include <palacios/vmm_host_events.h>
-typedef ullong_t v3_reg_t;
+
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;
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;
*/
-#ifndef __VMM_PAGING_H
-#define __VMM_PAGING_H
+#ifndef __VMM_PAGING_H__
+#define __VMM_PAGING_H__
#ifdef __V3VEE__
#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;
uint_t rsvd : 27;
} pf_error_t;
-typedef enum { PDE32 } paging_mode_t;
-
void PrintDebugPageTables(pde32_t * pde);
-#ifdef __V3VEE__
void PrintPT32(addr_t starting_address, pte32_t * pte);
* 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
-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__
typedef char sint8_t;
typedef ulong_t addr_t;
-
+typedef ullong_t v3_reg_t;
#endif // ! __V3VEE__
#endif
// 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);
}
}
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) {
return 0;
}
-
+
int v3_intr_pending(struct guest_info * info) {
struct v3_intr_state * intr_state = &(info->intr_state);
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;