From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshiaki Tamura Subject: Re: Question on skip_emulated_instructions() Date: Thu, 08 Apr 2010 17:10:28 +0900 Message-ID: <4BBD8F74.8070401@lab.ntt.co.jp> References: <4BBAB46B.9010405@lab.ntt.co.jp> <20100406100522.GW5235@redhat.com> <20100407154324.GF303@redhat.com> <4BBCC2C9.1040301@redhat.com> <4BBD6959.6080003@lab.ntt.co.jp> <4BBD82ED.9010105@redhat.com> <20100408071953.GI303@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Marcelo Tosatti To: Gleb Natapov Return-path: Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:65508 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752584Ab0DHIKn (ORCPT ); Thu, 8 Apr 2010 04:10:43 -0400 In-Reply-To: <20100408071953.GI303@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: > On Thu, Apr 08, 2010 at 10:17:01AM +0300, Avi Kivity wrote: >> On 04/08/2010 08:27 AM, Yoshiaki Tamura wrote: >>> >>> The requirement is that the guest must always be able to replay at >>> least the instruction which triggered the synchronization on the >>> primary. >> >> >> You have two choices: >> >> - complete execution of the instruction in both the kernel and the >> device model >> >> This is what live migration does currently. Any mmio and pio >> requests are completed, the last instruction is finalized, and state >> is saved. >> >> - complete execution of the instruction in the kernel, but queue >> execution of mmio/pio requests >> >> This is more in line with what you describe. vcpu state will be >> after the instruction, device model state will be before instruction >> completion, when you replay the queue, the device model state will >> be consistent with the vcpu state. >> > For "in" or "mmio read" you can't complete instruction without doing > actual IO. So, if the mmio/pio requests in the queue are only "out" or "mmio write" Avi's suggestion No.2 would work. But if "in" or "mmio read" are mixed with these, (We don't have to think if the queue is filled with only "in" or "mmio read" because we're currently transferring only in case of "out" or "mmio write") the story gets complicated. >>> From that point of view, I think I need to transfer the vcpu >>> state before the instruction. If I post a signal and let the >>> guest or emulator proceed, I'm not sure whether the guest on the >>> secondary can be replay as expected. Please point out if I were >>> misunderstanding. >> >> If the responses to the mmio or pio request are exactly the same, >> then the replay will happen exactly the same. I agree. What I'm wondering is how can we guarantee that the responses are the same...