--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: linux-image-3.8-1-686-pae: KVM crashes with "entry failed, hardware error 0x80000021"
- From: Stefan Pietsch <stefan.pietsch@lsexperts.de>
- Date: Wed, 08 May 2013 17:45:39 +0200
- Message-id: <518A7323.7000302@sp.consulting.lsexperts.de>
Package: linux-image-3.8-1-686-pae
Version: 3.8.11-1
KVM fails with the unstable kernel 3.8.11-1.
#####
kvm -m 512 -cdrom grml32-full_2013.02.iso
KVM: entry failed, hardware error 0x80000021
If you're running a guest on an Intel machine without unrestricted mode
support, the failure can be most likely due to the guest entering an invalid
state for Intel VT. For example, the guest maybe running in big real mode
which is not supported on less recent Intel processors.
EAX=00000000 EBX=00000001 ECX=fffff000 EDX=fffff000
ESI=00195e78 EDI=00000000 EBP=de84c000 ESP=de84df64
EIP=c101611c EFL=00010246 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =007b 00000000 ffffffff 00c0f300 DPL=3 DS [-WA]
CS =0060 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
SS =0068 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
DS =007b 00000000 ffffffff 00c0f300 DPL=3 DS [-WA]
FS =0000 ffff0000 f0000fff 00f0ff00 DPL=3 CS64 [CRA]
GS =00e0 c1438b40 00000018 00409100 DPL=0 DS [--A]
LDT=0000 ffff0000 f0000fff 00f0ff00 DPL=3 CS64 [CRA]
TR =0080 c1400f00 0000206b 00008b00 DPL=0 TSS32-busy
GDT= c13f6000 000000ff
IDT= c13f5000 000007ff
CR0=8005003b CR2=ffffffff CR3=014bc000 CR4=00000690
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000700000000
DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
Code=ff ff 89 10 c3 8b 15 c4 83 40 c1 8d 84 10 00 c0 ff ff 8b 00 <c3> eb
02 f3 90 8b 10 85 d2 74 f8 c3 3d fe 00 00 00 0f 9e c0 0f b6 c0 c3 8b 15
64 7b 40 c1
#####
Host CPU: Intel(R) Core(TM) Duo CPU L2400 @ 1.66GHz
QEMU KVM Package: qemu-kvm 1.1.2+dfsg-6
Running KVM works on this host with the kernel package
linux-image-3.2.0-4-686-pae 3.2.41-2.
--- End Message ---
--- Begin Message ---
- To: 707257-done@bugs.debian.org
- Cc: Stefan Pietsch <stefan.pietsch@lsexperts.de>
- Subject: Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with "entry failed, hardware error 0x80000021"
- From: Salvatore Bonaccorso <carnil@debian.org>
- Date: Sat, 1 May 2021 17:50:52 +0200
- Message-id: <YI143B+daAVhsMhN@eldamar.lan>
- In-reply-to: <20130627200103.GA25199@redhat.com>
- References: <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> <20130624123049.GH18508@redhat.com> <51C8AF51.8060401@sp.consulting.lsexperts.de> <20130626104703.GW18508@redhat.com> <51CC47AE.20206@sp.consulting.lsexperts.de> <20130627200103.GA25199@redhat.com>
Source: linux
Source-Version: 3.10.1-1
On Thu, Jun 27, 2013 at 11:01:03PM +0300, Gleb Natapov wrote:
> On Thu, Jun 27, 2013 at 04:09:50PM +0200, Stefan Pietsch wrote:
> > On 26.06.2013 12:47, Gleb Natapov wrote:
> > > On Mon, Jun 24, 2013 at 10:42:57PM +0200, Stefan Pietsch wrote:
> > >> On 24.06.2013 14:30, Gleb Natapov wrote:
> > >>> On Mon, Jun 24, 2013 at 01:59:34PM +0200, Stefan Pietsch wrote:
> > >>>> 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.
> > >>>
> > >>>
> > >>> 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)
> > >>
> > >>
> > >> Booting kernel Linux 3.10-rc5 with your patch applied produces these
> > >> messages in dmesg when starting a virtual machine:
> > >>
> > >> emulate_invalid_guest_state=0
> > >> [ 118.732151] base=ffff0000 limit= (null) selector=f0000fff ar=0
> > >> [ 118.732341] base=ffff0000 limit= (null) selector=f0000fff ar=0
> > >>
> > > I've butchered printk format, but it gives me the idea of what is going
> > > on anyway. Can you try the patch below with
> > > emulate_invalid_guest_state=0|1?
> > >
> > >
> > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> > > index f4a5b3f..eb062ce 100644
> > > --- a/arch/x86/kvm/vmx.c
> > > +++ b/arch/x86/kvm/vmx.c
> > > @@ -3395,19 +3395,20 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
> > > var->selector = vmx_read_guest_seg_selector(vmx, seg);
> > > return;
> > > }
> > > +
> > > var->base = vmx_read_guest_seg_base(vmx, seg);
> > > var->limit = vmx_read_guest_seg_limit(vmx, seg);
> > > var->selector = vmx_read_guest_seg_selector(vmx, seg);
> > > ar = vmx_read_guest_seg_ar(vmx, seg);
> > > + var->unusable = (ar >> 16) & 1;
> > > var->type = ar & 15;
> > > var->s = (ar >> 4) & 1;
> > > var->dpl = (ar >> 5) & 3;
> > > - var->present = (ar >> 7) & 1;
> > > + var->present = !var->unusable;
> > > var->avl = (ar >> 12) & 1;
> > > var->l = (ar >> 13) & 1;
> > > var->db = (ar >> 14) & 1;
> > > var->g = (ar >> 15) & 1;
> > > - var->unusable = (ar >> 16) & 1;
> > > }
> > >
> > > static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)
> >
> >
> > Kernel 3.10-rc5 with your latest patch applied can successfully boot the
> > virtual machine with emulate_invalid_guest_state 0 or 1.
> Excellent. I will send the patch to the list. Thank you for your help
> in tracking it.
So those patch was applied in 3.11-rc1 and was backported to 3.10.1
and 3.9.10, which was 03617c188f41 ("KVM: VMX: mark unusable segment
as nonpresent").
Regards,
Salvatore
--- End Message ---