Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsMgO-00072T-Ke for qemu-devel@nongnu.org; Mon, 28 Sep 2009 16:18:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsMgJ-0006yk-Da for qemu-devel@nongnu.org; Mon, 28 Sep 2009 16:18:52 -0400 Received: from [199.232.76.173] (port=55378 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsMgJ-0006yW-7K for qemu-devel@nongnu.org; Mon, 28 Sep 2009 16:18:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43502) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsMgH-0000D3-Ly for qemu-devel@nongnu.org; Mon, 28 Sep 2009 16:18:46 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8SKIhS9017617 for ; Mon, 28 Sep 2009 16:18:44 -0400 From: Juan Quintela Date: Mon, 28 Sep 2009 22:18:35 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: [Qemu-devel] heads up: guest reset after migration using --enable-kvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-=-= Hi As I spent too much time last week tracking this bug, just to let you know. If you run qemu --enable-kvm, and you do migration or loadvm from the command line, guest just loads correctly and then reset with a triple fault. Problem happens if you are using a 2.6.30.x kernel, this is going to be reverted on the next stable kernel. 2.6.31 suffers the same problem. qemu-kvm.git works here, problem is with qemu --enable-kvm. If you do loadvm from the command monitor after having run another guests, things work as expected. Later, Juan. --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Return-Path: mtosatti@redhat.com Received: from zmta03.collab.prod.int.phx2.redhat.com (LHLO zmta03.collab.prod.int.phx2.redhat.com) (10.5.5.33) by mail02.corp.redhat.com with LMTP; Mon, 28 Sep 2009 14:12:25 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 102C54DEB3; Mon, 28 Sep 2009 14:12:25 -0400 (EDT) Received: from zmta03.collab.prod.int.phx2.redhat.com ([127.0.0.1]) by localhost (zmta03.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id du7JPHVeZdEd; Mon, 28 Sep 2009 14:12:24 -0400 (EDT) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id F1B6F4C474; Mon, 28 Sep 2009 14:12:24 -0400 (EDT) Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8SICOcj006914; Mon, 28 Sep 2009 14:12:24 -0400 Received: from amt.cnet (vpn-10-27.str.redhat.com [10.32.10.27]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8SICLA6007098; Mon, 28 Sep 2009 14:12:23 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 7CD88558007; Mon, 28 Sep 2009 15:09:58 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n8SI9tNf009762; Mon, 28 Sep 2009 15:09:55 -0300 Date: Mon, 28 Sep 2009 15:09:55 -0300 From: Marcelo Tosatti To: stable@kernel.org, avi@redhat.com Cc: Juan Quintela Subject: [PATCH 2.6.31 STABLE] Revert "KVM: x86: check for cr3 validity in ioctl_set_sregs" Message-ID: <20090928180955.GB9603@amt.cnet> User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Lines: 35 Xref: neno.mitica mail.me.redhat:2558 MIME-Version: 1.0 This reverts commit 6c20e1442bb1c62914bb85b7f4a38973d2a423ba. To my understanding, it became obsolete with the advent of the more robust check in mmu_alloc_roots (89da4ff17f). Moreover, it prevents the conceptually safe pattern 1. set sregs 2. register mem-slots 3. run vcpu by setting a sticky triple fault during step 1. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity (cherry picked from commit dc7e795e3dd2a763e5ceaa1615f307e808cf3932) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3d36045..2e0b363 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4118,13 +4118,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, vcpu->arch.cr2 = sregs->cr2; mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3; - - down_read(&vcpu->kvm->slots_lock); - if (gfn_to_memslot(vcpu->kvm, sregs->cr3 >> PAGE_SHIFT)) - vcpu->arch.cr3 = sregs->cr3; - else - set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests); - up_read(&vcpu->kvm->slots_lock); + vcpu->arch.cr3 = sregs->cr3; kvm_set_cr8(vcpu, sregs->cr8); --=-=-=--