From patchwork Mon Jun 24 12:30:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 2770741 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 41C75C0AB1 for ; Mon, 24 Jun 2013 12:31:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C15E201BE for ; Mon, 24 Jun 2013 12:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8A9B2019F for ; Mon, 24 Jun 2013 12:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751904Ab3FXMbD (ORCPT ); Mon, 24 Jun 2013 08:31:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11253 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954Ab3FXMbB (ORCPT ); Mon, 24 Jun 2013 08:31:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5OCUqoZ017460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Jun 2013 08:30:52 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-4-26.tlv.redhat.com [10.35.4.26]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5OCUo58014749; Mon, 24 Jun 2013 08:30:51 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 3D5C218D3DE; Mon, 24 Jun 2013 15:30:49 +0300 (IDT) Date: Mon, 24 Jun 2013 15:30:49 +0300 From: Gleb Natapov To: Stefan Pietsch Cc: Paolo Bonzini , Ben Hutchings , kvm@vger.kernel.org, 707257@bugs.debian.org Subject: Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with "entry failed, hardware error 0x80000021" Message-ID: <20130624123049.GH18508@redhat.com> References: <20130619134154.GN5832@redhat.com> <51C1BC34.6020303@sp.consulting.lsexperts.de> <20130619143820.GQ5832@redhat.com> <51C3357D.4020909@sp.consulting.lsexperts.de> <20130623075117.GN5832@redhat.com> <51C72792.90205@sp.consulting.lsexperts.de> <20130623173627.GA29980@redhat.com> <51C830DE.2010400@sp.consulting.lsexperts.de> <20130624114730.GF18508@redhat.com> <51C834A6.7030609@sp.consulting.lsexperts.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <51C834A6.7030609@sp.consulting.lsexperts.de> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jun 24, 2013 at 01:59:34PM +0200, Stefan Pietsch wrote: > On 24.06.2013 13:47, Gleb Natapov wrote: > > On Mon, Jun 24, 2013 at 01:43:26PM +0200, Stefan Pietsch wrote: > >> On 23.06.2013 19:36, Gleb Natapov wrote: > >>> On Sun, Jun 23, 2013 at 06:51:30PM +0200, Stefan Pietsch wrote: > >>>> On 23.06.2013 09:51, Gleb Natapov wrote: > >>>>> On Thu, Jun 20, 2013 at 07:01:49PM +0200, Stefan Pietsch wrote: > >>>>>>> Can you provide the output of 25391454e73e3156202264eb3c473825afe4bc94 > >>>>>>> and emulate_invalid_guest_state=0. Also run "x/20i $pc-20" in qemu > >>>>>>> monitor after the hang. > >>>>>> > >>>>>> > >>>>>> 25391454e73e3156202264eb3c473825afe4bc94 > >>>>>> emulate_invalid_guest_state=0 > >>>>>> > >>>>> Very interesting. Looks like somewhere during TPR access FS > >>>>> register gets corrupted. Can you remove /usr/share/kvm/kvmvapic.bin > >>>>> and try again? This will disable some code paths during TPR access and > >>>>> will narrow down the issue. > >>>> > >>>> > >>>> Doing this, qemu complains > >>>> "Could not open option rom 'kvmvapic.bin': No such file or directory", > >>>> but the virtual machine boots successful with > >>>> emulate_invalid_guest_state=0 and emulate_invalid_guest_state=1. > >>>> > >>> Hmm, I think we ate close. Can you try with upstream qemu? > >>> > >>>> kvmvapic.bin comes with Debian package "seabios 1.7.2-3". > >> > >> I already tried this with the Debian package qemu-kvm 1.5.0+dfsg-4. > > And it didn't work? Mind trying some debug kernel patches? I suspect > > your CPU does something no CPU I have do, so I want to verify it. > > > As soon as I remove "kvmvapic.bin" the virtual machine boots with > qemu-kvm 1.5.0. I just verified this with Linux kernel 3.10.0-rc5. > "emulate_invalid_guest_state=0" or "emulate_invalid_guest_state=1" make > no difference. > > Please send your patches. Here it is, run with it and kvmvapic.bin present. See what is printed in dmesg after the failure. --- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f4a5b3f..65488a4 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3385,6 +3385,7 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu, { struct vcpu_vmx *vmx = to_vmx(vcpu); u32 ar; + unsigned long rip; if (vmx->rmode.vm86_active && seg != VCPU_SREG_LDTR) { *var = vmx->rmode.segs[seg]; @@ -3408,6 +3409,9 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu, var->db = (ar >> 14) & 1; var->g = (ar >> 15) & 1; var->unusable = (ar >> 16) & 1; + rip = kvm_rip_read(vcpu); + if ((rip == 0xc101611c || rip == 0xc101611a) && seg == VCPU_SREG_FS) + printk("base=%p limit=%p selector=%x ar=%x\n", var->base, var->limit, var->selector, ar); } static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)