-
Notifications
You must be signed in to change notification settings - Fork 258
/
shvvmxhvx64.asm
43 lines (39 loc) · 1.34 KB
/
shvvmxhvx64.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;++
;
; Copyright (c) Alex Ionescu. All rights reserved.
;
; Module:
;
; shvvmxhvx64.asm
;
; Abstract:
;
; This module implements the AMD64-specific SimpleVisor VMENTRY routine.
;
; Author:
;
; Alex Ionescu (@aionescu) 16-Mar-2016 - Initial version
;
; Environment:
;
; Kernel mode only.
;
;--
.code
extern ShvVmxEntryHandler:proc
extern ShvOsCaptureContext:proc
ShvVmxEntry PROC
push rcx ; save the RCX register, which we spill below
lea rcx, [rsp+8h] ; store the context in the stack, bias for
; the return address and the push we just did.
call ShvOsCaptureContext ; save the current register state.
; note that this is a specially written function
; which has the following key characteristics:
; 1) it does not taint the value of RCX
; 2) it does not spill any registers, nor
; expect home space to be allocated for it
jmp ShvVmxEntryHandler ; jump to the C code handler. we assume that it
; compiled with optimizations and does not use
; home space, which is true of release builds.
ShvVmxEntry ENDP
end