Merge branch 'dev' into 'master'

more cleaning

See merge request _xeroxz/bluepill!6
master
_xeroxz 3 years ago
commit 971a18fead

@ -32,10 +32,22 @@ auto exit_handler(hv::pguest_registers regs) -> void
ia32_vmx_procbased_ctls_register procbased_ctls;
__vmx_vmread(VMCS_CTRL_PROCESSOR_BASED_VM_EXECUTION_CONTROLS, &procbased_ctls.flags);
// if an NMI happens right here and my NMI handler sets nmi window exiting on...
// its going to be overwritten with off right here... sus...
procbased_ctls.nmi_window_exiting = false;
__vmx_vmwrite(VMCS_CTRL_PROCESSOR_BASED_VM_EXECUTION_CONTROLS, procbased_ctls.flags);
goto dont_advance;
}
case VMX_EXIT_REASON_EXCEPTION_OR_NMI:
{
ia32_vmx_procbased_ctls_register procbased_ctls;
__vmx_vmread(VMCS_CTRL_PROCESSOR_BASED_VM_EXECUTION_CONTROLS, &procbased_ctls.flags);
procbased_ctls.nmi_window_exiting = true;
__vmx_vmwrite(VMCS_CTRL_PROCESSOR_BASED_VM_EXECUTION_CONTROLS, procbased_ctls.flags);
goto dont_advance;
}
case VMX_EXIT_REASON_EXECUTE_XSETBV:
{
if (handle::xsetbv(regs))

@ -689,7 +689,6 @@ namespace hv
u64 vmcs_phys;
u64 vmxon_phys;
u64 error_code;
u64 nmi_code;
} vcpu_ctx, * pvcpu_ctx;
typedef struct _vmx_ctx

@ -8638,6 +8638,10 @@ typedef union
#define IA32_MTRR_PHYSBASE7 0x0000020E
#define IA32_MTRR_PHYSBASE8 0x00000210
#define IA32_MTRR_PHYSBASE9 0x00000212
#define IA32_MTRR_PHYSBASEN(n) \
IA32_MTRR_PHYSBASE0 + (n * 2)
/**
* @}
*/
@ -8697,7 +8701,7 @@ typedef union
uint64_t flags;
} ia32_mtrr_physmask_register;
#define IA32_MTRR_PHYSMASK0 0x00000201
#define IA32_MTRR_PHYSMASK1 0x00000203
#define IA32_MTRR_PHYSMASK2 0x00000205
@ -8708,6 +8712,10 @@ typedef union
#define IA32_MTRR_PHYSMASK7 0x0000020F
#define IA32_MTRR_PHYSMASK8 0x00000211
#define IA32_MTRR_PHYSMASK9 0x00000213
#define IA32_MTRR_PHYSMASKN(n) \
IA32_MTRR_PHYSMASK0 + (n * 2)
/**
* @}
*/

@ -153,6 +153,8 @@ namespace vmcs
ia32_vmx_basic_register vmx_basic{ __readmsr(IA32_VMX_BASIC) };
pinbased_ctls.virtual_nmi = true;
pinbased_ctls.nmi_exiting = true;
procbased_ctls.activate_secondary_controls = true;
exit_ctls.host_address_space_size = true;

Loading…
Cancel
Save