X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fsvm_lowlevel.asm;h=57ea853114d557c75b41315822896033af4a116c;hb=701de97007c8b6776998eeab78469a4304f6b871;hp=40bb8ea1ad5a8e59a2f7b8382c2fc00a76a58b1b;hpb=2e05f3b8f738466246add183c55bcb17abf33ec9;p=palacios-OLD.git diff --git a/palacios/src/geekos/svm_lowlevel.asm b/palacios/src/geekos/svm_lowlevel.asm index 40bb8ea..57ea853 100644 --- a/palacios/src/geekos/svm_lowlevel.asm +++ b/palacios/src/geekos/svm_lowlevel.asm @@ -9,6 +9,8 @@ +EXTERN handle_svm_exit + EXPORT launch_svm @@ -27,16 +29,63 @@ EXPORT launch_svm + +; I think its safe to say that there are some pretty serious register issues... launch_svm: push ebp mov ebp, esp pusha mov eax, [ebp + 8] -; vmrun - db 00fh, 001h, 0d8h + vmrun +; db 00fh, 001h, 0d8h popa pop ebp ret %endif + + + + +; eventual svm_launch +; pusha +; pushf +; +; .vmm_loop +; vmrun +; push guest GPRs +; call handle_svm_exit +; jz .vmm_loop +; popf +; popa +; ret +; +; +; + + + +;; Need to check this.. +;; Since RAX/EAX is saved in the VMCB, we should probably just +;; do our own replacement for pusha/popa that excludes [e|r]ax +safe_svm_launch: + push ebp + mov ebp, esp + pushf + pusha + +.vmm_loop: + mov eax, [ebp + 8] + vmrun + pusha + call handle_svm_exit + and eax, eax + popa ;; restore the guest GPRs, (DOES THIS AFFECT E/RFLAGS?) + jz .vmm_loop + + ;; HOW DO WE GET THE RETURN VALUE OF HANDLE_SVM_EXIT BACK TO THE CALLER + popf + popa + pop ebp + ret \ No newline at end of file