Received: from eggs.gnu.org ([2001:4830:134:3::10]:42393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5sEN-0001iN-1y for qemu-devel@nongnu.org; Thu, 26 May 2016 06:09:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5sEG-0004I7-CG for qemu-devel@nongnu.org; Thu, 26 May 2016 06:09:29 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5sEG-0004I1-55 for qemu-devel@nongnu.org; Thu, 26 May 2016 06:09:24 -0400 Received: by mail-wm0-x22e.google.com with SMTP id n129so93340001wmn.1 for ; Thu, 26 May 2016 03:09:24 -0700 (PDT) Sender: Paolo Bonzini References: <2040741464256515@web29h.yandex.ru> From: Paolo Bonzini Message-ID: <42b63d52-6a22-15fa-6539-a5674e0525ef@redhat.com> Date: Thu, 26 May 2016 12:09:20 +0200 MIME-Version: 1.0 In-Reply-To: <2040741464256515@web29h.yandex.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [QESTION] target-i386/kvm: vmx realization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Poletaev , QEMU Developers Cc: pavel.dovgaluk@ispras.ru On 26/05/2016 11:55, Dmitry Poletaev wrote: > kvm_mmu_page_fault goes to nonpaging_page_fault, which don't find page in cache and calls nonpaging_map. nonpaging_map exits after critical section before out_unlock label. For me reaction is normal and looks the same on both platforms, but I think problem may be here deeper. > After #PF handling kvm enters to guest again and here difference begins. Real machine have new #PF far away from this address, but qemu falls to kvm again with #PF on 0xfe05b. > This situation repeats infinitely. Qemu vmcs fields after exit to kvm don't have important differencies (on my view) with Intel vmcs. > Some more info I received after logging qemu's address translation. > Qemu rises first #PF on first entry to guest (pml4e = 0x3d9fe001 pdpe > = 0x0). On second entry to guest, after kvm handling, it rise #PF again > (pml4e = 0x3d9fe021 pdpe = 0x3d9fa027 pde = 0x0). Next entries to guest > is the same (PF and pml4e = 0x3d9fe021 pdpe = 0x3d9fa027 pde = 0x0). I think the PDE and PTE should have become non-zero, but I'm not sure. You can use the kvm_flightrecorder script (scripts/kvm/kvm_flightrecorder in the QEMU git tree) to find where the differences start exactly. You can also compare QEMU and Bochs. BTW, have you tried running the VMX testcases from kvm-unit-tests.git? Thanks, Paolo > May be someone know, why it is happens and how I can fix my vmx realization, or where I should look.