#include <palacios/vmm_paging.h>
#include <palacios/vmm_hashtable.h>
#include <palacios/vmm_list.h>
+#include <palacios/vmm_msr.h>
struct shadow_page_state {
// virtualized control registers
v3_reg_t guest_cr3;
v3_reg_t guest_cr0;
+ v3_msr_t guest_efer;
// list of allocated shadow pages
struct list_head page_list;
if (info->shdw_pg_mode == SHADOW_PAGING) {
cr0 = (struct cr0_32 *)&(info->shdw_pg_state.guest_cr0);
- efer = (struct efer_64 *)&(info->guest_efer);
+ efer = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
} else if (info->shdw_pg_mode == NESTED_PAGING) {
cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0);
efer = (struct efer_64 *)&(guest_state->efer);
if (info->shdw_pg_mode == SHADOW_PAGING) {
cr0 = (struct cr0_32 *)&(info->shdw_pg_state.guest_cr0);
- efer = (struct efer_64 *)&(info->guest_efer);
+ efer = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
} else if (info->shdw_pg_mode == NESTED_PAGING) {
cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0);
efer = (struct efer_64 *)&(guest_state->efer);
if (paging_transition) {
if (v3_get_vm_mem_mode(info) == VIRTUAL_MEM) {
- struct efer_64 * guest_efer = (struct efer_64 *)&(info->guest_efer);
+ struct efer_64 * guest_efer = (struct efer_64 *)&(info->shdw_pg_state.guest_efer);
struct efer_64 * shadow_efer = (struct efer_64 *)&(info->ctrl_regs.efer);
// Check long mode LME to set LME
int v3_handle_efer_read(uint_t msr, struct v3_msr * dst, void * priv_data) {
struct guest_info * info = (struct guest_info *)(priv_data);
- PrintDebug("EFER Read HI=%x LO=%x\n", info->guest_efer.hi, info->guest_efer.lo);
+ PrintDebug("EFER Read HI=%x LO=%x\n", info->shdw_pg_state.guest_efer.hi, info->shdw_pg_state.guest_efer.lo);
- dst->value = info->guest_efer.value;
+ dst->value = info->shdw_pg_state.guest_efer.value;
info->rip += 2; // WRMSR/RDMSR are two byte operands
return 0;
struct guest_info * info = (struct guest_info *)(priv_data);
//struct efer_64 * new_efer = (struct efer_64 *)&(src.value);
struct efer_64 * shadow_efer = (struct efer_64 *)&(info->ctrl_regs.efer);
- struct v3_msr * guest_efer = &(info->guest_efer);
+ struct v3_msr * guest_efer = &(info->shdw_pg_state.guest_efer);
PrintDebug("EFER Write\n");
PrintDebug("EFER Write Values: HI=%x LO=%x\n", src.hi, src.lo);