From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong 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 16:51:52 +0800 Message-ID: <4FF555A8.3000601@linux.vnet.ibm.com> References: <4FEB2945.1030607@dlhnet.de> <4FEB3AC6.6010206@web.de> <4FEC1FC9.7050103@dlhnet.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Jan Kiszka , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Peter Lieven Return-path: In-Reply-To: <4FEC1FC9.7050103@dlhnet.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smhnf-00088v-Nn for qemu-devel@nongnu.org; Thu, 05 Jul 2012 04:52:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmhnZ-0008Dd-FQ for qemu-devel@nongnu.org; Thu, 05 Jul 2012 04:52:35 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:55099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmhnT-0008CN-DJ for qemu-devel@nongnu.org; Thu, 05 Jul 2012 04:52:29 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Jul 2012 08:40:51 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q658i7Vm65732776 for ; Thu, 5 Jul 2012 18:44:09 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q658q09M003207 for ; Thu, 5 Jul 2012 18:52:00 +1000 Message-ID: <4FF555A8.3000601@linux.vnet.ibm.com> Date: Thu, 05 Jul 2012 16:51:52 +0800 From: Xiao Guangrong MIME-Version: 1.0 References: <4FEB2945.1030607@dlhnet.de> <4FEB3AC6.6010206@web.de> <4FEC1FC9.7050103@dlhnet.de> In-Reply-To: <4FEC1FC9.7050103@dlhnet.de> Content-Type: text/plain; charset=UTF-8 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: Peter Lieven Cc: Gleb Natapov , Jan Kiszka , qemu-devel@nongnu.org, kvm@vger.kernel.org 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?