Hello,
I'm writing a code using Intel-VT for particular purpose.
(the purpose is to run Intel-VT under the regular OS.)
In this code, only one VMCS is used (per CPU), and the VPID in it is changed frequently (when "VM exit" caused by MOV to CR3 occured) for performance gain.
However, such use of VPID makes OS blue screen.
When the part of the code, which may cause the problem, is removed, it works well.
Is my use of VPID (such as rewriting VPID) illegal in the specification?
Or, is it an errata of the CPU?
I used Corei7 920 for the verification.
The pseudo code is shown as follows.
__declspec(naked) void VMExitHandler() // this function is executed when VM exit occurred.
{
...
if (VMexitReason == EXIT_REASON_CR_ACCESS){
if (ExitQualification == MOV_to_CR3){
__vmwrite(GUEST_CR3, getMovRegValue(ExitQualification));
__vmwrite(HOST_CR3, getMovRegValue(ExitQualification));
__vmwrite(VIRTUAL_PROCESSOR_ID, (unsigned short)(__vmread(GUEST_CR3) >> 12))); // this line is to improve the performance. if this line was removed, this code works well.
__vmresume();
}
}
...
}
Thanks.


