- 论坛徽章:
- 0
|
vmx_vcpu_run在vmlaunch之前保存主机状态,如果说"mov %%" _ASM_SP ", %c[host_rsp](%0) \n\t"是把主机的rsp寄存器保存到vmcs中,那下一句ASM_VMX_VMWRITE_RSP_RDX起什么作用呢?
我查了下intel手册,vmwrite指令的功能是Writes the contents of a primary source operand (register or memory) to a specified field in a VMCS。从这个宏的名字看这两个操作数应该就是rsp和rdx,但这个时候rdx的值又是并不确定的。实在是想不明白。哪位大牛解释下
"push %%" _ASM_DX "; push %%" _ASM_BP ";"
"push %%" _ASM_CX " \n\t" /* placeholder for guest rcx */
"push %%" _ASM_CX " \n\t"
"cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
"je 1f \n\t"
"mov %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
__ex(ASM_VMX_VMWRITE_RSP_RDX) "\n\t"
|
|