qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mulyadi Santosa <mulyadi.santosa@gmail.com>
To: helicoterus-elih@yahoo.it
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] How does a system call work on QEMU?
Date: Thu, 14 May 2009 11:38:06 +0700	[thread overview]
Message-ID: <f284c33d0905132138l634fdad9rc00ed89e930f68b9@mail.gmail.com> (raw)
In-Reply-To: <851.61304.qm@web28606.mail.ukl.yahoo.com>

On 5/14/09, helicoterus-elih@yahoo.it <helicoterus-elih@yahoo.it> wrote:
>
> Paravirtualized Xen guest kernel is on ring1 so Xen must forward system
> calls to it and then guest kernel replies with a hypercall to Xen.
> How does a system call work on QEMU?
> When a guest kernel wants to directly access to device or perform a
> sensitive but not privilege instruction, what's happened?

Which mode of Qemu operations do you refer to? if you refer to full
MMU emulation (no KVM or kqemu involved then), then intercepting
syscall is basically intercepting interrupt 80 hex or SYSENTER/SYSCALL
into host user mode instruction during code translation.

Using KVM, it behaves more or less the same like Xen. KVM hypervisor
sits in ring zero root mode (sometimes I am confused about root and
non root mode, so guys CMIIW), while  guest kernel sits in ring 0 non
root mode. Non privileged instruction is directly handled by CPU,
while privileged one make CPU exits to root mode. CPU will trap such
instructions and redirect them to KVM entry points.

And last, if you're refererring linux-user mode, it's using same code
translation. It just don't produce user mode code, but instead calling
syscall() C function.

That's all I can recall, CMIIW people.

regards,

Mulyadi.

  reply	other threads:[~2009-05-14  4:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 18:41 [Qemu-devel] How does a system call work on QEMU? helicoterus-elih
2009-05-14  4:38 ` Mulyadi Santosa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-05-14  6:50 helicoterus-elih
2009-05-14 10:19 ` Paul Brook
2009-05-14 13:10   ` Heli
2009-05-14 16:40     ` Avi Kivity
2009-05-14 17:11       ` grisu46
2009-05-14 17:48         ` Avi Kivity
2009-05-14 18:00           ` grisu46
2009-05-15  4:49             ` Glauber Costa
2009-05-17  8:46           ` Heli
2009-05-17  9:31             ` Avi Kivity
2009-05-17 14:41             ` Fernando Carrijo
2009-05-14 14:57 ` Mulyadi Santosa
2009-05-15  8:54 helicoterus-elih

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=f284c33d0905132138l634fdad9rc00ed89e930f68b9@mail.gmail.com \
    --to=mulyadi.santosa@gmail.com \
    --cc=helicoterus-elih@yahoo.it \
    --cc=qemu-devel@nongnu.org \
    /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).