[BitVisor-devel-en:44] Re: what will bitvisor excute when vm exit?
王利朋
wlpscu at gmail.com
Fri May 10 14:59:34 JST 2013
// Asm.s
mov $VMCS_HOST_RIP,%rax
mov $1f,%edx
vmwrite %rdx,%rax
It can be inferred from the above code that when vm exit, the followings
code will be excuted:
1:
xchg (%rsp),%rdi
mov %rax,8*RAX(%rdi)
mov %rcx,8*RCX(%rdi)
mov %rdx,8*RDX(%rdi)
mov %rbx,8*RBX(%rdi)
mov %rbp,8*RBP(%rdi)
mov %rsi,8*RSI(%rdi)
popq 8*RDI(%rdi)
mov %cr2,%rax
mov %rax,8*CR2(%rdi)
mov %r8,8*R8(%rdi)
mov %r9,8*R9(%rdi)
mov %r10,8*R10(%rdi)
mov %r11,8*R11(%rdi)
mov %r12,8*R12(%rdi)
mov %r13,8*R13(%rdi)
mov %r14,8*R14(%rdi)
mov %r15,8*R15(%rdi)
xor %rax,%rax
2:
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbx
pop %rbp
ret
However, the above codes do nothing except that transferring some data.
Those code have nothing connected with the function "vt__exit_reason ()"
which will handle event.Thank you!
2013/5/10 Hideki EIRAKU <hdk at igel.co.jp>
> From: 王利朋 <wlpscu at gmail.com>
> Subject: [BitVisor-devel-en:41] what will bitvisor excute when vm exit?
> Date: Fri, 10 May 2013 10:08:25 +0800
>
> > asm_vmwrite (VMCS_GUEST_RIP, 0xDEADBEEF);
> >>From the above sentence, it can be infered that when vm exit, the code at
> > the address 0xDEADBEEF will excute. But I does not know what function it
> > will excute? Thank you!
>
> The VMCS_GUEST_RIP is overwritten in the copy_bootsector() function.
> The address 0xDEADBEEF is for debugging use only. The address cannot
> be executed in real-address mode. So if the VM stopped at the
> address, there is an initialization problem.
>
> On VM exit, CPU modifies the program counter to a value in
> VMCS_HOST_RIP (not VMCS_GUEST_RIP). The VMCS_HOST_RIP is overwritten
> before executing vmlaunch or vmresume in functions in the file
> core/asm.s.
>
> 0xDEADBEEF is one of hexspeak values.
> See http://en.wikipedia.org/wiki/Hexspeak for more details.
>
> --
> Hideki EIRAKU <hdk at igel.co.jp>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.bitvisor.org/archives/bitvisor-devel-en/attachments/20130510/6e078ebc/attachment.html
More information about the BitVisor-devel-en
mailing list