public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Wenhao Xu <xuwenhao2008@gmail.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [questions] savevm|loadvm
Date: Wed, 31 Mar 2010 13:31:38 +0200	[thread overview]
Message-ID: <m3k4ss682t.fsf@trasno.mitica> (raw)
In-Reply-To: <dd93c66a1003301003w10519cf2vc45f5674f6eb33b9@mail.gmail.com> (Wenhao Xu's message of "Tue, 30 Mar 2010 10:03:29 -0700")

Wenhao Xu <xuwenhao2008@gmail.com> wrote:
> Hi, Juan,
>    I am fresh to both QEMU and KVM. But so far, I notice that QEMU
> uses "KVM_SET_USER_MEMORY_REGION" to set memory region that KVM can
> use and uses cpu_register_physical_memory_offset to register the same
> memory to QEMU emulator, which means QEMU and KVM use the same host
> virtual memory. And therefore the memory KVM modified could be
> directly reflected to QEMU. I don't quite understand the different
> memory layout problem between the two. So I don't know exactly what
> you mean to "fix" it?

1st. qemu-kvm.git and qemu.git memory layouts are different, indeed with
qemu.git kvm mode. (yes it is complex and weird).

kvm vs qemu initialization is different.  Expecting to stop kvm, and run
tcg from there is not going to work.  I guess it would need a lot of
changes, but I haven't looked at it myself.

>    For why switching is useful? Actually, I am a master student now
> and doing a course project. What am I arguing is that QEMU could be
> potentially useful to do many instrumentation analysis, but it is a
> bit slow. So by combing with KVM, when the os runs to some place where
> we are interested in, switch it to QEMU emulator mode and do the
> analysis and then switch back.

idea is good, but I don't think that it is _so_ easy at this point.  tcg
and kvm basically live in a different world.  Not sure of what needs to
be done to make them back on sync.
>    FYI, there is a paper doing so in Xen, "Practical taint-based
> protection using demand emulation". I want to do the same "demand
> emulation" for KVM.
>
>    I am trying to patch some code.  When kvm_run returns, I tried to
> synchronize the CPU state and memory dirty map, and then run into QEMU
> emulator mode. However, I got an error, "qemu: fatal: invalid tss
> type". I don't know exactly where is the problem.

I guess you need to look at tcg startup, and see how it initializes
vcpus, and hack something around that when you try to run tcg at kvm_run
exit.

Have Fun :)

Later, Juan.

  reply	other threads:[~2010-03-31 11:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  5:59 [questions] savevm|loadvm Wenhao Xu
2010-03-30  8:22 ` Juan Quintela
2010-03-30 17:03   ` Wenhao Xu
2010-03-31 11:31     ` Juan Quintela [this message]
2010-04-01  8:42       ` Avi Kivity
2010-04-01 19:35         ` Wenhao Xu
2010-04-07  5:56           ` Avi Kivity
2010-04-01 12:20       ` [Qemu-devel] " Paul Brook
  -- strict thread matches above, loose matches on Subject: below --
2010-03-30  6:03 Wenhao Xu

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=m3k4ss682t.fsf@trasno.mitica \
    --to=quintela@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xuwenhao2008@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