Software Archive
Read-only legacy content
17061 Discussions

problem with vmwrite instruction

fanwenyi0529
Beginner
565 Views
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_ endp
and 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.
0 Kudos
1 Reply
fanwenyi0529
Beginner
565 Views
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.
0 Kudos
Reply