From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [questions] savevm|loadvm Date: Wed, 07 Apr 2010 08:56:17 +0300 Message-ID: <4BBC1E81.3040202@redhat.com> References: <4BB45C63.3070401@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Juan Quintela , qemu-devel@nongnu.org, kvm@vger.kernel.org, aliguori@us.ibm.com, paul@codesourcery.com To: Wenhao Xu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61218 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752659Ab0DGF4h (ORCPT ); Wed, 7 Apr 2010 01:56:37 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 04/01/2010 10:35 PM, Wenhao Xu wrote: > Does current qemu-kvm (qemu v0.12.3) use the irqchip, pit of KVM? I > cannot find any KVM_CREATE_IRQCHIP and KVM_CREATE_PIT in the qemu > code. > > Are you looking at qemu or qemu-kvm? > Concerning the interface between qemu and kvm, I have the following confusion: > 1. How irqchip and pit of KVM collaborating with the irq and pit > emulation of QEMU? As far as I see, qemu-kvm still uses qemu's irq and > pit emulation, doesn't it? > No, they're completely separate. > 2. For return from KVM to QEMU, I cannot get the meaning of two exit reasons: > case KVM_EXIT_EXCEPTION: > What exception will cause KVM exit? > I think that's obsolete. > default: > dprintf("kvm_arch_handle_exit\n"); > ret = kvm_arch_handle_exit(env, run); > What exit reasons are default? > > 3. How could DMA interrupt the cpu when it finishes and the qemu-kvm > is still running in kvm now? > Usually the device that does the dma will raise an interrupt, which qemu is waiting for. > I am still working in the patch, but these confusions really prevent > me moving forward. Thanks first for you guys giving me more hints. > > > The following is the code so far I write: > The main idea is synchronizing the CPU state and enter into the > emulator mode when switching from kvm to emulator. I only do the > switch when the exit reason is KVM_EXIT_IRQ_WINDOW_OPEN. > That doesn't happen with qemu-kvm. > However, I got the following errors: > Whenever switch from kvm to qemu, the interrupt request in qemu will > cause qemu enter into smm mode which is definitely a bug. > Definitely shouldn't happen. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzOFl-00054c-7u for qemu-devel@nongnu.org; Wed, 07 Apr 2010 01:56:41 -0400 Received: from [140.186.70.92] (port=38202 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzOFi-00052J-Km for qemu-devel@nongnu.org; Wed, 07 Apr 2010 01:56:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzOFg-0004wC-Kc for qemu-devel@nongnu.org; Wed, 07 Apr 2010 01:56:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45223) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzOFf-0004uG-Jn for qemu-devel@nongnu.org; Wed, 07 Apr 2010 01:56:36 -0400 Message-ID: <4BBC1E81.3040202@redhat.com> Date: Wed, 07 Apr 2010 08:56:17 +0300 From: Avi Kivity MIME-Version: 1.0 References: <4BB45C63.3070401@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [questions] savevm|loadvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenhao Xu Cc: aliguori@us.ibm.com, paul@codesourcery.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Juan Quintela On 04/01/2010 10:35 PM, Wenhao Xu wrote: > Does current qemu-kvm (qemu v0.12.3) use the irqchip, pit of KVM? I > cannot find any KVM_CREATE_IRQCHIP and KVM_CREATE_PIT in the qemu > code. > > Are you looking at qemu or qemu-kvm? > Concerning the interface between qemu and kvm, I have the following confusion: > 1. How irqchip and pit of KVM collaborating with the irq and pit > emulation of QEMU? As far as I see, qemu-kvm still uses qemu's irq and > pit emulation, doesn't it? > No, they're completely separate. > 2. For return from KVM to QEMU, I cannot get the meaning of two exit reasons: > case KVM_EXIT_EXCEPTION: > What exception will cause KVM exit? > I think that's obsolete. > default: > dprintf("kvm_arch_handle_exit\n"); > ret = kvm_arch_handle_exit(env, run); > What exit reasons are default? > > 3. How could DMA interrupt the cpu when it finishes and the qemu-kvm > is still running in kvm now? > Usually the device that does the dma will raise an interrupt, which qemu is waiting for. > I am still working in the patch, but these confusions really prevent > me moving forward. Thanks first for you guys giving me more hints. > > > The following is the code so far I write: > The main idea is synchronizing the CPU state and enter into the > emulator mode when switching from kvm to emulator. I only do the > switch when the exit reason is KVM_EXIT_IRQ_WINDOW_OPEN. > That doesn't happen with qemu-kvm. > However, I got the following errors: > Whenever switch from kvm to qemu, the interrupt request in qemu will > cause qemu enter into smm mode which is definitely a bug. > Definitely shouldn't happen. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.