Skip to content

Commit

Permalink
CR3 vmx allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Chourdakis committed Jan 21, 2019
1 parent 57b85e1 commit dff3657
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bx_enh_dbg.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ isLittleEndian = TRUE
DefaultAsmLines = 512
DumpWSIndex = 0
DockOrder = 0x132
ListWidthPix[0] = 483
ListWidthPix[1] = 358
ListWidthPix[2] = 169
ListWidthPix[0] = 955
ListWidthPix[1] = 662
ListWidthPix[2] = 303
FontName = System
FontSize = -16
MainWindow = 208, 208, 1234, 933
MainWindow = -8, -8, 1928, 1058
2 changes: 1 addition & 1 deletion dmmic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ mov ebx,0x007
linear ecx,stx3e,STACKS
linear edx,v3,T64
mov esi,2 ; Mode 2 -> Long mode
;int 0xF0 ; Not working yet because CR3 writing causes VMEXIT
;int 0xF0 ; Not working yet because MSR writing causes VMEXIT, (we haven't yet defined MSR bitmaps in VMX)



Expand Down
Binary file modified entry.exe
Binary file not shown.
15 changes: 12 additions & 3 deletions vmxhost64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,18 @@ RET

VMX_Initialize_VMX_Controls:
; edx = 0x82 for unrestricted guestm, 0x2 if simple with EPT
vmw32 0x4012,0x11FF ; Entry
vmw32 0x4000,0x1F ; PIN
vmw32 0x4002,0x8401e9f2; Proc

vmw32 0x4012,0x11FF ; Entry. Ideally, we must read 0x484 MSR to learn what to put here
; bit 9 - Guest is in long mode
; bit 10 - Guest is in SMM
; bit 11 - Deactivate Dual monitor treatment
; We can use also 0x4014 to control MSRs -> if different than the host (mighty)

vmw32 0x4000,0x1F ; PIN, Intel 3B Chapter 20.6.1
; vmw32 0x4002,0x8401e9f2; Proc, Intel 3B Chapter 20.6.2
vmw32 0x4002,0x840069F2; Proc, Intel 3B Chapter 20.6.2, Leave CR3 access so we can enable long mode

vmw32 0x401E,edx
vmw32 0x400C,0x36FFF
RET
Expand Down

0 comments on commit dff3657

Please sign in to comment.