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? 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. 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. Thanks for helping me working this out. I am really stuck into this problem. regards, Wenhao On Tue, Mar 30, 2010 at 1:22 AM, Juan Quintela <quintela@xxxxxxxxxx> wrote: > Wenhao Xu <xuwenhao2008@xxxxxxxxx> wrote: >> Hi, all, >> żď˝ I am working with switching QEMU from running in KVM mode to QEMU >> emulatoin mode dynamically. >> żď˝ Intuitively, if the snapshot created using savevm in kvm mode can be >> used by the loadvm command in QEMU emulator mode, the switchment could >> makes use of this.ż I tried to do so. However, it does not work.ż Any idea >> how to fix it? >> żď˝ż Thanks for the help. > > kvm uses a different memory layout (slots in qemu/kvm lingo), that means > that memory can't be migrated (that is a big problem). Once that is > "fixed", you need to work on the several in-kernel chips that don't > exist in qemu (kvm-irq-chip and the like). Once that is fixed, you can > look for what more things are broken. > > Once here, why do you want to do that switch? > > Later, Juan. > >> regards, >> Wenhao >> >> -- >> ~_~ > -- ~_~ -- 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