Closed ghost closed 3 years ago
It appears to be the IPI is not processed by one or more processors.
Few questions.
Is it possible that it has something to do with incorrectly setting up IDTR and segment attributes?
Diagnosing an issue without code is not going to be easy for me. I offer several debugging tips for you can hopefully figure it out instead.
If the critical structures like IDTR is incorrectly setup, it could cause the problem like that, but since the system works for few seconds, it do not expect that's the cause. It more likely causes problems immediately unless the mistake is very subtle.
Thank you for the detailed response, I will keep you updated on my testing when I get home.
I didn't fix the problem yet, but I managed to get more information about the error. I also ported some code, from your code to my fork of your repository, but that still resulted in the same problem. The freeze happens no matter if the system is single core or multi core. When I restrict my virtual machine to one core, I can't break into the virtual machine when it hangs, at all, so I am testing with 2 cores. I switched to the second core, to view registers and call stack, and the call stack of second core looks pretty interesting.
core 1 callstack:
core 2 callstack:
I'll upload my code below in a ZIP, If you could take a look at it I would greatly appreciate it. Thanks in advance.
I compile with: x64, Debug
Hi, thank you for sharing code and more details. Please try those:
I removed all dbgprints, no change in the result. It appears that the issue doesn't have anything to do with interrupts, I inspected core 2 and found out that it is constantly causing a guest page fault in an infinite loop.
The page fault address printed in the picture below is the output from Exitinfo2
The first core is executing normally without any problem.
EDIT: I fixed this page fault loop, I might have fixed the freezing problem, I'll post updates soon and I think I'm on the right track to debug this right now.
I finally fixed the freezing issue, turns out it was caused by me putting breakpoints in the VMEXIT handler. For some reason the breakpoints in VMEXIT handler caused a hang.
Thank you for spending time to fix this with me, I will close this issue now 👍 .
That's interesting and new to me (with outside certain vm-exits). Thank you for sharing this gotcha!
Hello, thank you for this simple repository, it is really helping me learn all about virtualization on AMD processors. I downloaded your hypervisor, and recoded many parts to gain a better understanding on how things work. Right now, I am having an issue where the entire system hangs a few seconds after vmrun. I found out that it always hangs at PAUSE instruction after sending an IPI request (KiIpiSendRequest) in an ntoskrnl function. I have attached two images below, showing exactly where it hangs inside ntoskrnl.
What could possibly be the reason behind this?
Thanks in advance.