problem with vmwrite instruction

problem with vmwrite instruction

Hello,I am writing a code with intel vmx architecture(for vm purpose),here are my troubles:I use asm and cpp to write my code, for convinient purpose, I writethis code to call by cpp:__VMWRITE64_ proc Field:qword,pData:qword push r10 mov r10,qword ptr[rdx] xor rax,rax mov eax,ecx VMWRITE rax,r10 pop r10 jc error jz error jmp endok error: xor rax,rax ret endok: mov rax,1 ret__VMWRITE64_ endpand this is the caller:re = __VMWRITE64(VMX_VMCS16_HOST_FIELD_CS, (u64*)&cs);that code sometimes works well,but sometimes it cause BSOD on my Windows 7 X64, the CS selector of my OS is always 0x10,I am frustrated, because that BSOD do not have anyregular patterns.My cpu is core i3 2100 ,could you help me?Thanks.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Problem resolved. i3 2100 has 4 logic processor,my code works in PASSIVE_LEVEL,sometimes it may be interrupted and scheduled to another processor after VMXON,but the processor have changed on is not in VMX operation,so it cause #UD.When I Raise the IRQL to DISPATCH_LEVL,my code can't be scheduled,that code works well now.

Leave a Comment

Please sign in to add a comment. Not a member? Join today