From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Lieven Subject: Re: race between kvm-kmod-3.0 and kvm-kmod-3.3 // was: race condition in qemu-kvm-1.0.1 Date: Thu, 05 Jul 2012 14:42:42 +0200 Message-ID: <4FF58BC2.3090303@dlhnet.de> References: <4FEB2945.1030607@dlhnet.de> <4FEB3AC6.6010206@web.de> <4FEC1FC9.7050103@dlhnet.de> <4FF555A8.3000601@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , qemu-devel@nongnu.org, kvm@vger.kernel.org, Gleb Natapov To: Xiao Guangrong Return-path: Received: from ssl.dlhnet.de ([91.198.192.8]:40043 "EHLO ssl.dlh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932356Ab2GEMmo (ORCPT ); Thu, 5 Jul 2012 08:42:44 -0400 In-Reply-To: <4FF555A8.3000601@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05.07.2012 10:51, Xiao Guangrong wrote: > On 06/28/2012 05:11 PM, Peter Lieven wrote: > >> that here is bascially whats going on: >> >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> > There are two mmio emulation after user-space-exit, it is caused by mmio > read access which spans two pages. But it should be fixed by: > > commit f78146b0f9230765c6315b2e14f56112513389ad > Author: Avi Kivity > Date: Wed Apr 18 19:22:47 2012 +0300 > > KVM: Fix page-crossing MMIO > > MMIO that are split across a page boundary are currently broken - the > code does not expect to be aborted by the exit to userspace for the > first MMIO fragment. > > This patch fixes the problem by generalizing the current code for handling > 16-byte MMIOs to handle a number of "fragments", and changes the MMIO > code to create those fragments. > > Signed-off-by: Avi Kivity > Signed-off-by: Marcelo Tosatti > > Could you please pull the code from: > https://git.kernel.org/pub/scm/virt/kvm/kvm.git > and trace it again? Thank you very much, this fixes the issue I have seen. Thanks, Peter From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmlOT-0002rr-LC for qemu-devel@nongnu.org; Thu, 05 Jul 2012 08:42:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmlOO-0002j9-K2 for qemu-devel@nongnu.org; Thu, 05 Jul 2012 08:42:49 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:52218 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmlOO-0002it-AE for qemu-devel@nongnu.org; Thu, 05 Jul 2012 08:42:44 -0400 Message-ID: <4FF58BC2.3090303@dlhnet.de> Date: Thu, 05 Jul 2012 14:42:42 +0200 From: Peter Lieven MIME-Version: 1.0 References: <4FEB2945.1030607@dlhnet.de> <4FEB3AC6.6010206@web.de> <4FEC1FC9.7050103@dlhnet.de> <4FF555A8.3000601@linux.vnet.ibm.com> In-Reply-To: <4FF555A8.3000601@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] race between kvm-kmod-3.0 and kvm-kmod-3.3 // was: race condition in qemu-kvm-1.0.1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiao Guangrong Cc: Gleb Natapov , Jan Kiszka , qemu-devel@nongnu.org, kvm@vger.kernel.org On 05.07.2012 10:51, Xiao Guangrong wrote: > On 06/28/2012 05:11 PM, Peter Lieven wrote: > >> that here is bascially whats going on: >> >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio read len 3 gpa 0xa0000 val 0x10ff >> qemu-kvm-1.0-2506 [010] 60996.908000: vcpu_match_mmio: gva 0xa0000 gpa 0xa0000 Read GPA >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_mmio: mmio unsatisfied-read len 1 gpa 0xa0000 val 0x0 >> qemu-kvm-1.0-2506 [010] 60996.908000: kvm_userspace_exit: reason KVM_EXIT_MMIO (6) >> > There are two mmio emulation after user-space-exit, it is caused by mmio > read access which spans two pages. But it should be fixed by: > > commit f78146b0f9230765c6315b2e14f56112513389ad > Author: Avi Kivity > Date: Wed Apr 18 19:22:47 2012 +0300 > > KVM: Fix page-crossing MMIO > > MMIO that are split across a page boundary are currently broken - the > code does not expect to be aborted by the exit to userspace for the > first MMIO fragment. > > This patch fixes the problem by generalizing the current code for handling > 16-byte MMIOs to handle a number of "fragments", and changes the MMIO > code to create those fragments. > > Signed-off-by: Avi Kivity > Signed-off-by: Marcelo Tosatti > > Could you please pull the code from: > https://git.kernel.org/pub/scm/virt/kvm/kvm.git > and trace it again? Thank you very much, this fixes the issue I have seen. Thanks, Peter