Re: KVM internal error with some amounts of guest memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 06/14/2012 11:06 PM, Michael Tokarev wrote:
> On 14.06.2012 23:45, Michael Tokarev wrote:
>> On 14.06.2012 23:22, Michael Tokarev wrote:
>>> Now that's something else.  Reported by a debian user, but
>>> trivially reproducible.
>>>
>>> $ kvm -m 1.4g
>>> KVM internal error. Suberror: 1
>>> emulation failure
>>> EAX=000e3c54 EBX=00000000 ECX=00000000 EDX=00000cfd
>>> ESI=00000000 EDI=00000000 EBP=00000000 ESP=00006fe8
>>> EIP=000f309b EFL=00000016 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
>>> ES =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
>>> CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
>>> SS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
>>> DS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
>>> FS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
>>> GS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
>>> LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
>>> TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
>>> GDT=     000fd3a8 00000037
>>> IDT=     000fd3e6 00000000
>>> CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
>>> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
>>> DR6=00000000ffff0ff0 DR7=0000000000000400
>>> EFER=0000000000000000
>>> Code=ff ff ba 59 00 00 00 a8 10 89 d8 75 09 b9 ef 2f ff ff ff d1 <eb> 23 59 5b 5e e9 4a ff ff ff 31 d2 89 f0 e8 6c fa ff ff 89 c6 85 c0 79 ab c7 04 24 8c 4c
> 
> Bisected.
> 
> This is introduced by this commit:
> 
> 8f6f962b994e1402935055ac7093ac977ccc9a5c is the first bad commit
> commit 8f6f962b994e1402935055ac7093ac977ccc9a5c
> Author: Avi Kivity <avi@xxxxxxxxxx>
> Date:   Wed Feb 29 13:22:12 2012 +0200
> 
>     kvm: fix unaligned slots
> 
>     kvm_set_phys_mem() may be passed sections that are not aligned to a page
>     boundary.  The current code simply brute-forces the alignment which leads
>     to an inconsistency and an abort().
> 
>     Fix by aligning the start and the end of the section correctly, discarding
>     and unaligned head or tail.
> 
>     This was triggered by a guest sizing a 64-bit BAR that is smaller than a page
>     with PCI_COMMAND_MEMORY enabled and the upper dword clear.
> 
>     Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
> 
> :100644 100644 c4babdac0dd3335eab1a9e45371b7df2c0dd1c9c 4b7a4ae5dd6d9bd0b4cfa37159382654f0641e8d M	kvm-all.c
> 
> Once again, this affects both qemu-kvm and qemu (with -enable-kvm) 1.1,
> at least on AMD host, and the issue gets reported immediately when
> starting the virtual machine with -m 1.4g (no other arguments).


Thanks for the clear report.  The problem is that 1.4g is not aligned on
a page boundary (in fact it's not even aligned to a byte boundary), and
some bios code tries to execute off the partial page at the end.  kvm
doesn't support executing off partial pages, hence the breakage.

The proper fix is to align the memory size, but how? upwards or
downwards?  To a page boundary or something larger?

-- 
error compiling committee.c: too many arguments to function


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[KVM ARM]     [KVM ia64]     [KVM ppc]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux