kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nadav Har'El <nyh@math.technion.ac.il>
To: siddhesh phadke <phadkesap@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Tracking nested guest ioctl in L0 hypervisor
Date: Wed, 1 Aug 2012 13:52:45 +0300	[thread overview]
Message-ID: <20120801105245.GA17325@fermat.math.technion.ac.il> (raw)
In-Reply-To: <CAMSfDahAJOborjGc8C0FLs7mq4O86Ny=_=qR_bCo+ZJbyEmAYQ@mail.gmail.com>

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@math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Despite the cost of living, have you
http://nadav.harel.org.il           |noticed how it remains so popular?

      reply	other threads:[~2012-08-01 11:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  3:50 Tracking nested guest ioctl in L0 hypervisor siddhesh phadke
2012-08-01 10:52 ` Nadav Har'El [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120801105245.GA17325@fermat.math.technion.ac.il \
    --to=nyh@math.technion.ac.il \
    --cc=kvm@vger.kernel.org \
    --cc=phadkesap@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).