Re: about using vmcall instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



吴忠远 wrote:
> an module is executed in guest using vmcall instruction. then host
> handler the vmcall exit and read the registers value. but ax,cx,dx get
> the correct values while bx and si get the worong. what is the
> problem.
> code  in guest is :
> __asm__  ("mov $10,%ax");
> __asm__  ("mov $20,%bx");
> __asm__  ("mov $30,%cx");
> __asm__  ("mov $40,%dx");
> __asm__  ("mov $50,%si");
> __asm__  ("vmcall");
> host output :
> HYPER CALL IS CALLED AND THE NR IS 10,bx is -526778348,cx is 30,dx is
> 40,si is -1017839566
> so ax(NR) ,cx,dx values are correct .but bx and si values are wrong.why?
Nothing, you just set the lower 16 bits of the registers and output at
least 32 bits on the host. The upper 16 bits are left from the previous
code in the guest. So EBX is 0xe09a0014 (with the lower 16 bits being
0x14=20) and ESI is c3550032 with the lower 16 bits being 0x32=50.
Please either use ebx and esi in the guest code or mask the registers to
16 bits in the host.

Regards,
Andre.

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux