Re: Tracking nested guest ioctl in L0 hypervisor

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

 



On Mon, Jul 30, 2012, siddhesh phadke wrote about "Tracking nested guest ioctl in L0 hypervisor":
> I am trying to understand KVM code for nested virtualization and my
> goal is to find whether an ioctl performed by L2 guest can be
> intercepted in L0.
> 
> Hence just for experimental purpose I wrote an blank ioctl in L2
> guest. When that ioctl is received by L1 KVM hypervisor ,it uses
> kvm_hypercall0() mentioned in kvm_para.h to notify L0. Am I doing this
> correct or is there any other method to do the same or I am completely
> off the track?
> 
> Can anyone please help me with this?

Do you really mean an *ioctl* in L2 - which is just a system call in
L2 (and never intercepted by L0 or L1), or a *hypercall*? From the
mention of kvm_hypercall0() it sounds like you mean a hypercall.

As you can see in vmx.c, nested_vmx_exit_handled(), when L0 receives
a VMCALL exit (i.e., a hypercall) from L2, we return 1 - meaning that
we exit to L1 so that it can handle this hypercall.

I believe that this is this is the more sensible behavior, but if you
want L0 to handle hypercalls, you can, in the EXIT_REASON_VMCALL case
in that function, return 0, which would cause L0 to handle this exit.

-- 
Nadav Har'El                        |        Wednesday, Aug 1 2012, 13 Av 5772
nyh@xxxxxxxxxxxxxxxxxxx             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Despite the cost of living, have you
http://nadav.harel.org.il           |noticed how it remains so popular?
--
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