ionescu007 / SimpleVisor

SimpleVisor is a simple, portable, Intel VT-x hypervisor with two specific goals: using the least amount of assembly code (10 lines), and having the smallest amount of VMX-related code to support dynamic hyperjacking and unhyperjacking (that is, virtualizing the host state from within the host). It works on Windows and UEFI.
http://ionescu007.github.io/SimpleVisor/
1.72k stars 256 forks source link

Question about VM_EXIT_ACK_INTR_ON_EXIT #31

Closed wbenny closed 6 years ago

wbenny commented 6 years ago

Hi, is setting VM_EXIT_ACK_INTR_ON_EXIT flag really necessary, if PIN_BASED_EXT_INTR is not set? I hope it's not super stupid question, but if I understand Intel Manual correctly, you shouldn't get any VMEXITs for external interrupts when PIN_BASED_EXT_INTR is not set - and if this is the case, the VM_EXIT_ACK_INTR_ON_EXIT is unnecessary.

I'm quite confused by this - I've been stuck on the VM_EXIT_ACK_INTR_ON_EXIT flag for too long in the Intel Manual, and when I thought I understand what it does, I realised many "simple opensource hypervisors" unneccessarily set it (SimpleVisor, ksm, HyperPlatform, ...).

So now I'm wondering, if either my understanding is correct OR if everyone just blatantly copy-pasted this practice from somewhere :)

If I'm completely wrong, I would be glad if you corrected me.

rianquinn commented 6 years ago

It's not needed. In Bareflank, we don't set it in the base hypervisor. https://github.com/Bareflank/hypervisor/blob/master/bfvmm/src/hve/arch/intel_x64/exit_handler/exit_handler.cpp#L574

wbenny commented 6 years ago

Nice, thanks Rian!

ionescu007 commented 6 years ago

It’s not needed, you’re right. Want to do a pull request please (and test it?)

On Thu, Aug 2, 2018 at 12:12 AM Parallel Xenoexcite < notifications@github.com> wrote:

Nice, thanks Rian!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionescu007/SimpleVisor/issues/31#issuecomment-409755047, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxIeLjG10LKWt7CnBjBJSwxGTsFQaFEks5uMjXHgaJpZM4Vn1IM .

-- Best regards, Alex Ionescu

wbenny commented 6 years ago

If testing inside of the VMWare is enough, I'll gladly provide pull request later today. :)

ionescu007 commented 6 years ago

Yep it’s eniugh :)

On Thu, Aug 2, 2018 at 4:35 PM Parallel Xenoexcite notifications@github.com wrote:

If testing inside of the VMWare is enough, I'll gladly provide pull request later today. :)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ionescu007/SimpleVisor/issues/31#issuecomment-409969219, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxIeOj_4sZn4WeJ3HR39M9CeNFavn-Mks5uMxw5gaJpZM4Vn1IM .

-- Best regards, Alex Ionescu