I was writing a code of building a hyper-visor (based on Intel VT-x) in system. But something I don't understand occured:
If I set a break-point at guest rip, or even some instructions after, the break-point would hit but continuing the execution is fine. Nothing bad happens.
If I don't set any break-points, after certain amount of executions of instructions, the hyper-visor caught a triple-fault, a fatal error to guest.
It is almost as if the break-point saved the system!
My conclusion is that the debugger automatically recovered certain conditions in system.
I also tried to set the exception-bitmap field in VMCS. The conclusion comes that:
If I intercept #PF, #PF would trap in a never-ending spiral.
If I don't intercept #PF, but all other exceptions, only Double-Fault would be intercepted. I think the first fault might be the #PF.
Then the conclusion comes to that the break-point avoided the #PF to happen somehow, but I don't understand it at all.
I, maybe, have faults on settings of guest state area. The break-point may changed one or more fields of the guest-state.
My analysis is given above. However, it cannot give me resolution. I therefore would like to ask how this strange phenomenon occurs in detail and how can I solve this?
Thanks in advance.
If I set a break-point at guest rip, or even some instructions after, the break-point would hit but continuing the execution is fine. Nothing bad happens.
If I don't set any break-points, after certain amount of executions of instructions, the hyper-visor caught a triple-fault, a fatal error to guest.
It is almost as if the break-point saved the system!
My conclusion is that the debugger automatically recovered certain conditions in system.
I also tried to set the exception-bitmap field in VMCS. The conclusion comes that:
If I intercept #PF, #PF would trap in a never-ending spiral.
If I don't intercept #PF, but all other exceptions, only Double-Fault would be intercepted. I think the first fault might be the #PF.
Then the conclusion comes to that the break-point avoided the #PF to happen somehow, but I don't understand it at all.
I, maybe, have faults on settings of guest state area. The break-point may changed one or more fields of the guest-state.
My analysis is given above. However, it cannot give me resolution. I therefore would like to ask how this strange phenomenon occurs in detail and how can I solve this?
Thanks in advance.
At long last, the jumping hands of time will be halted by a weakling cast in eternal solitude.